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/maintner: GitHub issue becoming 404 (e.g., due to being deleted) is not reflected in model #30184

Open
dmitshur opened this issue Feb 12, 2019 · 5 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

@dmitshur
Copy link
Contributor

dmitshur commented Feb 12, 2019

GitHub issue #23772 is currently 404.

If it's possible to do so in the scope of the work that maintner already does (i.e., it doesn't require going out of its way), then it should detect that and set its NotExist field gets to true.

c, err := godata.Get(context.Background())
if err != nil {
	panic(err)
}
i := c.GitHub().Repo("golang", "go").Issue(23772)

fmt.Println(i.NotExist)

// Output: false (but should be true)

/cc @bradfitz @jmdobry

(This came up from #30182.)

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/161906 mentions this issue: cmd/gopherbot: handle 404 GitHub issues in freezeOldIssues task

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 12, 2019
gopherbot pushed a commit to golang/build that referenced this issue Feb 12, 2019
A GitHub issue can become 404. Attempting to lock it will produce a
404 response from the GitHub API. Don't treat it as a fatal error
when it happens.

Add a check for the NotExist field. This will help after golang/go#30184
is resolved.

Updates golang/go#30182

Change-Id: Ia04c59879909b1de00bd681606bfa331fe642cd4
Reviewed-on: https://go-review.googlesource.com/c/161906
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@dmitshur dmitshur changed the title x/build/maintner: GitHub issue becoming 404 is not reflected in model x/build/maintner: GitHub issue becoming 404 (e.g., due to being deleted) is not reflected in model Oct 11, 2022
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/442156 mentions this issue: cmd/gopherbot: skip more deleted issues in addGitHubComment

gopherbot pushed a commit to golang/build that referenced this issue Oct 14, 2022
The deleted issue 55403 wasn't being detected as deleted and causing
errors. Add a little logic to handle this category of deleted issues.

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

Change-Id: I37f06a1330b6993e5526ea196074102c96fe98f9
Reviewed-on: https://go-review.googlesource.com/c/build/+/442156
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/593056 mentions this issue: cmd/gopherbot: handle gone issues in setMilestone too

gopherbot pushed a commit to golang/build that referenced this issue Jun 17, 2024
The "label proposals" task adds the "Proposal" label and sets the
"Proposal" milestone, whichever is missing, to proposal issues.
It got stuck processing a no-longer-existing proposal issue 67913:

milestone-Proposal
	https://go.dev/issue/67913  proposal: exp/xerrors: add try and handle
2024/06/17 15:24:10 label proposals: PATCH https://api.github.com/repos/golang/go/issues/67913: 404 Not Found []
2024/06/17 15:24:10 gopherbot ran in 33.445731908s
2024/06/17 15:24:10 sleeping 30s after previous error.

Because it happens to set the milestone first, and setting the milestone
was missing the path to add to deletedIssues to work around for maintner
not reflecting deleted issues in its corpus (see go.dev/issue/30184).

Add that path to setMilestone. Also make the task add label first,
set milestone second, for consistency with the task's description.

While here, also mark a few issues that are known to be gone.
Tested in -dry-run mode.

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

Change-Id: I5878c944c8e8f52ab375cd433032953fb8a58d54
Reviewed-on: https://go-review.googlesource.com/c/build/+/593056
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
@melinath
Copy link

melinath commented Dec 3, 2024

This is breaking maintner for our use case - a spam PR was deleted, and now maintner fails to sync-with-github with:

404 Not Found [{Resource: Field: Code: Message:Could not resolve to a node with the global id of '<ID>'.}]

We don't care about the deleted PR, but maintner breaks trying to process it and exits with a non-zero code.

@melinath
Copy link

melinath commented Dec 3, 2024

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