Skip to content

Commit 64cc0af

Browse files
committed
added the in and between relational operator for query
1 parent b08d064 commit 64cc0af

File tree

9 files changed

+663
-13
lines changed

9 files changed

+663
-13
lines changed

VERSIONS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,6 @@
147147
Fixed defect in query construction (and results) when a target attribute value contains a '&' character.
148148

149149

150-
1.5.1 - Jun 2021
150+
1.5.1 - Jul 2021
151151
Fixed query builder to accommodate subset criteria (in | !in) and range criteria (between | !between)
152152

current-issues

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
Issue Num and Summary class importance repro'ed status
3+
#138 Impossible to retrieve attachments Bug High yes Fixed in 1.5.0
4+
opened on Apr 20, 2018 by jfthuong
5+
6+
#150 getAttachment*() functionality generally broken on pyral 1.4.2 Bug High yes Fixed in 1.5.0
7+
opened on Dec 6, 2018 by pgacva (dup of #138)
8+
9+
#169 Error trying to add a feature to collection (milestone) Bug Low yes Fixed in 1.5.0
10+
opened July 20, 2020 by reddevil311
11+
12+
#151 post() failure 'No classFor item for EngrFeature' Bug High yes Fixed in 1.5.0
13+
opened on Apr 11, 2019 by NCarteazy
14+
15+
#170 First python example in Simple Use section of overview.rst has a bug Bug Med yes Fixed in 1.5.0
16+
opened on Aug 1, 2020 by stumpjumper
17+
18+
#158 Keyerror while hydrating custom PortfolioItem after a post() or put() Bug Med yes Fixed in 1.5.0 (via #170)
19+
opened on Oct 28, 2019 by Sssnek1
20+
21+
#147 Can't parse portfolio_item Bug High no doc update in 1.5.0 to clarify
22+
opened on Aug 24, 2018 by tsal
23+
needs doc update to make clear what works for PI sub-type
24+
25+
#159 How to call the service with an URL Bug Low yes Fixed in 1.5.0
26+
opened on Jan 20 by KapsGit
27+
does a get for a PortfolioItem subtype and wants to
28+
get a ref attribute's sub-attribute
29+
... like: PortfolioItem_Feature.Parent.State
30+
31+
#157 rally.get() returns wrong results for a query with char "&" Bug Med yes fixed in 1.5.0
32+
opened on Aug 28, 2019 by Kimudai94
33+
34+
#154 Could not get Release... Bug Med no provided info in issue/closed
35+
opened on Jul 19, 2019 by KapsGit
36+
37+
#137 addCollectionItems - TypeError: 'Tag' object is not iterable UserError Med yes provided info in issue/closed
38+
opened on Mar 23, 2018 by ssah-blr
39+
used tag instance as arg to addCollectionItems when should be a list of tags
40+
41+
#-----------------------------------------------------------------------------------------------------------------------------------------------------
42+
43+
#134 LDAP username vs. authentication username Feature Low has PR that could be accepted (On-Prem customer)
44+
opened on Jan 29, 2018 by carlsonp
45+
46+
#143 Unable to specify path to certfile in Rally() kwarg verify_ssl_cert Feature Med
47+
opened on Jul 5, 2018 by Meussdorffer
48+
49+
#164 Workspace name includes a space Bug? Low no other customer has no problem with this
50+
opened on May 21 by johnhaprian (user error?)
51+
52+
#152 Fails Initializing Rally when performed more than once in an application UserBad Low yes (have an entity PortfolioItem/Project)
53+
opened on Jul 7, 2019 by jonvadney
54+
55+
#149 Cannot add custom multi-select field to Feature Bug Low no
56+
opened on Nov 19, 2018 by damon-11
57+
58+
#167 get User call doesn't fetch all user fields using pyral Bug? Low no
59+
opened on Jun 17 by Pravesh-dot-com
60+
61+
#144 No apparent way to fetch data about closed projects NonBug Low yes will not fix, no WSAPI support
62+
opened on Jul 11, 2018 by pgacv2
63+
64+
#110 Cannot get all attachments if several attachments have the same name --- Low yes will not fix, poor practice
65+
opened on Jan 29, 2017 by jfthuong

dev-1.5.0.notes

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
2+
/Users/lehki03/projects/RallyRestToolkitForPython has the current dev state as branch labeled 'hacktonia' .
3+
the above has .git/config whose remote "origin" goes to RallySoftware/RallyTools/RallyRestToolkitForPython
4+
which is the repo where things get officially released as long as I have a klehman-rally Github account.
5+
6+
/Users/lehki03/dev/github/pyral is where dev should be done, but that didn't happen in 1.5.0 dev cycle.
7+
the above has .git/config whose remote "origin" goes to klehman-rally/pyral repo (I call this mine...)
8+
usually what happens is that I do my own PR in this repo, then I PR in the RallySoftware Github org
9+
to get into master the elements that are ready for release.
10+
11+
have to set these things in your environment
12+
to be able to run tests
13+
14+
working directory /Users/lehki03/projects/RallyRestToolkitForPython
15+
16+
use pyenv, get 3.6.11 installed and use that as your baseline (follow on with 3.7 and/or 3.8 later)
17+
18+
# set up for use of pyenv
19+
eval "$(pyenv init -)"
20+
21+
pyenv shell 3.6.11
22+
23+
24+
set these env vars:
25+
PYTHON=python3.6
26+
export PYTHONPATH=".:/Users/lehki03/python:/Users/lehki03/projects/RallyRestToolkitForPython"
27+
PYTEST=/Users/lehki03/.pyenv/versions/3.6.11/lib/python3.6/site-packages/pytest.py
28+
29+
30+
################################################################################################
31+
32+
while addressing Issue #157 opened on Aug 28, 2019 by Kimudai94
33+
---- rally.get() returns wrong results for a query with char "&"
34+
35+
in the 1.4.2 code
36+
when you setProject to a name containing a '&' char the url is
37+
38+
'https://rally1.rallydev.com/slm/webservice/v2.0/PortfolioItem/Feature?fetch=Name,FormattedID&workspace=workspace/41529001&project=project/334329159&projectScopeUp=false&projectScopeDown=false&pagesize=500&start=1'
39+
40+
when you include the Project.Name in the criteria and the name has a '&' char in it...
41+
42+
'https://rally1.rallydev.com/slm/webservice/v2.0/PortfolioItem/Feature?fetch=Name,FormattedID&query=(Project.Name%20%3D%20%22R%2526D%22)&workspace=workspace/41529001&project=project/334329159&projectScopeUp=false&projectScopeDown=false&pagesize=500&start=1'
43+
44+
the url quoting encodes the '%26' as '%2526' (as the original '&' char was forced to '%26' by the query builder code).
45+
The string of '%2526' is incorrect and the Rally WSAPI machinery isn't likely to evaluate per the user intent
46+
47+
I commented the line in query_builder.py (line #195) that replaced the '&' char with '%26' in the criteria string.
48+
49+
50+
################################################################################################
51+
52+
Release Notes for 1.5.0
53+
54+
De-branded from 'CA Agile Central' to Rally again!
55+
Several defects related to custom PortfolioItem sub-types have been fixed.
56+
Now when creating or updating a custom PortfolioItem sub-type the
57+
return value will be a valid pyral instance for the sub-type.
58+
Fixed defect related to broken capability to retrieve attachments.
59+
Fixed defect related to inability to add a feature to a collection.
60+
Ability to ping Rally server before attempting connection has been dropped.
61+
Many sys admin and network admins have disabled the ping protocol for security concerns
62+
Minor documentation fixes about item attribute navigation and adding to collections.
63+
64+
65+
66+
Hackathon preso
67+
68+
Slide #1: Borrow from April hackathon and update
69+
70+
Slide #2: Get an image of a lava flow (see if you can add text on top 'pyral is on fire!'
71+
72+
o talking point (pyral has 105 customers using it and is the highest volume integration)
73+
has been the most used integration by volume since 2015
74+
hasn't had more than 2 days of attention since 2017
75+
Slide #3
76+
Take a screenshot of current-issues (above the cut-line)
77+
o talking point
78+
Several issues were defects around dealing with custom PortfolioItem sub-types
79+
Two issues were related to query criteria and result handling
80+
Some adjustments to documentation to clarify proper use.
81+
Research into other issues deemed low priority or "never fix" (On-Prem).
82+
83+
Slide #4 Peaceful meadow shot
84+
pyral 1.5.0 is ready for release!
85+
86+
87+
--- slide 1
88+
89+
Hi, I'm Kip Lehman and this is my winter 2021 Hackathon read-out.
90+
91+
For my first hackathon over 10 years ago I developed a Python
92+
interface to Rally via the WSAPI.
93+
94+
95+
--- slide 2 polar regions
96+
97+
I called it 'pyral' in the whimsical hope that an easy to use Pythonic means
98+
of accessing the Rally WSAPI would go viral (or at least be useful to
99+
some external customers).
100+
101+
The first hackathon was essentially proof of concept but 2 more
102+
hackathons got it to a place where it was released for availability
103+
for use by anyone with a Rally subscription.
104+
105+
--- slide 3 pyral is hot!
106+
107+
Since then, the usage has grown steadily. Somewhat surprisingly, in terms
108+
terms of WSAPI request volume, this package is the most used integration
109+
element that we track from the WSAPI request headers (via Splunk).
110+
As of last October, there were 105 unique subscriptions using this package.
111+
112+
The last major work on pyral was done nearly 4 years ago and since then the
113+
package has had less than 2 days with any attention besides reading emails with
114+
feature requests and issues that were posted in in the Gitub repo for this package.
115+
116+
--- slide 3 working issues list
117+
118+
For this hackathon, I wanted to assess the issues that have been
119+
added in Github by the user community and address the ones that had
120+
the most potential impact.
121+
122+
I triaged the list of issues across the dimensions of issue type (Bug, Feature,
123+
question, etc.) and impact/severity and whether or not I could reproduce the
124+
reported behavior.
125+
126+
I ended up with a list of around 20 issues, prioritized them and set to work
127+
repro'ing and fixing/implementing the top half of those.
128+
129+
The items on the bottom half were requests that had low impact. There were some
130+
related to use in an On-Prem environment, some were questions for behavior that the
131+
WSAPI either doesn't support any more or never did and there were a couple
132+
asking for behavior that was dysfunctional.
133+
134+
The major item was figuring out a way to define and use classes related to custom
135+
PortfolioItem sub-types. This consumed an inordinate amount of time but I ended
136+
up with an approach that was workable, fairly compact, supportable and very
137+
localized in the code.
138+
139+
I updated the development environment to use a more recent version of Python
140+
(3.7, which is still a couple of minor releases behind the current release).
141+
142+
There were only minor issues in getting the test suite to pass with the
143+
modifications that were done.
144+
145+
---- slide 4
146+
147+
I was very happy to update the code and docs to de-brand from 'CA Agile Central'
148+
back to Rally! I'm ready to publish the 1.5.0 release later this week.
149+
150+
Thanks for listening.
151+

dev-1.5.0.notes-short

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
/Users/lehki03/projects/RallyRestToolkitForPython has the current dev state as branch labeled 'hacktonia' .
3+
the above has .git/config whose remote "origin" goes to RallySoftware/RallyTools/RallyRestToolkitForPython
4+
which is the repo where things get officially released as long as I have a klehman-rally Github account.
5+
6+
/Users/lehki03/dev/github/pyral is where dev should be done, but that didn't happen in 1.5.0 dev cycle.
7+
the above has .git/config whose remote "origin" goes to klehman-rally/pyral repo (I call this mine...)
8+
usually what happens is that I do my own PR in this repo, then I PR in the RallySoftware Github org
9+
to get into master the elements that are ready for release.
10+
11+
have to set these things in your environment
12+
to be able to run tests
13+
14+
working directory /Users/lehki03/projects/RallyRestToolkitForPython
15+
16+
use pyenv, get 3.6.11 installed and use that as your baseline (follow on with 3.7 and/or 3.8 later)
17+
18+
# set up for use of pyenv
19+
eval "$(pyenv init -)"
20+
21+
pyenv shell 3.6.11
22+
23+
24+
set these env vars:
25+
PYTHON=python3.6
26+
export PYTHONPATH=".:/Users/lehki03/python:/Users/lehki03/projects/RallyRestToolkitForPython"
27+
PYTEST=/Users/lehki03/.pyenv/versions/3.6.11/lib/python3.6/site-packages/pytest.py
28+
29+
30+
31+
32+
################################################################################################
33+
34+
Release Notes for 1.5.0
35+
36+
Ability to ping rally server before attempting connection has been dropped.
37+
many sys admin and network admins have disabled the ping protocol for security concerns
38+
Ability to specify API Key as either APIKEY or API_KEY (this release added API_KEY)
39+
40+

doc/source/overview.rst

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,9 @@ For more information on how workspaces and projects in Rally are set up and conf
1717
the Rally documentation available via the 'Help' link from the Rally landing page
1818
displayed after your initial login.
1919

20-
.. warning::
21-
22-
As of the 1.0.0 version of **pyral** (the Python toolkit for the Rally REST API),
23-
the implementation works with Rally WSAPI 2.0 and is **not** backward compatible
24-
with Rally WSAPI 1.x.
25-
2620
.. _Rally: http://www.rallydev.com
2721

22+
2823
Simple Use
2924
==========
3025

@@ -45,8 +40,8 @@ Here's a prototype of simple use of the **pyral** package.::
4540
for rls in response:
4641
rlsStart = rls.ReleaseStartDate.split('T')[0] # just need the date part
4742
rlsDate = rls.ReleaseDate.split('T')[0] # ditto
48-
print "%-6.6s %-16.16s %s --> %s" % \
49-
(rls.Project.Name, rls.Name, rlsStart, rlsDate)
43+
print("%-6.6s %-16.16s %s --> %s" % \
44+
(rls.Project.Name, rls.Name, rlsStart, rlsDate))
5045

5146

5247
Rally Data Model
@@ -72,6 +67,7 @@ But, it is not limited to those as it is very possible to view/operate on other
7267
entities such as Workspace, Project, UserProfile, Release, Iteration, TestCaseResult,
7368
TestFolder, Tag and others.
7469

70+
7571
Full CRUD capability
7672
====================
7773

@@ -83,6 +79,7 @@ toolkit doesn't use those or provide access to them.
8379
There are example usages of **pyral** that you can adapt to offer the end-user or scriptwriter the
8480
capability of specifying ranges of identifiers of artifacts for querying/updating/deleting.
8581

82+
8683
Rally Introspection
8784
===================
8885

@@ -91,6 +88,8 @@ and the attributes associated with each type. You can also use **pyral** capabi
9188
to obtain the list of allowed values for Rally type attributes that have a pre-allocated
9289
list of values.
9390

91+
92+
9493
Queries and Results
9594
===================
9695

@@ -119,6 +118,18 @@ to obtain the value. There are two significant advantages to this, one being li
119118
the load on the server with the reduction of data returned and the other being easy and
120119
intuitive attribute access syntax.
121120

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

@@ -138,11 +149,12 @@ entity name (eg, 'Story', 'Defect', 'Task', etc). For a PortfolioItem sub-type y
138149
specify just the name of the sub-type, ie., 'Feature' or you may fully qualify it as
139150
'PortfolioItem/Feature'.
140151

152+
141153
Introduction of Dyna-Types
142154
==========================
143155

144-
As of Rally WebServices API 1.37, Rally has introduced a modification of their data model, which
145-
is termed dyna-types. This modification offers a means of establishing and using a parent type
156+
Prior to the release of Rally WebServices API v2.0, Rally introduced a modification of their data model,
157+
which is termed dyna-types. This modification offers a means of establishing and using a parent type
146158
and defining sub-types of that parent. The PortfolioItem type is now an "abstract" type from which
147159
there are some pre-defined sub-types (Theme, Strategy, Initiative, Feature).
148160
By convention, the preferred way to identify a PortfolioItem sub-type is via slashed
@@ -166,6 +178,7 @@ to avoid ambiguity in identifying the Rally entity type.
166178

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

184+

0 commit comments

Comments
 (0)