Skip to content
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

gerrit: don't wipe Trybot-Result when updating commit messages #30893

Closed
mvdan opened this issue Mar 17, 2019 · 8 comments
Closed

gerrit: don't wipe Trybot-Result when updating commit messages #30893

mvdan opened this issue Mar 17, 2019 · 8 comments
Assignees
Labels
Builders x/build issues (builders, bots, dashboards) FeatureRequest FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.

Comments

@mvdan
Copy link
Member

mvdan commented Mar 17, 2019

For example, take https://go-review.googlesource.com/c/go/+/167978. I forgot to add a line to the commit message, so I updated it in patchset 2. That wouldn't affect the trybots at all, so I left them running for patchset 1 only.

However, that has the unfortunate side effect that I've now lost the Trybot-Result label on my CL. I could re-run the trybots, but that seems a bit wasteful.

It would be nice if the label wasn't wiped when just the commit message is updated. That is, assuming that the trybots are never going to care about the commit message. I don't think they do, right now, nor do I see a reason why they should.

If this is something Gerrit just isn't designed to do, perhaps we could just have Gobot post the Trybot-Result label again if a patchset only updated the commit message.

/cc @andybons @bradfitz @dmitshur

@mvdan mvdan added Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Mar 17, 2019
@dmitshur
Copy link
Contributor

In what sense is it lost? I see a "TryBots are happy." message with a "TryBot-Result +1" vote at https://go-review.googlesource.com/c/go/+/167978#message-c36076efcbed3a38e87c5f6d4de374821854b7f5.

Are you referring to the top-level view of the CL not showing any votes?

@dmitshur dmitshur changed the title Gerrit: don't wipe Trybot-Result when updating commit messages gerrit: don't wipe Trybot-Result when updating commit messages Mar 18, 2019
@bradfitz
Copy link
Contributor

@dmitshur, yes, he's referring to the overall score on the CL. This is due to copyMinScore ... we have our Code-Review=+2 copied, but not +1 votes. See https://gerrit-review.googlesource.com/Documentation/config-labels.html#label_copyMinScore

But yes, the coordinator should & could check that a commit differs only in commit message and manually re-copy the vote without re-trying it. (But we shouldn't do the same with rebases, of course.)

@cuonglm
Copy link
Member

cuonglm commented Mar 25, 2019

@mvdan @bradfitz How about the case when the commit only update comment lines?

It's great if we can retain the result in this case, too.

@bradfitz
Copy link
Contributor

@Gnouc, that's not 100% guaranteed to result in the same results. (gofmt checks, allhelp.go staleness checks, etc)

@dmitshur
Copy link
Contributor

dmitshur commented May 1, 2019

@heschik ran into this today in https://go-review.googlesource.com/c/go/+/174740/3#message-2ed0cb78dcc91bc5f91e7c424595f08bc212e465.

To avoid running into this again until this issue is resolved, don't update commit message right after starting a trybot run.

Edit: Perhaps it was different in that it wasn't just the label that was lost, but the trybot result message as well.

@dmitshur dmitshur self-assigned this Jul 13, 2022
@dmitshur
Copy link
Contributor

dmitshur commented Jul 13, 2022

I'm planning to dedicate some time to this next week.

@dmitshur
Copy link
Contributor

From looking into this, I understand this should be a matter of updating the copyCondition of the "Run-TryBot" and "TryBot-Result" labels to be NO_CODE_CHANGE (rather than its current NO_CHANGE):

NO_CODE_CHANGE:

Matches when a new patch set is uploaded that has the same parent tree as the previous patch set and the same code diff (including context lines) as the previous patch set. This means only the commit message may be different; the change hasn’t even been rebased. Also matches if the commit message is not different, which means this includes matching patch sets that have NO_CHANGE as the change kind.

Will mail a CL.

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jul 18, 2022
@dmitshur dmitshur added this to In Progress in Go Release Team Jul 18, 2022
@dmitshur
Copy link
Contributor

dmitshur commented Jul 19, 2022

Implemented the change in https://go-review.googlesource.com/c/All-Projects/+/418075/. Editing only the commit message (but otherwise same parent and same tree) now keeps the Run-TryBot and TryBot-Result votes. So it's now possible to make commit message adjustments before submission without needing to rerun trybots.

(Coordinator still tracks the precise commit which it tested, so if the commit message is edited while a TryBot run is underway, the Run-TryBot vote will persist and coordinator will prefer to start again on the latest patch set. Teaching coordinator to detect equal tree/parent and persist the build is more involved and I'll consider out of scope of this issue. It's still better than before in that it always restarts without a need to manually reapply the Run-TryBot vote.)

Go Release Team automation moved this from In Progress to Done Jul 19, 2022
@golang golang locked and limited conversation to collaborators Jul 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Builders x/build issues (builders, bots, dashboards) FeatureRequest FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
Archived in project
Development

No branches or pull requests

5 participants