Skip to content

Fix GraphQL 502 failures by using ghastoolkit's paginated Dependency Graph queries - #208

Merged
felickz merged 4 commits into
mainfrom
copilot/fix-graphql-api-502-error
Aug 19, 2026
Merged

Fix GraphQL 502 failures by using ghastoolkit's paginated Dependency Graph queries#208
felickz merged 4 commits into
mainfrom
copilot/fix-graphql-api-502-error

Conversation

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Runs against large repositories consistently failed with ERROR:ghastoolkit.octokit:GraphQL API Status :: 502, blocking merge workflows, while the same configuration succeeded on small repositories.

Root cause

ghascompliance/octokit/graphql/GetDependencyInfo.graphql was a stale, un-paginated copy of ghastoolkit's Dependency Graph query: it requested every manifest and every dependency of every manifest in one call.

dependencyGraphManifests {          # local copy: no page limits anywhere
    edges { node { filename dependencies { edges { node { ... } } } } }
}

vs. ghastoolkit's current query, which walks manifests one page at a time and pages dependencies by cursor:

dependencyGraphManifests(first: 1, $manifests_cursor) {
    edges { node { filename dependencies(first: $dependencies_first, $dependencies_cursor) { ... } } }
}

Dependabot.graphql.loadQueries() mutates ghastoolkit's shared module-level QUERIES dict, so the local copy replaced the paginated query for every GraphQL caller in the run. On large repositories that request times out server side and GitHub responds 502.

Changes

  • Removed the local query overrides (GetDependencyInfo.graphql, GetDependencyAlerts.graphql) and the loadQueries() call in checks.py, so ghastoolkit's maintained, paginated queries are used. The alerts copy was also stale, omitting the number and state fields that getAlertsGraphQL() reads.
  • Skip the Dependency Graph fetch when there are no Dependabot alerts in checkDependabot(). Dependencies are only used to resolve alerts to package names, so a repository with zero alerts no longer issues the heavy GraphQL requests at all.
  • Added tests/test_checks.py covering the absence of local overrides, that the built-in query is paginated, and the skip/fetch behaviour of the Dependabot check.

Notes for reviewers

The action runs against vendor/ghastoolkit (0.17.7, which already has the 502/503/504 retry from #195), while unit tests run against the pipenv-installed ghastoolkit. Both ship the paginated GetDependencyInfo query, so the removal is safe for either path.

Copilot AI lite review requested due to automatic review settings August 18, 2026 22:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

…y graph calls

Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 18, 2026 22:43
Copilot AI changed the title [WIP] Fix GraphQL API 502 error causing workflow failure Fix GraphQL 502 failures by using ghastoolkit's paginated Dependency Graph queries Aug 18, 2026
Copilot AI requested a review from felickz August 18, 2026 22:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings August 19, 2026 04:41
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@felickz
felickz marked this pull request as ready for review August 19, 2026 04:41
@felickz
felickz requested a review from a team as a code owner August 19, 2026 04:41
@felickz
felickz requested a review from adrienpessu August 19, 2026 04:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread tests/test_checks.py Outdated
Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 19, 2026 04:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@felickz
felickz merged commit 5270a22 into main Aug 19, 2026
17 checks passed
@felickz
felickz deleted the copilot/fix-graphql-api-502-error branch August 19, 2026 04:53
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.

ERROR:ghastoolkit.octokit:GraphQL API Status :: 502 results into workflow failure

3 participants