Skip to content

cmd/gerritbot: constrain posts on common mistakes to development branches #97

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

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cmd/gerritbot/gerritbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,15 @@ Please visit Gerrit at %s.
return err
}

if newCL {
checkCommonMistakes := newCL
if releaseOrInternalBranch := strings.HasPrefix(pr.Base.GetRef(), "release-branch.") ||
strings.HasPrefix(pr.Base.GetRef(), "internal-branch."); releaseOrInternalBranch {
// The rules for commit messages on release and internal branches
// are different, so don't use the same rules for checking for
// common mistakes.
checkCommonMistakes = false
}
if checkCommonMistakes {
// Check if we spot any problems with the CL according to our internal
// set of rules, and if so, add an unresolved comment to Gerrit.
// If the author responds to this, it also helps a reviewer see the author has
Expand Down