Skip to content

fix(graphql): skip issues that Linear reports as not found - #9322

Open
stigi wants to merge 2 commits into
apache:mainfrom
stigi:fix/graphql-linear-deleted-issue
Open

stigi wants to merge 2 commits into
apache:mainfrom
stigi:fix/graphql-linear-deleted-issue

Conversation

@stigi

@stigi stigi commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Linear Collect Comments subtask fails when an issue that DevLake already stored has been deleted in Linear:

subtask Collect Comments ended unexpectedly
  caused by: graphql query got error
  Wraps: (2) Entity not found: Issue

The GraphQL collector already skips this case for GitHub, whose message is Could not resolve to an Issue. Linear's message for the same case is Entity not found: Issue, so that error was not skipped. Collect Issue History has the same problem.

The failure also repeats. The collector state is saved only after a successful run, so the next run uses the same time window, queries the same deleted issue and fails again. On our instance one team failed every night for more than two weeks, and every subtask after Collect Comments was skipped for that team.

This PR makes isIgnorableGraphqlQueryError match Linear's message too. A deleted issue then produces the existing warning, and collection continues. Entity not found for any type other than Issue still fails.

The fix has two parts:

  1. isIgnorableGraphqlQueryError also matches Linear's Entity not found: Issue.
  2. Linear returns the deleted issue as an empty issue object without page info, and the collector fails on nil page info (handle failed in graphql collector). The Linear comment and issue history collectors now treat missing page info as the last page. The shared collector keeps its nil check, because GitHub's collectors batch several issues per query and rely on it.

Does this close any open issues?

No issue filed.

Screenshots

Not applicable (collector-only change).

Tests

helpers/pluginhelper/api/graphql_collector_test.go: added cases for Entity not found: Issue (ignored) and Entity not found: Team (not ignored). The new assertion fails before the change and passes after it. plugins/linear/tasks/page_info_test.go: a deleted issue ends pagination for both collectors, and Linear's own page info is kept. Both new tests fail before the change and pass after it. go test ./helpers/pluginhelper/api/ ./plugins/linear/tasks/ ./plugins/linear/impl/ passes.

🤖 Generated with Claude Code

stigi-work and others added 2 commits November 3, 2026 14:33
The GraphQL collector already skips GitHub's "Could not resolve to an
Issue" error so that an issue deleted upstream does not fail the child
collection. Linear reports the same case as "Entity not found: Issue",
which failed the Linear Comments and Issue History collectors.

Because the collector state is only saved after a successful run, the
failing window never moved forward: the deleted issue stayed in
_tool_linear_issues and failed every following run of that team.

Treat Linear's message the same way as GitHub's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Skipping "Entity not found: Issue" was not enough: the deleted issue
comes back as an empty `issue` object without page info, and the
GraphQL collector fails on nil page info ("handle failed in graphql
collector"). Treat a missing page info as the last page in the Linear
comment and issue history collectors.

The shared collector keeps failing on nil page info, because GitHub's
collectors batch several issues per query and rely on that check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants