From 07449b2607fadae26f2bc45c5b6f766dc80485f9 Mon Sep 17 00:00:00 2001 From: Amir Nazary Date: Mon, 23 Nov 2026 11:57:39 +0100 Subject: [PATCH] fix(github_graphql): skip pull requests that no longer resolve Refreshing stored OPEN pull requests fails the whole Collect Pull Requests subtask when GitHub answers "Could not resolve to a PullRequest" for one of them (deleted, or hidden from the GitHub App). The pipeline then fails on every run. Treat it like the existing unresolvable-issue case so the other pull requests in the batch are still collected. Co-Authored-By: Claude Opus 5.5 --- backend/helpers/pluginhelper/api/graphql_collector.go | 9 +++++---- .../helpers/pluginhelper/api/graphql_collector_test.go | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/helpers/pluginhelper/api/graphql_collector.go b/backend/helpers/pluginhelper/api/graphql_collector.go index f4f5023a043..0489b30219f 100644 --- a/backend/helpers/pluginhelper/api/graphql_collector.go +++ b/backend/helpers/pluginhelper/api/graphql_collector.go @@ -279,7 +279,7 @@ func (collector *GraphqlCollector) fetchAsync(reqData *GraphqlRequestData, handl hasNonIgnorableDataErrors := false for _, dataError := range dataErrors { if isIgnorableGraphqlQueryError(dataError) { - logger.Warn(nil, "Issue may have been transferred or deleted.") + logger.Warn(dataError, "skipping item that may have been transferred or deleted") continue } hasNonIgnorableDataErrors = true @@ -348,15 +348,16 @@ func (collector *GraphqlCollector) HasError() bool { return len(collector.workerErrors) > 0 } -// isIgnorableGraphqlQueryError reports whether err means the queried issue no -// longer exists upstream, so its children can be skipped. GitHub and Linear -// word this differently. +// isIgnorableGraphqlQueryError reports whether err means the queried issue or +// pull request is no longer visible upstream, so it can be skipped. GitHub and +// Linear word this differently. func isIgnorableGraphqlQueryError(err error) bool { if err == nil { return false } msg := err.Error() return strings.Contains(msg, "Could not resolve to an Issue") || + strings.Contains(msg, "Could not resolve to a PullRequest") || strings.Contains(msg, "Entity not found: Issue") } diff --git a/backend/helpers/pluginhelper/api/graphql_collector_test.go b/backend/helpers/pluginhelper/api/graphql_collector_test.go index 9c07435e968..fbd26358e4f 100644 --- a/backend/helpers/pluginhelper/api/graphql_collector_test.go +++ b/backend/helpers/pluginhelper/api/graphql_collector_test.go @@ -26,6 +26,7 @@ import ( func TestIsIgnorableGraphqlQueryError(t *testing.T) { assert.True(t, isIgnorableGraphqlQueryError(errors.New("Could not resolve to an Issue with the number of 17."))) + assert.True(t, isIgnorableGraphqlQueryError(errors.New("Could not resolve to a PullRequest with the number of 5329."))) assert.True(t, isIgnorableGraphqlQueryError(errors.New("Entity not found: Issue"))) assert.False(t, isIgnorableGraphqlQueryError(errors.New("Entity not found: Team"))) assert.False(t, isIgnorableGraphqlQueryError(errors.New("some other graphql error")))