Repository navigation
ci: cache the pinned actionlint and shellcheck archives - #3659
Conversation
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Quick104
left a comment
There was a problem hiding this comment.
🤖 Claude Code (claude-opus-5-5)
The cache does what the description says. I ran the install step outside Actions: a cold run downloads and verifies both tools, a warm run with curl stubbed to fail makes no network calls, and a cached archive that doesn't match its checksum fails the step. A second review (Codex, gpt-6.1-sol) checked cache scoping, partial downloads, the prune job and the action-pin gate and found nothing to fix. One low-severity finding is inline.
The cache key repeated the tool versions apart from the download URLs and checksums. A bump that missed the key would restore the old archive and fail its checksum on every run, and the bump PR's own CI could not show it because ci.yml runs this workflow from main. Keep both versions and checksums in job-level env and build the key, URLs, checksums and extract path from them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
🤖 Claude Code (claude-opus-5-5) Review summaryReviewed head: 8424125 (my fix on top of bc98249). Addressed
Verification
Left for maintainers
Validated features: none affected. Only the CI workflow changes; no product behavior or validation case is reachable. User manual: unaffected (CI only). Apple/Android parity: not applicable. Fit: 9/10 · Readiness: 8/10 — conditional (assuming CI is green) Fit: it fixes a real CI outage with the Actions cache the workflow already uses, adds no new tooling, and keeps checksum verification on every archive. Readiness: the code is small and checked, but the changed workflow can't run before merge, so the only proof so far is the step run outside Actions. The first main run after merge is the remaining check. |
Problem
Related issue: N/A
Validation tasks: none
Since about 08:50 UTC on 8 November, every CI run has failed in Repository checks, whatever the change. That job starts by downloading actionlint and ShellCheck from GitHub release assets, and GitHub has been answering those downloads with 504s while the rest of Actions works.
curl --retry 3gives up after a few seconds, so the job fails, and CI result fails with it. Which archive fails has moved around: ShellCheck first, then actionlint.This change keeps the two archives in the Actions cache, so a run only downloads them on a cache miss.
Approach
A new
actions/cachestep, pinned to the same v6.1.0 SHA the workflow already uses, restoresworkflow-tool-archivesunder a key built from both tool versions and checksums. The install step downloads an archive only if it isn't already there, then checks both archives against the same pinned SHA-256s as before and extracts the binaries. A cached archive gets the same checksum check as a fresh download, and the cache only saves after a job succeeds.The
repo-checksjob keeps both tool versions and checksums in job-levelenv, and the cache key, download URLs, checksum lines and ShellCheck extract path all read from them, so changing a version or checksum also changes the key. The prune job only touchesgo-*caches, so it leaves this one alone.Because
ci.ymlcalls this workflow at@main, this PR's own run uses the current main copy and can fail on the same 504s. The cache fills after the first successful run on main once downloads work again, and every later run reads from it.I also looked at falling back to a second download source. PyPI's
shellcheck-pywheel bundles a byte-identical 0.11.0 binary, butactionlint-pyonly ships a source package that downloads from GitHub too, so that would cover just one of the two tools.Validation
actionlint(1.7.12, repo config): clean.python3 .github/actions/ci-tools/test_select_jobs.py: 49 tests passed, including the action pin gate.curlstubbed to fail: it verified both archives, extracted both tools and made no network calls. Appending junk to a cached archive made the checksum fail and the step exit 1.env): a cold run with real downloads and a warm run withcurlstubbed to fail both passed outside Actions;actionlint,make verify-actionlint verify-shellcheckandtest_select_jobs.pypass.Evidence
Evidence: none, no user-visible change
Risks
None identified. If the cache is empty or evicted, the step falls back to today's behaviour.
Checklist
AI Disclosure
Note
Cache pinned Actionlint and ShellCheck archives in CI
Adds an
actions/cachestep to the repo-checks job in trusted-linux-ci.yml. The cache key includes the pinned Actionlint and ShellCheck versions and SHA-256 checksums.Macroscope summarized 8424125.