New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wip] Job id prefix (jid) is now using travis numbers, shoudl work for PRs … #279
Conversation
3a19ec4
to
9004766
Compare
…too. Change-Id: I17bb2e4ab0651edb6aad7b1cad0c9d65c7ebfb63 Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
9004766
to
769e4bd
Compare
Worklog, IssueLink, IssueLinkType, IssueType, Priority, Version, Role, Resolution, SecurityLevel, Status, User, \ | ||
CustomFieldOption, RemoteLink | ||
from jira.resources import * # NOQA | ||
import xml.etree.ElementTree as etree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use defusedxml
to access ElementTree
instead of directly using it.
59d8ffc
to
ccf1291
Compare
Change-Id: I4c069a777986452ea275417f7526dd24291f41a4 Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
ccf1291
to
2dcbc4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just trying to grok some of the test changes...
getpass.getuser().upper()))[0:6] + \ | ||
str(sys.version_info[0]) + \ | ||
str(sys.version_info[1]) | ||
""" `jid` is important for avoiding concurency problems when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the comments above no longer reflect what the code is doing, which is not helpful :-(
tests outside Travis | ||
* Travis is using "Travis" username | ||
|
||
https://docs.travis-ci.com/user/environment-variables/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused. That page says not to depend on the USER being travis...
if user == 'TRAVIS' and 'TRAVIS_JOB_NUMBER' in os.environ: | ||
# please note that user underline (_) is not suppored by | ||
# jira even if is documented as supported. | ||
self.jid = 'T' + hashify(user + os.environ['TRAVIS_JOB_NUMBER']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we don't need to bring travis user into it if we're namespacing the jid with T for travis and Z for others?
Also, TRAVIS_JOB_NUMBER is going to be something like 531.3 - why do we even need to hash this to 8 digits? Can't we just replace the '.' and have a much more human-readable project key?
identifier = user + \ | ||
chr(ord('A') + sys.version_info[0]) + \ | ||
chr(ord('A') + sys.version_info[1]) | ||
self.jid = 'Z' + hashify(identifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, do we really need to hash this? With the old ZUSERNAME35 the only way we'll clash is if two users that start with the same 8 letters are running tests simultaneously (on the same version of python). Do we have any evidence of this being a problem?
And even if it was, it would never affect Travis because of the Z prefix, which is the important part...
Job id prefix (jid) is now using travis numbers, should work for PRs …
…too.
Change-Id: I17bb2e4ab0651edb6aad7b1cad0c9d65c7ebfb63
Signed-off-by: Sorin Sbarnea ssbarnea@redhat.com