Repository navigation
chore(github): a cache cleaner, and an audit that reads main's health through GraphQL and checks Dependabot's coverage - #545
Merged
Conversation
…again, and an audit that adds up the list The audit's cache check failed today at 9.1 GB of the 10 GB limit, and the fix was a scratch script. `tools/maintainer/clean_caches.py` is that script kept: it deletes the caches of pull requests that are no longer open and of deleted branches, and, new, the superseded generations of `main`'s rust-cache families (a new lockfile or toolchain saves a cache under a new key and the old ones are never read again; the newest two per family are kept, since a build restores from the newest by key prefix). It is a dry run unless given `--delete`, paces its deletions and backs off on 429 and 403. The stale generations were most of it: of 1,180 caches and 9.1 GB, 256 were unusable (4.9 GB), 0.45 GB from closed pull requests and deleted branches and 4.49 GB from main's old generations (up to eight generations of a 200 MB cache per family). Deleted 256, none failed; 926 caches and 4.2 GB remain. The audit now adds up the list of caches instead of reading `actions/cache/usage`, which still said 9.1 GB for minutes after the deletions. docs/maintaining.md names the tool for the housekeeping item.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_60618d81-7df1-49b4-81f0-bbe8c88f8c87) |
…ks that Dependabot covers every lockfile Main's health. #536 made the check read each workflow's latest run from two differently shaped REST queries, on the reasoning that a stale answer only hides newer runs. Within the hour the same Fuzz failure from 2026-09-06 came back: both queries of the pair were stale at once, and a minute later every query shape was fresh. The REST runs list, filtered by branch, cannot be trusted in any shape, so the check now reads the check suites of main's last 100 commits through GraphQL, which reads the primary store: a workflow run is attached to the commit that was main's head when it ran, and each suite carries its event, status and conclusion. Only push and scheduled runs count, a cancelled or skipped suite says nothing, and a workflow whose last run is older than 100 commits is not judged. Checked against seven crafted answers (a failure, a fix after it, a cancelled run after a failure, a manual failure, an unfinished newest run, no runs, a GraphQL error) and the live repository. Dependabot's coverage. New check: every Cargo.lock, npm lockfile, Dockerfile and composite action in the repository tree must be under an update entry in .github/dependabot.yml, or be listed in the script as deliberately unwatched (the witness crate's exact pin). Run against main before #544 it named exactly the two gaps #544 closes, docker/Dockerfile and .github/actions/fetch-corpus/action.yml.
DrunkOnJava
enabled auto-merge (squash)
September 30, 2026 17:11
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.
Summary
Adds
tools/maintainer/clean_caches.py, which deletes the GitHub Actions caches nobody can use again, and gives the audit (#534, #536) three corrections and additions: its cache check adds up the list of caches, its check ofmain's health reads check suites through GraphQL, and a new check that Dependabot watches every lockfile, Dockerfile and composite action. Nothing in the crate, the CLIs or the viewer changes.Motivation
Three findings from running the audit on 2026-09-30.
The cache was at 9.1 GB of the 10 GB limit, and most of it was dead. GitHub evicts the least recently used cache past the limit, so a cache that sits near it leaves no room to see a real problem. The chore was a scratch script the first time (1,195 caches of closed pull requests, in #529); this keeps it, and finds what that script never looked for:
main's own superseded generations. rust-cache saves a cache per toolchain and lockfile hash, so every lockfile change (every Dependabot merge) leaves the previous generation behind, never read again, at about 200 MB each for the larger families.main(up to eight per family)The audit read
actions/cache/usage, which still said 9.1 GB for minutes after the deletions, so it now adds up the list of caches.The REST runs list lied twice in an hour, and #536's fix did not hold. #536 had the check ask each workflow for its latest run with two differently shaped queries, on the reasoning that a stale answer only hides newer runs. Later the same
Fuzz: failurefrom 2026-09-06 (run 34030881111) came back: both queries of the pair were stale at once, and a minute afterwards every shape of the query was fresh again. A filtered runs list cannot be trusted in any shape. Check suites read through GraphQL (repository.ref.target.history.nodes.checkSuites.workflowRun) come from the primary store; a run is attached to the commit that wasmain's head when it ran, and the suite carries its event, status and conclusion.Dependabot skipped two things the repository pins. #544 adds the
dockerecosystem fordocker/Dockerfileand the composite action's directory; it was found by listing the repository's manifests by hand. The audit now does that listing.Changes
tools/maintainer/clean_caches.py: lists the caches, the open pull requests and the live branches, and deletes a cache if its ref is a pull request that is not open, a branch that no longer exists, or a rust-cache generation onmainolder than the newest two of its family (--keep N). The caches ofmain's newest generations, of live branches, of open pull requests and of tags are kept. A dry run unless given--delete, which paces the deletions and backs off on 429 and 403.tools/maintainer/audit.py: the cache check sumsactions/caches;main_greenreads the check suites ofmain's last 100 commits through GraphQL (only push and scheduled runs, a cancelled or skipped suite says nothing, and a workflow whose last run is older than 100 commits is not judged); the newdependabot_coveragecheck lists everyCargo.lock, npm lockfile,Dockerfileand composite action in the repository tree and fails for each that is under no entry of.github/dependabot.yml, except the witness crate's lockfile, which is pinned on purpose.docs/maintaining.md: the housekeeping items name the tool and the coverage.CHANGELOG.md.Testing
No product code changes. The tools run against the live repository are the evidence.
clean_caches.py, dry run:1180 caches, 9.1 GB; 256 unusable (4.9 GB), 4.2 GB kept; with--delete:deleted 256, already gone 0, failed 0; dry run after:926 caches, 4.2 GB; 0 unusable (0.0 GB), 4.2 GB keptmain_greenagainst seven crafted GraphQL answers (scratch probe, output below): a failed scheduled run fails; a failure fixed by a later success is ok; a cancelled run after a failed one leaves the failure standing; a manual failure is ignored; an unfinished newest run leaves the failure before it standing; no runs is ok; a GraphQL error isskippeddependabot_coverageonmainbefore chore(github): Dependabot also watches the release image's base and the composite action #544:FAIL docker/Dockerfile (docker) is not in .github/dependabot.yml; .github/actions/fetch-corpus/action.yml (github-actions) is not in .github/dependabot.yml, exactly the two gaps chore(github): Dependabot also watches the release image's base and the composite action #544 closespython3 tools/maintainer/audit.pyon this branch brought up to date withmain(which has chore(github): Dependabot also watches the release image's base and the composite action #544):12 of 12 checks ok, including the GraphQL check ofmainandok Dependabot watches every lockfile, Dockerfile and composite action, or the audit says why notAudit-honesty checklist
gh pr checksreads check suites the same way, but nothing here proves it; if it ever lies, the check will say something false in the same way--delete, and only for caches GitHub would evict first anywayLegal and contribution hygiene
Breaking changes
None.
Related issues
Follows #534, #536 and #544.