New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 710547 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 633572



Sign in to add a comment

Presubmit scripts that add trybots don't interact well with polygerrit

Project Member Reported by dcheng@chromium.org, Apr 11 2017

Issue description

Original upload:
https://chromium-review.googlesource.com/c/474547/1//COMMIT_MSG
Then I guess git cl upload --gerrit noticed it needed to add some additional trybots:
https://chromium-review.googlesource.com/c/474547/2//COMMIT_MSG
Added another one:
https://chromium-review.googlesource.com/c/474547/3//COMMIT_MSG
But then when I upload a new patchset:
https://chromium-review.googlesource.com/c/474547/4//COMMIT_MSG

After the final patchset, there are now two Change-Id: lines. I guess Polygerrit always expects to find its metadata at the end of the message, but now it's duplicated. We should make these interact better.
 
Labels: Milestone-Launch Proj-Gerrit-Migration
Owner: aga...@chromium.org
Thanks for the report!

Comment 2 by aga...@chromium.org, Apr 12 2017

Cc: aga...@chromium.org
Owner: ----
Status: Available (was: Assigned)
To start off with, I'm super confused about why
a) git cl upload edited the commit message to add CQ_INCLUDE_TRYBOTS at all, instead of just doing it once in the original message
b) why it did so twice, six seconds apart
c) why it did so over 1.5 minutes after the initial upload

Like, if it just did it in the first place along with the TBR= lines and whatever else, this wouldn't be a problem. Need to do some digging into what mechanism sets that line.

Unassigning from myself because, even though I'll likely be the person to do this, I can't guarantee that it is the top thing on my stack this second. I'll grab it from our launch-blocking queue as soon as I have a sec.

Comment 3 by aga...@chromium.org, Apr 21 2017

 Issue 713955  has been merged into this issue.

Comment 4 by aga...@chromium.org, Apr 21 2017

Owner: kbr@chromium.org
Status: Assigned (was: Available)
As noted in 633572, kbr@ did the work to get the CQ_INCLUDE_TRYBOTS lines working with gerrit in the first place, so I'm asking him to look into this to see if he can easily tell why it isn't properly preserving Change-Id lines.

Ken, if you can't tell what's going on, feel free to assign back to me and I'll dig in. I'm just hopeful that you have enough retained context here that it'll be much easier for you than for me.

Comment 5 by kbr@chromium.org, Apr 24 2017

Blocking: 633572

Comment 6 by kbr@chromium.org, Apr 24 2017

I'll fix EnsureCQIncludeTrybotsAreAdded from presubmit_support.py in depot_tools so that when it adds a CQ_INCLUDE_TRYBOTS line, it does so before any Change-Id: line.

Comment 7 by kbr@chromium.org, Apr 24 2017

Cc: dpranke@chromium.org tandrii@chromium.org phajdan.jr@chromium.org
Status: Started (was: Assigned)
https://chromium-review.googlesource.com/486083 up for review.

Project Member

Comment 8 by bugdroid1@chromium.org, Apr 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/df6e7348b977771d51162cb85bead08c883ca7ad

commit df6e7348b977771d51162cb85bead08c883ca7ad
Author: Kenneth Russell <kbr@chromium.org>
Date: Tue Apr 25 20:12:11 2017

Fix addition of CQ_INCLUDE_TRYBOTS on Gerrit.

BUG= 710547 

Change-Id: I6558ba08683b8e010ac5051dabfd82d9a5b9c551
Reviewed-on: https://chromium-review.googlesource.com/486083
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>

[modify] https://crrev.com/df6e7348b977771d51162cb85bead08c883ca7ad/presubmit_support.py
[modify] https://crrev.com/df6e7348b977771d51162cb85bead08c883ca7ad/tests/presubmit_unittest.py

Project Member

Comment 9 by bugdroid1@chromium.org, Apr 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/df6e7348b977771d51162cb85bead08c883ca7ad

commit df6e7348b977771d51162cb85bead08c883ca7ad
Author: Kenneth Russell <kbr@chromium.org>
Date: Tue Apr 25 20:12:11 2017

Fix addition of CQ_INCLUDE_TRYBOTS on Gerrit.

BUG= 710547 

Change-Id: I6558ba08683b8e010ac5051dabfd82d9a5b9c551
Reviewed-on: https://chromium-review.googlesource.com/486083
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>

[modify] https://crrev.com/df6e7348b977771d51162cb85bead08c883ca7ad/presubmit_support.py
[modify] https://crrev.com/df6e7348b977771d51162cb85bead08c883ca7ad/tests/presubmit_unittest.py

