8000 ci(#456): pin every workflow action to a commit SHA, and the rust toolchain to 1.97.1 by Vinz2168 · Pull Request #713 · xerj-org/xerj · GitHub
[go: up one dir, main page]

Skip to content

ci(#456): pin every workflow action to a commit SHA, and the rust toolchain to 1.97.1 - #713

Merged
xerj-org merged 1 commit into
xerj-org:mainfrom
Vinz2168:ci/456-pin-actions-and-toolchain
Aug 24, 2026
Merged

xerj-org merged 1 commit into
xerj-org:mainfrom
Vinz2168:ci/456-pin-actions-and-toolchain

Conversation

@Vinz2168
Copy link
Copy Markdown
Collaborator

Addresses #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 (confirmed by reading action.yml on the 1.97.1 branch); stable resolves to rustup's stable channel 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@stable resolves to commit 4360b525..., 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 in ci.yml were pinned, so every job re-fetches whatever the tag currently points to.

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 locally, 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 @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. Added a short comment above jobs: 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 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 doesn't 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 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

  • Exact per-action uses: occurrence counts unchanged before/after the edit (14 checkout, 9 rust-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

…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
@cla-bot cla-bot Bot added the cla-signed label Aug 24, 2026
@xerj-org
Copy link
Copy Markdown
Owner

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)

action pinned SHA comment resolves to verdict
actions/checkout 11d5960… # v4.3.0 v4.4.0 ⚠ comment stale (SHA is a valid newer release)
dtolnay/rust-toolchain 032958af… # 1.97.1 1.97.1 ✅
Swatinem/rust-cache 6323deb… # v2.8.1 v2.9.2 ⚠ comment stale (SHA is a valid newer release)
actions/cache 0057852b… # v4.3.0 v4.3.0 ✅
actions/upload-artifact ea165f8d… # v4.6.2 v4.6.2 ✅
actions/setup-node 49933ea5… # v4.4.0 v4.4.0 ✅
dtolnay/rust-toolchain (nightly job) 7c8d7d13… # nightly (action ref pinned; toolchain floats) real commit (2026-08-05) ✅

Completeness

  • Every uses: in the post-PR ci.yml is SHA-pinned with a version comment — no unpinned action remains.
  • Job count unchanged 19 → 19 — no job dropped or renamed; the diff is ref-swaps only.
  • Toolchain consistent: 9× # 1.97.1 on the stable jobs, # nightly only where intended.
  • PR's own CI: 18/18 green — the pinned (newer) checkout/rust-cache commits run cleanly, so no functional regression.

Finding — 1 should-fix, 0 blocking

The two ⚠ rows: the pinned SHAs are legitimate official releases (checkout v4.4.0, rust-cache v2.9.2) — the immutability/security intent of #456 is fully achieved — but the # vX.Y.Z comments name the wrong (older) version. Since this PR's deliverable is precisely an auditable pin→version map, the stale comments are worth correcting, but they are a documentation defect with no functional or security impact (valid immutable pins, green CI), so per our merge rule (should-fix/nit do not block) this does not hold the merge.

Decision: 0 BLOCKING, green, CLEAN → merging, and filing a follow-up to correct the two version comments (11d5960 → v4.4.0, 6323deb → v2.9.2) or re-pin to the intended older tags if that was the intent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0