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

x/build: automatic check to prevent accidental CL submission with mismatch between target branch and subject prefix #41722

Open
dmitshur opened this issue Sep 30, 2020 · 3 comments
Labels
Builders x/build issues (builders, bots, dashboards) FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Sep 30, 2020

When working on branches other than the main one, or making cherry-pick CLs, we have a convention of putting the branch name in square brackets before the subject.

From https://golang.org/wiki/MinorReleases:

The cherry-pick CL must include a message prefix like [release-branch.go1.10]

If there is a mismatch between the actual target branch of the CL and what the prefix says, we should have some automated mechanism to prevent accidental submission.

This could've helped catch:

Perhaps it can be implemented as gopherbot applying a -2 code review vote (and a comment?), or some other way. This is closely related to #10658, which is about detecting large binaries, and to #18548, which is about various server-side checks.

/cc @golang/release @cherrymui

@dmitshur dmitshur added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. FeatureRequest labels Sep 30, 2020
@dmitshur dmitshur added this to the Unreleased milestone Sep 30, 2020
@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label Sep 30, 2020
@dmitshur dmitshur changed the title x/build: -2 any CL with mismatch between target branch and subject prefix x/build: apply Hold+1 to any CL with mismatch between target branch and subject prefix May 17, 2022
@dmitshur
Copy link
Contributor Author

A newer mechanism to consider for implementing this would be a Gerrit submit requirement, rather than a Hold+1 vote.

There may be more contributors submitting to release-branch.go1.21 for the first time given the early thaw, so if not having a check causes more problems, we can consider re-prioritizing this.

@dmitshur dmitshur changed the title x/build: apply Hold+1 to any CL with mismatch between target branch and subject prefix x/build: automatic check to prevent accidental CL submission with mismatch between target branch and subject prefix Jul 18, 2023
@heschi
Copy link
Contributor

heschi commented Jul 18, 2023

I wasn't able to formulate a Gerrit search, it seems to reject all ['s and regexes are disabled. A tricium check, perhaps?

@dmitshur
Copy link
Contributor Author

Gerrit 3.8.0 added a new prefixsubject operator. I still have some questions about its behavior in all edge cases, but I sent a small change in CL 537477 to try it out and get more data points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Planned
Development

No branches or pull requests

3 participants