Comment 10 by kbr@chromium.org, Apr 25 2017

Status: Fixed (was: Started)
This doesn't appear to completely work. From today:

WARNING: appended missing Change-Id to change description
remote: Processing changes: updated: 1, done
remote:
remote: Updated Changes:
remote:   https://chromium-review.googlesource.com/487882 Use web-style naming for TreeScope::getElementById
remote:
To https://chromium.googlesource.com/chromium/src.git
 * [new branch]                5bcf457ea5fc9710e315fa1f7cfa943ead36dc60 -> refs/for/refs/heads/master%m=rebase,notify=NONE
Status: Assigned (was: Fixed)
The resulting commit message is in https://chromium-review.googlesource.com/c/487882/4//COMMIT_MSG
Yeah. The commit message created by this code was created as expected (The CQ_INCLUDE_TRYBOTS line is right above the Change-Id line) but our expectations were wrong.
https://chromium-review.googlesource.com/c/487882/2//COMMIT_MSG


The problem here is that git expects footers (things of the format Foo-Bar: asdf) to be in their own paragraph. The CQ_INCLUDE_TRYBOTS line, inserted in between "Bug: " and "Change-Id: " is confusing it. It tries to parse everything in the last paragraph as a real git footer, and when it fails to do so, it decides that none of them are proper footers.

So the right thing to do is to add CQ_INCLUDE_TRYBOTS in a paragraph of its own, directly above the whole block of real git footers.
Owner: aga...@chromium.org
Status: Started (was: Assigned)
I've started work on this.
Prerequisite: https://chromium-review.googlesource.com/c/487606/
Implementation: https://chromium-review.googlesource.com/c/487831

Comment 15 by kbr@chromium.org, Apr 27 2017

Aaron, thanks for picking this up. I meant to do so today but was swamped.

Cc: kbr@chromium.org
np! After reviewing your CL I had enough context to dive in pretty quickly.

Will land second CL after tandrii@'s CQ-side CL lands and deploys.
Project Member

Comment 17 by bugdroid1@chromium.org, Apr 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/c06db440c9ed7876a401efe0b8d88f671aa61c36

commit c06db440c9ed7876a401efe0b8d88f671aa61c36
Author: Aaron Gable <agable@chromium.org>
Date: Thu Apr 27 16:25:34 2017

Make git_footers.add_footer more flexible

This allows inserted footers to be specified as either before
or after other potentially-present footers.

It has one slight behavior change (reflected in the tests):
If after_keys is specified but *doesn't match* any pre-existing
footers, then the behavior does *not* switch to "insert as early
as possible". The behavior switch only happens if the after_keys
actually match a footer.

R=iannucci@chromium.org

Bug:  710547 
Change-Id: If557978fe9309785285056eb557acbdc87960bb2
Reviewed-on: https://chromium-review.googlesource.com/487606
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>

[modify] https://crrev.com/c06db440c9ed7876a401efe0b8d88f671aa61c36/git_footers.py
[modify] https://crrev.com/c06db440c9ed7876a401efe0b8d88f671aa61c36/tests/git_footers_test.py

Project Member

Comment 18 by bugdroid1@chromium.org, May 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/b584c4f0d1709ca5302c38c68c6a8febf3273d17

commit b584c4f0d1709ca5302c38c68c6a8febf3273d17
Author: Aaron Gable <agable@chromium.org>
Date: Mon May 01 23:15:25 2017

Make CQ_INCLUDE_TRYBOTS support review-specific

This CL wholly revamps the way presubmit_support adds
CQ_INCLUDE_TRYBOTS lines in commit descriptions. In
particular, when the CL is being uploaded to Gerrit,
it uses our pre-existing support for manipulating git
footers to make the whole process much simpler.

R=tandrii@chromium.org

Bug:  710547 
Change-Id: I5858282a44c590f131021fa3820f1cb3f70ef620
Reviewed-on: https://chromium-review.googlesource.com/487831
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

[modify] https://crrev.com/b584c4f0d1709ca5302c38c68c6a8febf3273d17/tests/presubmit_unittest.py
[modify] https://crrev.com/b584c4f0d1709ca5302c38c68c6a8febf3273d17/git_footers.py
[modify] https://crrev.com/b584c4f0d1709ca5302c38c68c6a8febf3273d17/tests/git_footers_test.py
[modify] https://crrev.com/b584c4f0d1709ca5302c38c68c6a8febf3273d17/presubmit_support.py

Status: Fixed (was: Started)
This should now be fixed.

Sign in to add a comment