Repository navigation
v3.0.0 ci: make pinned tool downloads resilient to release outages - #380
Merged
Merged
Conversation
…374) curl --retry 3 gave cargo-deny and hadolint about seven seconds of retries, so a GitHub release CDN 504 failed both required jobs. - Retry transient failures every 15 seconds for up to 180 seconds (12 retries, 10-second connect and 30-second per-attempt limits) and kill the download at a hard 210 seconds. A 404 still fails at once. - With PINNED_TOOL_CACHE_DIR set, keep the original release asset under tool/version/sha256. A cached asset must be a regular file and is copied to private scratch and checked against the pin before anything is extracted, installed or run; a bad entry fails without refetching. A new download is checked, then published through a checked temporary file renamed into place. - --cache-metadata writes the actions/cache key and path, so both jobs restore and save the asset with actions/cache while the pins stay in the script.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Sep 15, 2026
Closed
Anatolie
added a commit
that referenced
this pull request
Sep 15, 2026
…ds (#392) #380 hardened install-pinned-tool.sh against release-host outages, but its validation harness lived outside the repository, so nothing in CI exercised the retry window, the hard deadline, the verified cache or the fail-closed handling of bad cache entries. Commit that harness as .github/scripts/test-install-pinned-tool.sh and run it in lint-compile-compose. The test is hermetic: a Python http.server on 127.0.0.1 stands in for the release host, and a routing-only curl shim on PATH sends the pinned https://github.com/ URL there while passing every other argument through to the real curl. Scripts under test are derived from the committed installer by replacing exactly four whole lines (the two sha256= pins with the fixture digests, the timeout --signal=KILL line and the --retry line); each must match once and a diff must show nothing else, so every guard runs as committed and sha256sum is never shimmed. The pure-failure scenarios also run against the unmodified installer through the shim alone. 38 scenarios and 453 assertions cover both tools in about 22 seconds: a 504 outage longer than the old seven-second window, a warm cache with the host refusing connections (zero requests), a warm cache under a path sha256sum cannot name (the private copy is what is checked), substituted download bytes with and without a cache, poisoned cache entries with wrong bytes, a FIFO, a symlink to a FIFO and a symlink to a digest-correct file, a 404 failing fast, a stalled transfer killed by the deadline, and the pins themselves. Bad assets carry an execution marker that must never appear. Closes #389 Co-authored-by: Claude Fable 5.1 <[email protected]>
This was referenced Sep 16, 2026
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
Pinned cargo-deny and hadolint installs exhausted their CDN retries in roughly seven seconds, causing both required checks to fail during short release outages. Restore and save the original pinned release assets with exact tool/version/SHA256 cache keys, and allow 13 transient download attempts with a 15-second delay, a 180-second retry window, and a hard 210-second download deadline.
Every cached or downloaded asset is verified against the existing SHA256 before extraction, installation, or execution. Bad cache entries fail closed, including symlinks and special files. Pins and release URLs are unchanged. GitHub remains the only download source; no maintained independent mirror was identified.
INT/TERM interrupts the download promptly, forwards termination to curl, and waits for cleanup before exiting. The hard deadline remains effective for stalled transfers.
Closes #374
Validation
A loopback HTTP server served the authentic pinned release assets after timed errors. A routing-only curl shim redirected the pinned URLs while preserving all curl arguments; the production installer and SHA256 check were unmodified. Wrong-digest assets contained an execution marker, which remained absent on every failure. Cache restore/save was simulated using the exact paths and keys emitted for both CI jobs.
Local Ubuntu 24.04, Linux x86_64, curl 8.5.0: all 26 scenarios and 248 assertions passed.
Also passed: non-regular cache rejection, concurrent cache writers, Retry-After handling, input checks, Docker ShellCheck, Bash syntax, unchanged pin comparison, and whitespace checks. Workflow structure validation passed. Full actionlint reports the same pre-existing SC2086 warning in the unchanged Compose validation step at the pinned base.
Independent adversarial review reproduced the outage and integrity checks. The final installer also handles cancellation promptly: all six INT/TERM scenarios across both tools exit in 0.02 seconds with the expected status, no surviving curl, clean scratch and no installation or cache publication. Bash waits interruptibly for the bounded downloader, forwards termination and reaps it before cleanup.
Integration notes
Target branch: 3.x.x. Close #374 manually after merge because the closing keyword does not apply to this non-default base.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.