Repository navigation
ci: authenticate released dependency readiness checks - #84
Merged
Merged
Conversation
Client validation ran the readiness check without a token. Since main moved to the modern atrinik-protocol 0.2.1 pin, each check reads 17 public GitHub API documents, and the Linux job ran it twice: 34 unauthenticated calls per run against the runner's shared 60/hour budget. PR #81 failed both jobs with HTTP 403 rate limit exceeded. Pass the workflow's read-only token to the readiness step only. Let `ready --output` seal the sanitized documents it fetched, as `metadata` already does, and hand that file to tools/validate.sh so its second check runs offline and its Cargo steps never receive the token. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
Both validation checkouts kept the default persist-credentials, which leaves the workflow token in a Git credentials file that later steps can read. Nothing after checkout needs authenticated Git: the steps use only local history, and Cargo uses registry sources. Turn persistence off so the readiness step is the only one that gets the token. Say that the cached readiness check makes no GitHub API calls rather than that it runs offline, since it still downloads release assets and checks crates.io. Describe the cache as a create-only write, not a seal. Have the readiness fixture assert the exact cached document and the printed result. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Later validation steps still fetch the public advisory database over anonymous network Git, so say they need no authenticated Git rather than only local Git. Checkout itself also uses the workflow token, so say the readiness step is the only step after checkout that gets it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member
Author
Self-review: #84 at 453c226What was reviewed
Findings and outcomes
Validation at the reviewed head
|
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
Client validationran the released-dependency readiness check without a token. Since main moved to the modernatrinik-protocol0.2.1 pin (#83), that check makes GitHub REST API reads on every run, against the runner's shared 60/hour unauthenticated budget. #81 failed both jobs withdependency readiness/update failed: HTTP Error 403: rate limit exceeded(run 43643580125). This PR authenticates those reads with the workflow's read-only token, gives the token to that step only, and stops the Linux job from repeating the API reads.Implementation / behavior
ready.readytwice, once as its own step and once insidetools/validate.sh. That is 34 unauthenticated calls per run, plus 17 on Windows. Each new protocol release adds one call to eachready. At about 29 releases with manifests, the Linux job alone would exceed 60 every run.ready --output PATH. It writes the sanitized documents it fetched in the existingmetadatacache format. The writer is shared withmetadata, so the schema, sanitization, size bound and create-only open are unchanged. Ifreadyis already reading a cache, it refuses to write one, so a cache only ever holds documents fetched by that host process.validate.yml.GITHUB_READ_TOKEN: ${{ github.token }}on that step only.RUNNER_TEMP. Thetools/validate.shstep getsCRATE_RELEASE_METADATA_CACHE, so its secondreadymakes no GitHub API calls: a document cache miss fails closed. It still downloads release assets and checks crates.io, as before.persist-credentials: false, so the token is not left in a Git credentials file for later steps. Nothing after checkout needs authenticated Git: the steps use only local history (rev-parse,check-attr,worktree add,archive,status,diff), and Cargo uses registry sources. The repository is public.contents: read.released-dependencies.ymlalready collects metadata on the host with the read-only token and runs the updater-policy tests andreadyagainst that file.metadata. It also requires the latest upstream crate to be on crates.io. Protocol's v2.25.0 GitHub release was published about 40 seconds before crates.io had 0.2.1. Reusing it would make every client PR fail during upstream release windows, or on a yanked newer version.readyverifies only the pinned version, as before.Validation
python3 -m unittest discover -s tools -p 'test_released_dependencies.py': 83 tests passed. That is 82 existing plus a new fixture covering:ready --outputwrites exactly the sanitized document;readyreuses it without any fetch;The new fixture fails against the previous tool.
Live, at main 3095a02 with an instrumented
fetch:ready --outputreadywithCRATE_RELEASE_METADATA_CACHEreadyClient validationpassed on b2f1bdd (run 45123800538). The log shows the token only in the readiness step's environment (masked), and the cachedreadyinsidetools/validate.shpassed.git diff --checkandpy_compilepassed, and the workflow YAML parses. actionlint was not available locally, so this PR's ownClient validationrun is the workflow proof.Limitations / follow-up
scripts/release/release-policy.cjsmaps every commit type, includingci:, to at least a minor release; earlierci:merges ci: report dependency advisories without blocking merges #70, ci: only fail pull requests on advisories they introduce #74 and ci: assign Dependabot pull requests to zoeyrose #79 shipped as v1.14.0, v1.16.0 and v1.21.0.github.tokenreads count against the repository's authenticated Actions budget (1,000/hour) instead of the shared unauthenticated one.🤖 Generated with Claude Code