Skip to content
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

x/build/cmd/gopherbot: handle transferred issues #40640

Open
toothrot opened this issue Aug 7, 2020 · 7 comments
Open

x/build/cmd/gopherbot: handle transferred issues #40640

toothrot opened this issue Aug 7, 2020 · 7 comments
Labels
Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@toothrot
Copy link
Contributor

toothrot commented Aug 7, 2020

Gopherbot currently gets stuck in an error loop when it encounters an issue that has been transferred, such as golang/vscode-go#298, which is now #40101.

2020/08/07 19:14:35 close stale WaitingForInfo: GET https://api.github.com/repos/golang/vscode-go/issues/298/comments?per_page=1000&since=2020-07-07T17%3A07%3A54Z: 404 Not Found []
2020/08/07 19:14:35 gopherbot ran in 3.547726498s
2020/08/07 19:14:35 sleeping 30s after previous error.

It shouldn't get stuck when this happens.

/cc @golang/osp-team

@toothrot toothrot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 7, 2020
@toothrot toothrot added this to the Unreleased milestone Aug 7, 2020
@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label Aug 7, 2020
@gopherbot
Copy link

Change https://golang.org/cl/247409 mentions this issue: cmd/gopherbot: skip commenting on nonexistent issues

gopherbot pushed a commit to golang/build that referenced this issue Aug 7, 2020
When an issue is transferred, we incorrectly continue trying to manage
the issue with Gopherbot, even though we should be able to pick up the
new issue. As a temporary fix, this change skips issues which return a
404 when trying to comment.

For golang/go#40640

Change-Id: I9280fab7a8ec4ead0d3e1cc5695d9b7eb39d6b32
Reviewed-on: https://go-review.googlesource.com/c/build/+/247409
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/256040 mentions this issue: cmd/gopherbot: skip labeling nonexistent issues

gopherbot pushed a commit to golang/build that referenced this issue Sep 18, 2020
When an issue is transferred, we incorrectly continue trying to manage
the issue with Gopherbot, even though we should be able to pick up the
new issue and decide if it is Gopherbot's responsibility. As a temporary
fix, this change skips issues which return a 404 when adding labels.

For golang/go#40640

Change-Id: Ib84490c1e41a71b14c0f736a41d1f6032a3c2c92
Reviewed-on: https://go-review.googlesource.com/c/build/+/256040
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
@dmitshur
Copy link
Contributor

dmitshur commented Apr 9, 2021

This issue also affected a recently added "set vscode-go milestones" task. There is more information available in #45461.

@gopherbot
Copy link

Change https://golang.org/cl/309069 mentions this issue: cmd/gopherbot: only milestone new vscode-go issues as Untriaged

gopherbot pushed a commit to golang/build that referenced this issue Apr 9, 2021
Transferred issues are getting categorized as part of this set and
returning errors when the milestone is applied, causing GitHub to rate
limit Gopherbot. Only try to milestone newly created issues as a result.

And re-enable that task now that the number of transferred issues should
be lower.

For golang/go#40640

Change-Id: I7e772d1bcda46e982f0f375481108ff10c064ae9
Reviewed-on: https://go-review.googlesource.com/c/build/+/309069
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@gopherbot
Copy link

Change https://go.dev/cl/397234 mentions this issue: maintner: mark issues as NotExist when its comments are gone

gopherbot pushed a commit to golang/build that referenced this issue Apr 1, 2022
When synchronizing comments of an issue, getting a 404 (or 410) from
GitHub REST API's list comments endpoint should happen if and only if
the issue no longer exists. Use that as a safe opportunity to append
a mutation to the log that updates the issue's NotExist field to true.

Maintner doesn't yet have complete support for transferred issues,
a feature that GitHub added after its initial design. It's been
difficult to add it retroactively as described in go.dev/issue/37603.

This change aims to make a small incremental change that we can feel
confident about applying and watching closely, and doesn't try to
implement a complete fix. It should help get maintner unstuck when
trying to sync comments in an issue tracker that has a transferred
issue, and incurs a minimal risk of writing bad mutations.

This CL is based on past work in CL 161521 and CL 176638,
but is smaller in scope intentionally.

For golang/go#37370.
For golang/go#40640.
Updates golang/go#45461.
Fixes golang/go#52017.

Change-Id: I3702d3c7b2e412cf75809fdb722c0ee693c8600e
Reviewed-on: https://go-review.googlesource.com/c/build/+/397234
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
@gopherbot
Copy link

Change https://go.dev/cl/397634 mentions this issue: cmd/gopherbot: remember which issues are discovered to be gone

@gopherbot
Copy link

Change https://go.dev/cl/397635 mentions this issue: cmd/gopherbot: skip issues that are gone more consistently

gopherbot pushed a commit to golang/build that referenced this issue Apr 8, 2022
Issues that are gone don't come back. When gopherbot encounters such
issues, it might as well remember it for the next iteration.

This change makes it so that repeating actions without effect
happen once per gopherbot startup, rather than on each iteration.
This is to reduce needless GitHub API quota consumption.

Also update the initial deletedIssues value with newly gone issues.

For golang/go#28320.
Updates golang/go#40640.

Change-Id: I36f3cb780c96ac407482d6c40b4c3e935286e10b
Reviewed-on: https://go-review.googlesource.com/c/build/+/397634
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
gopherbot pushed a commit to golang/build that referenced this issue Apr 8, 2022
The maintner Go corpus makes all issues available to its caller,
including those that are gone, are Pull Requests, are closed,
and so on. Most of gopherbot tasks operate on open non-PR issues
that aren't gone, and need to filter out non-actionable issues.

Create a wrapper that adapts maintner's ForeachIssue API for the
needs of gopherbot, so the code checking an issue's NotExist field or
presence in deletedIssues map doesn't need to be copied in each task.

Tested by running gopherbot in dry-run mode.
It didn't try to take any unexpected actions.

For golang/go#28320.
Updates golang/go#40640.

Change-Id: Icf235d046df5d371217ea14f86911ed7a39e6a3f
Reviewed-on: https://go-review.googlesource.com/c/build/+/397635
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants