Fix GraphQL 502 failures by using ghastoolkit's paginated Dependency Graph queries - #208
Merged
Merged
Conversation
1 task
…y graph calls Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
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
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.graphqlwas a stale, un-paginated copy of ghastoolkit's Dependency Graph query: it requested every manifest and every dependency of every manifest in one call.vs. ghastoolkit's current query, which walks manifests one page at a time and pages dependencies by cursor:
Dependabot.graphql.loadQueries()mutates ghastoolkit's shared module-levelQUERIESdict, 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
GetDependencyInfo.graphql,GetDependencyAlerts.graphql) and theloadQueries()call inchecks.py, so ghastoolkit's maintained, paginated queries are used. The alerts copy was also stale, omitting thenumberandstatefields thatgetAlertsGraphQL()reads.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.tests/test_checks.pycovering 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 paginatedGetDependencyInfoquery, so the removal is safe for either path.