[build] cmd/gopherbot: close reopened cherry-pick issues

1 view
Skip to first unread message

Dmitri Shuralyov (Gerrit)

unread,
Feb 6, 2026, 4:47:15 PM (9 hours ago) Feb 6
to Michael Pratt, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, golang-co...@googlegroups.com
Attention needed from Michael Pratt

Dmitri Shuralyov has uploaded the change for review

Dmitri Shuralyov would like Michael Pratt to review this change.

Commit message

cmd/gopherbot: close reopened cherry-pick issues

Maintain the property that gopherbot doesn't enter a non-stop fighting
match with a human trying to reopen a cherry-pick issue, but still let
the submission of newer backport CLs re-close said issues.

Fixes golang/go#31094.
Change-Id: Iff680e761a5dbc6a928a3fac51d9e0db2c580f3d

Change diff

diff --git a/cmd/gopherbot/gopherbot.go b/cmd/gopherbot/gopherbot.go
index c93bbeb..a2b6e26 100644
--- a/cmd/gopherbot/gopherbot.go
+++ b/cmd/gopherbot/gopherbot.go
@@ -1896,7 +1896,7 @@
func (b *gopherbot) closeCherryPickIssues(ctx context.Context) error {
cherryPickIssues := make(map[int32]*maintner.GitHubIssue) // by GitHub Issue Number
b.foreachIssue(b.gorepo, open, func(gi *maintner.GitHubIssue) error {
- if gi.Milestone.IsNone() || gi.HasEvent("reopened") {
+ if gi.Milestone.IsNone() {
return nil
}
if !strings.HasPrefix(gi.Milestone.Title, "Go") {
@@ -1933,6 +1933,11 @@
// doesn't match the CL branch goX.Y version, so skip it.
continue
}
+ if issueLastOpened(gi).After(cl.Commit.CommitTime) {
+ // The issue was opened (or more likely, reopened) after this CL was submitted,
+ // so skip it.
+ continue
+ }
printIssue("close-cherry-pick", ref.Repo.ID(), gi)
if err := b.addGitHubComment(ctx, ref.Repo, gi.Number, fmt.Sprintf(
"Closed by merging [CL %d](https://go.dev/cl/%d) (commit %s) to `%s`.", cl.Number, cl.Number, cl.Commit.Hash, cl.Branch())); err != nil {
@@ -1945,6 +1950,19 @@
})
}

+// issueLastOpened reports the most recent time that the issue
+// had an "opened" or "reopened" event.
+func issueLastOpened(gi *maintner.GitHubIssue) time.Time {
+ last := gi.Created
+ gi.ForeachEvent(func(e *maintner.GitHubIssueEvent) error {
+ if e.Type == "reopened" {
+ last = e.Created
+ }
+ return nil
+ })
+ return last
+}
+
// closeLUCIConfigIssues closes specified issues when CLs are merged to the
// luci-config branch, as GitHub only does that on merge to the main branch.
func (b *gopherbot) closeLUCIConfigIssues(ctx context.Context) error {

Change information

Files:
  • M cmd/gopherbot/gopherbot.go
Change size: S
Delta: 1 file changed, 19 insertions(+), 1 deletion(-)
Open in Gerrit

Related details

Attention is currently required from:
  • Michael Pratt
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: build
Gerrit-Branch: master
Gerrit-Change-Id: Iff680e761a5dbc6a928a3fac51d9e0db2c580f3d
Gerrit-Change-Number: 742901
Gerrit-PatchSet: 1
Gerrit-Owner: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Michael Pratt <mpr...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Dmitri Shuralyov (Gerrit)

unread,
Feb 6, 2026, 4:49:31 PM (9 hours ago) Feb 6
to Dmitri Shuralyov, goph...@pubsubhelper.golang.org, Go LUCI, Michael Pratt, golang-co...@googlegroups.com
Attention needed from Michael Pratt

Dmitri Shuralyov voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Michael Pratt
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: build
Gerrit-Branch: master
Gerrit-Change-Id: Iff680e761a5dbc6a928a3fac51d9e0db2c580f3d
Gerrit-Change-Number: 742901
Gerrit-PatchSet: 1
Gerrit-Owner: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Michael Pratt <mpr...@google.com>
Gerrit-Comment-Date: Fri, 06 Feb 2026 21:49:28 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Dmitri Shuralyov (Gerrit)

unread,
Feb 6, 2026, 5:15:01 PM (9 hours ago) Feb 6
to Dmitri Shuralyov, goph...@pubsubhelper.golang.org, Go LUCI, Dmitri Shuralyov, Michael Pratt, golang-co...@googlegroups.com
Attention needed from Michael Pratt

Dmitri Shuralyov voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Michael Pratt
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: build
Gerrit-Branch: master
Gerrit-Change-Id: Iff680e761a5dbc6a928a3fac51d9e0db2c580f3d
Gerrit-Change-Number: 742901
Gerrit-PatchSet: 1
Gerrit-Owner: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Michael Pratt <mpr...@google.com>
Gerrit-Comment-Date: Fri, 06 Feb 2026 22:14:56 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Dmitri Shuralyov (Gerrit)

unread,
Feb 6, 2026, 5:19:30 PM (9 hours ago) Feb 6
to Dmitri Shuralyov, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Dmitri Shuralyov and Michael Pratt

Dmitri Shuralyov uploaded new patchset

Dmitri Shuralyov uploaded patch set #2 to this change.
Following approvals got outdated and were removed:
  • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
Open in Gerrit

Related details

Attention is currently required from:
  • Dmitri Shuralyov
  • Michael Pratt
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: build
Gerrit-Branch: master
Gerrit-Change-Id: Iff680e761a5dbc6a928a3fac51d9e0db2c580f3d
Gerrit-Change-Number: 742901
Gerrit-PatchSet: 2
Gerrit-Owner: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Attention: Michael Pratt <mpr...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Michael Pratt (Gerrit)

unread,
Feb 6, 2026, 6:36:58 PM (7 hours ago) Feb 6
to Dmitri Shuralyov, goph...@pubsubhelper.golang.org, Michael Pratt, Go LUCI, Dmitri Shuralyov, golang-co...@googlegroups.com
Attention needed from Dmitri Shuralyov

Michael Pratt voted Code-Review+2

Code-Review+2
Open in Gerrit

Related details

Attention is currently required from:
  • Dmitri Shuralyov
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: build
Gerrit-Branch: master
Gerrit-Change-Id: Iff680e761a5dbc6a928a3fac51d9e0db2c580f3d
Gerrit-Change-Number: 742901
Gerrit-PatchSet: 2
Gerrit-Owner: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Comment-Date: Fri, 06 Feb 2026 23:36:56 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages