Skip to content

Commit 54acf3a

Browse files
committed
cmd/gopherbot: don't remove NeedsDecision from Go 2 issues
CL 180925 was a bit too aggressive. We've since cleaned up its changes (see patchset 1 of this CL). Updates golang/go#31788 Change-Id: I96b8fa4f5cbc158869e4f607aa69be130c0eda75 Reviewed-on: https://go-review.googlesource.com/c/build/+/193120 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 136868b commit 54acf3a

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

cmd/gopherbot/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ COPY gerrit /go/src/golang.org/x/build/gerrit
2727
RUN go install golang.org/x/build/gerrit
2828
COPY maintner /go/src/golang.org/x/build/maintner
2929
COPY cmd/pubsubhelper /go/src/golang.org/x/build/cmd/pubsubhelper
30+
COPY internal/foreach /go/src/golang.org/x/build/internal/foreach
3031
RUN go install golang.org/x/build/maintner/maintnerd/apipb
3132
RUN go install golang.org/x/build/maintner/godata
3233

cmd/gopherbot/gopherbot.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,8 +756,8 @@ func (b *gopherbot) labelProposals(ctx context.Context) error {
756756
}
757757
}
758758

759-
// Remove NeedsDecision label if exists:
760-
if gi.HasLabel("NeedsDecision") && !gopherbotRemovedLabel(gi, "NeedsDecision") {
759+
// Remove NeedsDecision label if exists, but not for Go 2 issues:
760+
if !isGo2Issue(gi) && gi.HasLabel("NeedsDecision") && !gopherbotRemovedLabel(gi, "NeedsDecision") {
761761
if err := b.removeLabel(ctx, gi, "NeedsDecision"); err != nil {
762762
return err
763763
}
@@ -786,6 +786,18 @@ func gopherbotRemovedLabel(gi *maintner.GitHubIssue, label string) bool {
786786
return hasRemoved
787787
}
788788

789+
// isGo2Issue reports whether gi seems like it's about Go 2, based on either labels or its title.
790+
func isGo2Issue(gi *maintner.GitHubIssue) bool {
791+
if gi.HasLabel("Go2") {
792+
return true
793+
}
794+
if !strings.Contains(gi.Title, "2") {
795+
// Common case.
796+
return false
797+
}
798+
return strings.Contains(gi.Title, "Go 2") || strings.Contains(gi.Title, "go2") || strings.Contains(gi.Title, "Go2")
799+
}
800+
789801
func (b *gopherbot) setSubrepoMilestones(ctx context.Context) error {
790802
return b.gorepo.ForeachIssue(func(gi *maintner.GitHubIssue) error {
791803
if gi.Closed || gi.PullRequest || !gi.Milestone.IsNone() || gi.HasEvent("demilestoned") || gi.HasEvent("milestoned") {

0 commit comments

Comments
 (0)