Repository navigation
fix: retry github graphql responses whose root fields are all null - #4995
Conversation
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
PR SummaryMedium Risk Overview The helper now uses Adds Reviewed by Cursor Bugbot for commit 602609b. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
|
There was a problem hiding this comment.
🟢 Approval recommended
The focused change matches the intended behavior, with regression coverage and no identified blocking issues.
0 open findings
What changed in this PR
Fixes transient GitHub GraphQL failures by routing error responses with all-null root fields through the existing retry logic.
Changes:
- Retries all-null root responses instead of returning unusable data.
- Preserves partial-data handling and forbidden-error behavior.
- Adds four regression tests; tests were not executed.
| File | Description |
|---|---|
| services/libs/connectors/src/connectors/github/gql.ts | Detects unresolved root fields before returning data. |
| services/libs/connectors/src/connectors/github/gql.test.ts | Covers retry recovery, exhaustion, partial data, and forbidden errors. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
A Temporal alert on 2026-10-15 16:50Z (
sync-run/github/issue-comments/cockroachdb/cockroach) failed withTypeError: Cannot read properties of null (reading 'issue')atissueComments.ts:62.GitHub answered one paginated issue-comments query with
errors: [NOT_FOUND "Could not resolve to a Repository with the name 'cockroachdb/cockroach'"]anddata: { repository: null }. The same run had resolved the repo 79 times in the preceding 81 s and the same token synced it fine on the next run, so this was a transient GitHub glitch.githubGraphqlreturnedbody.databecause{ repository: null }is truthy, skipping the existing no-data retry, and the sync dereferenced the null repository.Change
githubGraphqlnow treats a response that carries errors and whose root fields are all null as "no data": it goes through the existing 5-attempt backoff and then throwsProviderContractErrorinstead of handing the sync a null root.nodeslists with somenullentries) still pass through unchanged.FORBIDDENstill fails fast.Impact of the incident
None on data: the unit was in shadow mode, was deferred one minute, re-ran and completed.
🤖 Generated with Claude Code