Repository navigation
v3.0.0 ci: test the pinned-tool installer's outage and integrity guards - #392
Merged
Merged
Conversation
#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]>
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. |
Closed
5 tasks
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
#380 hardened
.github/scripts/install-pinned-tool.shagainst release-host outages, but its validation harness lived outside the repository and was described in the PR body, so nothing in CI exercised the retry window, the hard deadline, the verified cache, or the fail-closed handling of bad cache entries. A refactor could break any of those while both required checks stayed green. This commits that harness as.github/scripts/test-install-pinned-tool.shand runs it as a step inlint-compile-compose.The test is hermetic: a Python
http.serveron127.0.0.1stands in for the release host, driven by a control file (serve, 504 until a deadline, 404, stall, refuse) and logging every connection so scenarios assert request counts, not only exit statuses. No network, no Docker, no GitHub reachability.Two narrow bridges close the gap between a hermetic test and the installer's hardcoded pins and 180/210-second timing, and both leave every guard as the committed code:
PATHrewrites the pinnedhttps://github.com/URL to the loopback host and execs the real curl with every other argument untouched, so the installer's own retry, deadline, and error handling run as written. The shim refuses any otherhttp(s)URL, so an accidental network reach fails the test.sha256=pins (with the digests of the fixture assets) and the two timing lines. Each line must match exactly once, and a diff against the committed file must show only those lines, so an edit to any guard flows straight into the test and an edit to a substituted line fails loudly.sha256sumis never shimmed:verify()runs as committed, only the expected value differs. The pure-failure scenarios also run against the unmodified installer, with its real pins and timing, through the shim alone.38 scenarios and 453 assertions cover both tools (the cargo-deny tar.gz path and the hadolint bare-binary path) in about 22 seconds:
sha256sumcannot nameBad assets and poisoned cache entries carry an execution marker: running them touches a sentinel file, which must never appear.
Pins and installer behaviour are unchanged; this adds coverage only.
Validation
--retry-all-errorson a 404, the deadline deleted / disabled / its exit status ignored, a pin bump, and a reachability probe added before the cache check.shellcheck -xclean (the job lints every tracked*.sh),bash -nclean,actionlint1.7.12 clean.Not covered, deliberately: the "verify the private copy, then install from the shared entry" mutation is not detectable without a race; a continuous-504 exhaustion run would cost the whole retry window. Removing the regular-file check is caught through the 20-second per-run bound, since
cpon a FIFO blocks by nature.Closes #389
Integration notes
Target branch:
3.x.x. Close #389 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.