Allow preceding text in try comment
Categories
(NSS :: Build, defect)
Tracking
(Not tracked)
People
(Reporter: pmoore, Assigned: pmoore)
References
Details
Attachments
(1 file, 3 obsolete files)
810 bytes,
patch
|
mt
:
review+
mt
:
checked-in+
|
Details | Diff | Splinter Review |
Bug 1525946 introduced a bug in the try syntax parsing.
Previously, the try commit syntax allowed text to appear before the try syntax, e.g. "Bug 12345 - fix some issue; try: -p win64 -u all -t none".
However, since bug 1525946 landed, it is no longer possible to have preceding text, i.e. you would need to commit with "try -p win64 -u all -t none".
The reason for this is that prior to that bug, mozilla-taskcluster was stripping out the try comment here. It was then referenced in .taskcluster.yml to place it in the environment variable TC_COMMENT
. Later on this is matched against a regular expression here (credits to Martin Thomson for spotting this) which allows only whitespace padding from the start of the line.
With bug 1525946, the raw hg commit comment is passed through to the regular expression, and therefore fails to match, thereby causing all tasks to get executed.
Assignee | ||
Comment 1•6 years ago
|
||
The regular expression I went for is to allow:
- any text preceding 'try:' as long as the last character is not [a-zA-Z]
- no text preceding 'try:'
This is in order to match e.g.
try: ...
Bug 12345 - lorem ipsum;try: ...
But to not match:
Psychiatry: A Clinical Treatise On Diseases of the Fore-Brain Based Upon a Study of Its Structure, Functions, and Nutrition by Theodor Meynert
Assignee | ||
Comment 3•6 years ago
|
||
I've improved the commit comment, and made the regular expression a multiline regular expression (/m
at end), since we used to allow this too here.
Assignee | ||
Comment 4•6 years ago
|
||
Seems to have worked: https://treeherder.mozilla.org/#/jobs?repo=nss-try&revision=4fccf44a27404ecc73d9ad986712dda0d3d1d6b1
The commit message was also multiline: https://hg.mozilla.org/projects/nss-try/rev/4fccf44a27404ecc73d9ad986712dda0d3d1d6b1
Assignee | ||
Comment 5•6 years ago
|
||
Applied simplification (and improvement!) suggested by :mt in IRC.
Assignee | ||
Comment 6•6 years ago
•
|
||
Weird - the v3 try push didn't filter the platforms, but the v2 try push did. They used the same commit comment.
The difference was,
- v2:
let match = comment.match(/^(?:.*[^a-zA-Z])?try:\s*(.*)\s*$/m);
- v3:
let match = comment.match(/^\btry:\s*(.*)\s*$/m);
The commit comment used in both cases was:
Bug 1546925 - allow arbitrary leading text before try syntax,try: -p win64 -u none -t none
Let's see how this goes...
Should we go back to v2 version, or shall we try to find out why v3 version failed?
Assignee | ||
Comment 7•6 years ago
|
||
Ahhhhh - I should have removed the ^
!!
Assignee | ||
Comment 8•6 years ago
|
||
Fourth time lucky?! :D
Assignee | ||
Comment 9•6 years ago
|
||
Assignee | ||
Comment 10•6 years ago
|
||
(In reply to Pete Moore [:pmoore][:pete] from comment #2)
Unfortunately the try push doesn't seem to be running...
Seems to be a problem either with the hook definition, or the hooks service. Created bug 1546951 for this.
Comment 11•6 years ago
|
||
Updated•6 years ago
|
Description
•