Repository navigation
ci(#456): pin every workflow action to a commit SHA, and the rust toolchain to 1.97.1 - #713
Conversation
…rust toolchain to 1.97.1 Two related properties of ci.yml, per xerj-org#456: 1. The toolchain was not pinned. Nine jobs used dtolnay/rust-toolchain@stable and one used @nightly. That action's git REF is the mechanism that selects the installed rustc version (each version-named branch of the action repo bakes in a fixed `toolchain:` env value; `stable` resolves to rustup's `stable` channel on the day the job runs). So the compiler CI validated against could move with no commit, no review, and nothing in the diff -- verified against the actual resolved SHA in the issue's own quoted 429 log (dtolnay/rust-toolchain@stable == commit 4360b525, confirmed via `gh api repos/dtolnay/rust-toolchain/commits/stable`). 2. None of the ~38 `uses:` lines were pinned by SHA, so every job re-fetches whatever the tag currently points to from codeload.github.com -- the same fan-out the issue's 429s came from. Fix: every `uses:` in ci.yml now pins a commit SHA, with the resolved tag as a trailing comment for humans (GitHub's own supply-chain hardening convention). `dtolnay/rust-toolchain@stable` -> the SHA of that repo's `1.97.1` branch (the version already in use everywhere else in this tree -- rustc --version, and "Compiles under 1.97.1" in several recent commit messages). `dtolnay/rust-toolchain@nightly` (the fuzz job) keeps floating on PURPOSE -- nightly drift is the point there -- so only its ACTION ref is pinned, not what "nightly" resolves to on the day the job runs, matching the issue's explicit ask ("Keep @nightly where nightly is genuinely required"). Every other action (actions/checkout, Swatinem/rust-cache, actions/cache, actions/upload-artifact, actions/setup-node) is pinned the same way, at each one's current tag tip. Not changed: this only touches .github/workflows/ci.yml, the file the issue measured and quoted from. The other four workflow files (cla-field-report-exempt.yml, onnx-model-optimization-recipe.yml, release-metrics.yml, release.yml) also use unpinned tags but were not part of the issue's own measurement, so widening beyond ci.yml is left to a follow-up rather than scope-creeping this fix. Not verified (same as the issue's own "Not verified" section): whether this actually reduces 429s in practice. Pinning by SHA does not change what gets fetched from codeload.github.com per job (the archive URL is already keyed by SHA even for a tag ref, as the issue's own log line shows), so this fix's confirmed effect is xerj-org#1 (compiler drift) and general supply-chain hardening; its effect on xerj-org#2's rate-limit fan-out is the same open question the issue left open, not something this PR claims to close. All edits verified: exact per-action `uses:` occurrence counts unchanged before/after (14 checkout, 9 rust-toolchain@stable -> 1.97.1, 1 @nightly, 8 rust-cache, 2 cache, 1 upload-artifact, 3 setup-node), and the file still parses as valid YAML (python3 -c "import yaml; ..."). Claude-Session: https://claude.ai/code/session_01NTabePunzAK4kYVyZaPeTV
Independent verification (supply-chain SHA-resolution + completeness audit)For a workflow-pinning PR the load-bearing risk is does each pinned SHA actually correspond to the claimed official release (not cargo behaviour), so this was verified deterministically by resolving every pin via the GitHub API rather than with worktree cargo skeptics. Pin integrity (SHA → claimed version)
Completeness
Finding — 1 should-fix, 0 blockingThe two ⚠ rows: the pinned SHAs are legitimate official releases (checkout Decision: 0 BLOCKING, green, CLEAN → merging, and filing a follow-up to correct the two version comments ( |
Addresses #456.
1. The toolchain was not pinned
Nine jobs used
dtolnay/rust-toolchain@stableand one used@nightly. That action's git ref is the mechanism that selects the installed rustc version — each version-named branch of the action repo bakes in a fixedtoolchain:env value (confirmed by readingaction.ymlon the1.97.1branch);stableresolves to rustup'sstablechannel on the day the job runs. So the compiler CI validates against could move with no commit, no review, nothing in the diff.Verified against the issue's own quoted 429 log:
dtolnay/rust-toolchain@stableresolves to commit4360b525..., the exact SHA the issue's log shows being fetched (gh api repos/dtolnay/rust-toolchain/commits/stable).2. Nothing was pinned by SHA
None of the ~38
uses:lines inci.ymlwere pinned, so every job re-fetches whatever the tag currently points to.Fix
Every
uses:inci.ymlnow pins a commit SHA, with the resolved tag as a trailing comment for humans (GitHub's own supply-chain-hardening convention).dtolnay/rust-toolchain@stable→ the SHA of that repo's1.97.1branch — the version already in use everywhere else in this tree (rustc --versionlocally, and "Compiles under 1.97.1" shows up in several recent commit messages).dtolnay/rust-toolchain@nightly(the fuzz job) keeps floating on purpose — nightly drift is the point there — so only its action ref is pinned, not what "nightly" resolves to on the day the job runs, matching the issue's explicit ask ("Keep@nightlywhere nightly is genuinely required").Every other action (
actions/checkout,Swatinem/rust-cache,actions/cache,actions/upload-artifact,actions/setup-node) is pinned the same way, at each one's current tag tip. Added a short comment abovejobs:explaining the convention so a future bump is legible as a real PR rather than a mystery diff.Scope
Only
.github/workflows/ci.yml— the file the issue measured and quoted from. The repo's other four workflow files also use unpinned tags but weren't part of the issue's own measurement, so widening beyondci.ymlis left to a follow-up rather than scope-creeping this fix.Not verified (same as the issue's own "Not verified" section)
Whether this actually reduces 429s in practice. Pinning by SHA doesn't change what gets fetched from
codeload.github.comper job (the archive URL is already keyed by SHA even for a tag ref, as the issue's own log line shows), so this PR's confirmed effect is #1 (compiler drift) and general supply-chain hardening; its effect on #2's rate-limit fan-out is the same open question the issue left open — not something this PR claims to close.Verification
uses:occurrence counts unchanged before/after the edit (14 checkout, 9rust-toolchain@stable→1.97.1, 1@nightly, 8 rust-cache, 2 cache, 1 upload-artifact, 3 setup-node).python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"— parses clean.🤖 Generated with Claude Code