Skip to content

Commit adb2d58

Browse files
qiulaidongfenggopherbot
authored andcommitted
cmd/gerritbot: constrain posts on common mistakes to development branches
This change is intended to avoid reporting suggestions that are intended for development branches, like: The commit title should start with the primary affected package name followed by a colon, like "net/http: improve [...]" On backport CLs on release and internal branches, such as: "[release-branch.go1.22] os/exec: on Windows look for [...]" Since their possible mistakes don't quite follow the same rules. For golang/go#61573. Change-Id: I36c2317a999768eb9cfce6412278d0ed1c82da72 GitHub-Last-Rev: d4f6ba3 GitHub-Pull-Request: #97 Reviewed-on: https://go-review.googlesource.com/c/build/+/591455 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Pratt <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent faf0b59 commit adb2d58

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cmd/gerritbot/gerritbot.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,15 @@ Please visit Gerrit at %s.
789789
return err
790790
}
791791

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

0 commit comments

Comments
 (0)