зеркало из https://github.com/golang/build.git
cmd/gopherbot: don't consider reopened issues in close-cherry-pick task
gopherbot isn't supposed to fight humans. If someone has re-opened a cherry-pick issue, don't try to close it again. Rename openCherryPickIssues to cherryPickIssues, to better reflect that it's the set of candidate cherry-pick issues to close, not all open ones. Fixes golang/go#29270 Change-Id: I2b0ae9bd9849e72f7f04b208919735451c1f4593 Reviewed-on: https://go-review.googlesource.com/c/154337 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Родитель
03ea0966a8
Коммит
6a02381872
|
@ -1360,13 +1360,13 @@ func (b *gopherbot) getMinorMilestoneForMajor(ctx context.Context, majorRel stri
|
|||
// closeCherryPickIssues closes cherry-pick issues when CLs are merged to
|
||||
// release branches, as GitHub only does that on merge to master.
|
||||
func (b *gopherbot) closeCherryPickIssues(ctx context.Context) error {
|
||||
openCherryPickIssues := make(map[int32]*maintner.GitHubIssue) // by GitHub Issue Number
|
||||
cherryPickIssues := make(map[int32]*maintner.GitHubIssue) // by GitHub Issue Number
|
||||
b.gorepo.ForeachIssue(func(gi *maintner.GitHubIssue) error {
|
||||
if gi.Closed || gi.PullRequest || gi.NotExist || gi.Milestone.IsNone() {
|
||||
if gi.Closed || gi.PullRequest || gi.NotExist || gi.Milestone.IsNone() || gi.HasEvent("reopened") {
|
||||
return nil
|
||||
}
|
||||
if strings.Count(gi.Milestone.Title, ".") == 2 { // minor release
|
||||
openCherryPickIssues[gi.Number] = gi
|
||||
cherryPickIssues[gi.Number] = gi
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
@ -1388,7 +1388,7 @@ func (b *gopherbot) closeCherryPickIssues(ctx context.Context) error {
|
|||
if id := ref.Repo.ID(); id.Owner != "golang" || id.Repo != "go" {
|
||||
continue
|
||||
}
|
||||
gi, ok := openCherryPickIssues[ref.Number]
|
||||
gi, ok := cherryPickIssues[ref.Number]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче