Skip to content

Commit

Permalink
Merge branch 'klehman-rally-master'
Browse files Browse the repository at this point in the history
more rigamarole trying to pull klehman-rally/master into this repo's
master branch
  • Loading branch information
klehman-rally committed Jul 21, 2021
2 parents 36ca7ed + cf36206 commit 7f795b3
Show file tree
Hide file tree
Showing 129 changed files with 20,433 additions and 14,263 deletions.
10 changes: 5 additions & 5 deletions PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Metadata-Version: 1.1
Name: pyral
Version: 1.5.0
Version: 1.5.1
Summary: Python toolkit for Rally REST API
Home-page: https://github.com/RallyTools/RallyRestToolkitForPython
Author: Kip Lehman (Broadcom, Enterprise Software Division)
License: BSD
Download-URL: https://github.com/RallyTools/RallyRestToolkitForPython/raw/master/dists/pyral-1.5.0.zip
Download-URL: https://github.com/RallyTools/RallyRestToolkitForPython/raw/master/dists/pyral-1.5.1.zip
Description: This is the README file for pyral, a package implementing a
Pythonic interface to the Rally REST API

Expand All @@ -28,7 +28,7 @@ Description: This is the README file for pyral, a package implementing a
The pyral package requires the use of Kenneth Reitz's requests package using version 2.12.0 or better.
As of requests version 2.0.0, there is support for HTTPS over HTTP proxy via the CONNECT request.
The requests package can be found via the Python Package Index site (http://pypi/python.org/index).
The most recent release of pyral (1.5.0) has been tested with requests 2.22.0.
The most recent release of pyral (1.5.1) has been tested with requests 2.22.0.
The six module is also required.


Expand Down Expand Up @@ -73,17 +73,17 @@ Description: This is the README file for pyral, a package implementing a

Keywords: rally,api
Requires: six
Requires: requests>=2.12.5
Requires: requests>=2.25.1
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Obtain the requests_ package and install it according to that package's directio
As of requests-2.0.0, there is support for HTTPS over HTTP proxy via the CONNECT request.
Use of requests-2.x or better is recommended for use with pyral.
The requests_ package can be found via the Python Package Index site (http://pypi/python.org/index).
The most recent release of pyral (1.5.0) has been tested using requests 2.22.0.
The most recent release of pyral (1.5.1) has been tested using requests 2.22.0.

Obtain and install the six_ module (available from PyPI at https://pypi.python.org/pypi/six)

Expand Down Expand Up @@ -74,7 +74,7 @@ relevant packages.
>> import requests
>> import pyral
>> pyral.__version__
(1, 5, 0)
(1, 5, 1)



Expand Down
2 changes: 1 addition & 1 deletion README.short
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Requirements
The pyral package requires the use of Kenneth Reitz's requests package using version 2.12.0 or better.
As of requests version 2.0.0, there is support for HTTPS over HTTP proxy via the CONNECT request.
The requests package can be found via the Python Package Index site (http://pypi/python.org/index).
The most recent release of pyral (1.5.0) has been tested with requests 2.22.0.
The most recent release of pyral (1.5.1) has been tested with requests 2.22.0.
The six module is also required.


Expand Down
7 changes: 7 additions & 0 deletions VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,10 @@
Fixed defect where a feature item could not be added to a Milestones collection
Fixed defect in query construction (and results) when a target attribute value contains a '&' character.


1.5.1 - Jul 2021
Fixed query builder to accommodate subset criteria (in | !in) and range criteria (between | !between).
Dropped mention of Python 3.5 as a supported version in PKG-INFO.
Added mention of Python 3.9 as a supported version in PKG-INFO.
Excised all mentions of AgileCentral in the docs, replaced by 'Rally'.

16 changes: 11 additions & 5 deletions build_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import re

PACKAGE_NAME = "pyral"
VERSION = "1.5.0"
VERSION = "1.5.1"

AUX_FILES = ['MANIFEST.in',
'PKG-INFO',
Expand Down Expand Up @@ -63,6 +63,12 @@
'doc/build/html/objects.inv',
'doc/build/html/_sources',
'doc/build/html/_static',
'doc/build/html/_static/css',
'doc/build/html/_static/css/fonts',
'doc/build/html/_static/fonts',
'doc/build/html/_static/fonts/Lato',
'doc/build/html/_static/fonts/RobotoSlab',
'doc/build/html/_static/js',
]

#
Expand Down Expand Up @@ -243,10 +249,10 @@ def make_online_docs_zipfile(pkg_name, pkg_version, doc_dir, doc_files):
zf_name = '%s-%s.docs.html.zip' % (pkg_name, pkg_version)
cur_dir = os.getcwd()
os.chdir(doc_dir)
zf = zipfile.ZipFile(zf_name, 'w')
for fn in doc_files:
zf.write(fn, fn, zipfile.ZIP_DEFLATED)
zf.close()
#zf = zipfile.ZipFile(zf_name, 'w')
#for fn in doc_files:
# zf.write(fn, fn, zipfile.ZIP_DEFLATED)
#zf.close()

## The following is what has been done before on the command line, when you
## get the recursion opt on the above logic you can drop the os.system call
Expand Down
Binary file added dist/pyral-1.5.1-py2.py3-none-any.whl
Binary file not shown.
Binary file added dist/pyral-1.5.1.docs.html.zip
Binary file not shown.
Binary file added dist/pyral-1.5.1.tar.gz
Binary file not shown.
Binary file added dists/pyral-1.5.1.tar.gz
Binary file not shown.
Binary file added dists/pyral-1.5.1.zip
Binary file not shown.
Binary file modified doc/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified doc/build/doctrees/index.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/interface.doctree
Binary file not shown.
Binary file modified doc/build/doctrees/overview.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion doc/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 710a2f9f03546537ef3561c438ba8030
config: c8054da9968b3e8b26a06982d918e387
tags: 645f666f9bcd5a90fca523b33c5a78b7
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ Rally

To instantiate a Rally object, you'll need to provide these arguments:
* **server** usually rally1.rallydev.com unless you are using an OnPrem version
* **user** AgileCentral UserName
* **password** AgileCentral password for the given user
* **user** Rally UserName
* **password** Rally password for the given user

either in this specific order or as keyword arguments.

Expand All @@ -281,8 +281,8 @@ To instantiate a Rally object, you'll need to provide these arguments:

You can optionally specify the following as keyword arguments:
* apikey (alternate credential specification)
* workspace (name of the AgileCentral workspace)
* project (name of the AgileCentral project)
* workspace (name of the Rally workspace)
* project (name of the Rally project)
* verify_ssl_cert (True or False, default is True)
* warn (True or False, default is True)
Controls whether a warning is issued if no project is specified
Expand All @@ -307,7 +307,7 @@ To instantiate a Rally object, you'll need to provide these arguments:
For subscriptions with a small to moderate number of workspaces (up to a few dozen),
the performance savings will be relatively minor when using isolated_workspace=True
vs. isolated_workspace=False. However, for subscriptions with a large number of
workspaces, using isolated_workspace=False results in a request to AgileCentral
workspaces, using isolated_workspace=False results in a request to Rally
for each workspace, which can result in a noticeable lag before the instantiation
statement returns a ready-for-use Rally instance.
* headers dict with entries for name, vendor, version of software/integration using this package.
Expand Down Expand Up @@ -707,11 +707,11 @@ pyral.Rally experimental convenience methods
.. warning::

This method only works when the collection attribute on the target_item is Modifiable.
Consult the AgileCentral WSAPI documentation for the target_item attributes to see whether
Consult the Rally WSAPI documentation for the target_item attributes to see whether
the attribute of interest has a notation of 'Collection Modifiable yes'. If there is no
'Colletion Modifiable' notation or the value for that is 'no', then use of this method
should not be attempted.
At this time, the AgileCentral WSAPI schema endpoint does not include information about
At this time, the Rally WSAPI schema endpoint does not include information about
'Collection Modifiable' for any of the attributes, you'll have to consult the documentation.

.. method:: dropCollectionItems(target_item, collection_items)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ For more information on how workspaces and projects in Rally are set up and conf
the Rally documentation available via the 'Help' link from the Rally landing page
displayed after your initial login.

.. warning::

As of the 1.0.0 version of **pyral** (the Python toolkit for the Rally REST API),
the implementation works with Rally WSAPI 2.0 and is **not** backward compatible
with Rally WSAPI 1.x.

.. _Rally: http://www.rallydev.com


Simple Use
==========

Expand All @@ -42,11 +37,11 @@ Here's a prototype of simple use of the **pyral** package.::
response = rally.get('Release', fetch="Project,Name,ReleaseStartDate,ReleaseDate",
order="ReleaseDate")

for release in response:
for rls in response:
rlsStart = rls.ReleaseStartDate.split('T')[0] # just need the date part
rlsDate = rls.ReleaseDate.split('T')[0] # ditto
print "%-6.6s %-16.16s %s --> %s" % \
(rls.Project.Name, rls.Name, rlsStart, rlsDate)
print("%-6.6s %-16.16s %s --> %s" % \
(rls.Project.Name, rls.Name, rlsStart, rlsDate))


Rally Data Model
Expand All @@ -72,15 +67,19 @@ But, it is not limited to those as it is very possible to view/operate on other
entities such as Workspace, Project, UserProfile, Release, Iteration, TestCaseResult,
TestFolder, Tag and others.


Full CRUD capability
====================

The Python toolkit for the Rally REST API offers the full spectrum of CRUD capabilities that the
credentials supplied for your subscription/workspace/project permit. While the Rally
REST API itself doesn't support bulk operations, there are example usages of
**pyral** that you can adapt to offer the end-user or scriptwriter the
credentials supplied for your subscription/workspace/project permit. Rally
REST API did not originally support bulk operations when this toolkit was written.
Since the 2017/2018 timeframe the Rally REST WSAPI has provided some bulk operations, but this
toolkit doesn't use those or provide access to them.
There are example usages of **pyral** that you can adapt to offer the end-user or scriptwriter the
capability of specifying ranges of identifiers of artifacts for querying/updating/deleting.


Rally Introspection
===================

Expand All @@ -89,12 +88,14 @@ and the attributes associated with each type. You can also use **pyral** capabi
to obtain the list of allowed values for Rally type attributes that have a pre-allocated
list of values.



Queries and Results
===================

The Rally REST API has two interesting characteristics that the Python toolkit for the Rally REST API
insulates the scriptwriter from having to deal with. The first is that the Rally REST API
has a maximum "pagesize" of 200 records to limit volume and prevent unwarranted hijacking of the
has a maximum "pagesize" to limit volume and prevent unwarranted hijacking of the
Rally SaaS servers. But, having script writers deal with this directly to obtain further
"pages" would be burdensome and out of character with the mainstream of Python interfaces
to SaaS services. The Python toolkit for the Rally REST API (**pyral**) takes care
Expand All @@ -104,19 +105,31 @@ requests on the Rally server.

The second characteristic is that the Rally REST API for some queries and results returns
not a scalar value but a reference to yet another entity in the Rally system. A Project or
a Release are good examples of these. Say your query specified the retrieval of some UserStories,
a Release are good examples of these. Say your query specified the retrieval of some Stories,
and you listed the Project as a field to return with these results. From an end-user perspective,
seeing the project name as opposed to an URL with an ObjectID value would be far more intuitive.

The Python toolkit for the Rally REST API offers this sort of intuitive behavior by "chasing" the URL
to obtain the more human friendly and intuitive information for display. This sort of behavior is
also present in so-called "lazy-evaluation" of entity attributes that may be containers as well
as references. The scriptwriter merely has to refer to the attribute with the dot ('.') notation
and **pyral** takes care of the communication with the Rally server
also present in so-called "lazy-evaluation" of entity attributes that may be containers (collections)
as well as references. The scriptwriter merely has to refer to the attribute with the
dot ('.') notation and **pyral** takes care of the communication with the Rally server
to obtain the value. There are two significant advantages to this, one being lightening
the load on the server with the reduction of data returned and the other being easy and
intuitive attribute access syntax.

The query relational operators that pyral supports are:
= != > < >= <= contains !contains in !in between !between
The contains and !contains relational operators a helpful in expressing a condition where
you are looking for a field that does (or does not) contain a specific substring.
For example 'Name contains "Prior Art"' or 'ThermalPhase !contains "hot lava"'.
The in and !in relational operators are commonly used for expressions involving subsets of a
finite set of values. For example 'Severity in High, Burning, Explosive' or 'Priority !in Moribund, Meh'.
The between and !between relation operators are commonly used for expressions involving date ranges.
For example 'CreatedDate between 2018 and 2022' or 'LastUpdated !between 2021-09-22T00:00:00.000Z and 2021-09-22T07:59:59.999Z'.



Custom Fields
=============

Expand All @@ -127,11 +140,21 @@ has a DisplayName of 'Burnt Offerings Index' you can use the String of 'BurntOff
a fetch clause or a query clause or refer to the field directly on an artifact
as artifact.BurntOfferingsIndex.


PortfolioItem tips
==================
Rally has 4 standard PortfolioItem sub-types (Theme, Strategy, Initiative, and Feature).
In this toolkit, for the primary methods (get, create, update, delete), you must supply a
entity name (eg, 'Story', 'Defect', 'Task', etc). For a PortfolioItem sub-type you may
specify just the name of the sub-type, ie., 'Feature' or you may fully qualify it as
'PortfolioItem/Feature'.


Introduction of Dyna-Types
==========================

As of Rally WebServices API 1.37, Rally has introduced a modification of their data model, which
is termed dyna-types. This modification offers a means of establishing and using a parent type
Prior to the release of Rally WebServices API v2.0, Rally introduced a modification of their data model,
which is termed dyna-types. This modification offers a means of establishing and using a parent type
and defining sub-types of that parent. The PortfolioItem type is now an "abstract" type from which
there are some pre-defined sub-types (Theme, Strategy, Initiative, Feature).
By convention, the preferred way to identify a PortfolioItem sub-type is via slashed
Expand All @@ -152,4 +175,10 @@ here is that if you don't use PortfolioItem instances with pyral, you don't have
If you use PortfolioItem instances with pyral or you've defined your own "abstract"
parent types and specific sub-types thereof, you are strongly encouraged to use the slashed specification
to avoid ambiguity in identifying the Rally entity type.

In the event your organization has created a sub-type with the same name as a standard Rally entity
(eg, 'Project', 'Release', 'Milestone', etc.) you will be unable to use this toolkit to access those items.
There will be no consideration given to supporting any custom PortfolioItem sub-type whose name conflicts
with a Rally standard entity name.


Binary file removed doc/build/html/_static/ajax-loader.gif
Binary file not shown.
Loading

0 comments on commit 7f795b3

Please sign in to comment.