Repository navigation
Description
Is your feature request related to a problem? Please describe.
#619 counts every GitHub request and answers repeated reads from memory. An analyze still costs a lot: on the #619 corpus, a run sends between 36 (rust-lang/rust) and 493 (home-assistant/core) requests, one at a time. Most of them grow with the number of action references: each new owner/repo@ref costs 4 to 7 REST calls (inventory in #618).
Describe the solution you'd like
Move every GitHub read that GraphQL can batch to the GraphQL API. The cost of a run then grows per batch of action repositories, not per action reference. The run uses less of the rate limit and takes less time.
Decisions
- The work starts from a branch cut from
mainwith feat(github): send fewer GitHub requests per analyze #619 merged in, so the--debugreport and the request counting are there to measure it. - A GitHub analyze needs a token. Without one, it stops at startup with a clear message.
PLUMBER_DISABLE_GITHUB_API=1stays the way to run without the API. TheGITHUB_TOKENof a workflow run works with GraphQL, so the Plumber action is not affected. - The REST code that GraphQL replaces is deleted, the anonymous retry of the tags listing too. There is no second path to keep in sync.
- The client is go-gh
api.NewGraphQLClient, already in the dependency tree. - A GraphQL answer is never kept in memory. feat(github): send fewer GitHub requests per analyze #619 makes sure of this in its memo transport.
- A batched query can fail for one alias and work for the others. Each alias keeps the outcome its REST call has today:
NOT_FOUNDmeans missing, like a 404.- An authentication or rate-limit error means could-not-verify, never missing. A batch that fails as a whole gives could-not-verify for all its aliases. This keeps the expired-token guarantee of feat(github): send fewer GitHub requests per analyze #619.
- github.com and GitHub Enterprise Server must give the same result. When one side's schema lacks a field (for example
securityVulnerabilitiesfor theACTIONSecosystem, or the immutable release flag), that lookup uses the REST API on that side.
Scope
One PR per step, in this order:
- Action enrichment and definitions: repository fields (archived, stars,
nameWithOwner), releases, tag, branch and commit resolution with tag peeling, advisories, the tags that map a SHA to a version, immutable releases,action.ymlandaction.yaml, reusable workflows. One aliased query per batch of repositories, one batch per nesting level. Most of the cost is here. - The scanned repository: default branch, visibility, full name, branch listing and the releases written by the bot, in one query.
- Remote mode (
--github-urlwith--project): the workflow listing and every workflow file in one tree query.
These stay on REST for now: rulesets and the rules that apply to a branch, classic branch protection details, environments, and the Actions workflows, runs, jobs and logs. Sending them concurrently is a later topic.
Out of scope: GitLab, and the ISSUE-714 entrypoint probing, which #619 fixes.
Measuring
Every query asks for rateLimit { cost remaining }. The --debug report gets a GraphQL section: the queries sent, the points each one cost, and the GraphQL budget before and after the run.
Done when
- On the feat(github): send fewer GitHub requests per analyze #619 corpus (same 11 repositories, same tags, default config), the JSON reports match v0.7.23 apart from
cliVersion, with the same exit code and score. - The corpus sends at least 70% fewer REST core requests than the numbers in feat(github): send fewer GitHub requests per analyze #619, and the runs are faster.
- An analyze against GitHub Enterprise Server still works.
Implementation Hints
The REST calls to replace, with their place in the code:
github/github_metadata.go: repository, releases, tags, advisories, branch, commit and release lookups.github/github_workflows.go(enrichActions): the per-ref and per-step tag resolution.github/nested_actions.goandgithub/nested_workflows.go: action and reusable-workflow definitions, read today from raw.githubusercontent.com with a contents API fallback.github/github_branch_protection.go: repository and branch reads of the scanned repository.github/github_token_default.go: the releases listing.github/github_workflows_remote.go: remote mode listing and file reads.
Why It's Valuable
Large repositories hit the rate limit (#618), and a run waits on hundreds of requests sent in sequence. Batching them in GraphQL makes analyze faster and lets it scan bigger repositories, or more of them, within the same budget.
Activity
Exypte commentedon Nov 24, 2026
I'm working on this one, a PR is on the way.
perf(github): read action metadata through batched GraphQL queries
feat(github): stop a GitHub analyze at startup without a token
test(github): keep the scanned-repository reset in the tests
test(github): cover the REST advisory lookup on GitHub Enterprise Server
test(github): cover a forbidden repository and a timed-out batch
test(github): resolve uppercase SHA pins like lowercase ones
feat(github): send fewer GitHub requests and read GitHub through GraphQL
chore(release): 0.7.24 [skip ci]
feat(github): send fewer GitHub requests and read GitHub through Grap…