Commit Graph

7 Commits

Author SHA1 Message Date
BearHuddleston
dfcc6c9e9b test(releases): pin the Linux recorder's own identity refusals
No test caught a mutant of three _arch_evidence_reasons clauses: the
invalid commit SHA, the invalid release tag, and ev.arch != arch.
admit_publication's other refusals hide them there. For record_evidence
these clauses are the only guard before it fetches the staged feeds.

The new parametrized test passes record_evidence one bad identity with
everything else valid. It asserts that exact single reason and zero R2
requests. Replacing each clause with pass fails its row, so no
mutant of the shared helper survives test_release_linux.py.

Found by a Sol review round on #161406.
2026-11-29 01:31:39 -06:00
BearHuddleston
a41f3b77aa ci(releases): reconcile opt-in Linux AppImage stable updater feeds 2026-11-29 01:31:39 -06:00
BearHuddleston
1df8bf5c5b fix(releases): verify both Linux AppImages before a retry writes either feed
_preflight_feed returned "noop" for an arch whose live feed already
matched the plan before it checked that arch's AppImage. A retry after a
partial publish (x64 written, arm64 PUT failed) therefore verified only
the arm64 AppImage and wrote the arm64 feed, even if the x64 AppImage the
live feed names had gone missing or corrupt since. That breaks the
all-or-nothing rule publish_admitted states: both AppImages are checked
before the first PUT.

The live-feed checks (downgrade, conflicting same version) still refuse
first, without a download. The AppImage size and SHA-512 check then runs
for every arch, whether its feed is already live or not. A rerun where
both feeds are already live now downloads both AppImages and writes
nothing, the same transfer cost as the first publish.

Test: test_retry_after_partial_publish_reverifies_the_already_live_arch_appimage
seeds a live x64 feed, corrupts the x64 AppImage and retries. It
expects a checksum refusal, no PUT and no arm64 feed. It fails on the
previous head (DID NOT RAISE: the arm64 feed was written) and passes now.
Found by the sol-loop review on #161336.
2026-11-29 00:19:46 -06:00
BearHuddleston
61cb3898fd refactor(releases): fetch staged Linux feeds through handoff.fetch
Greptile on #161336: load_feeds_from_dir had no caller, because
fetch_staged_feeds read both staged feeds itself, with a hand-rolled
copy of the receipt-bound transfer that handoff.fetch already does for
every other leg (read and validate the receipt, then GET each row and
check size and sha256), plus a read of r2.Response's private `_body`.

Keep the loader and drop the copy instead: publish_from_env now
downloads each arch's feed with handoff.fetch into a temporary
directory, one receipt per call with only that arch's feed name
included, and reads both with load_feeds_from_dir. Each feed can still
come only from its own arch's receipt, and a missing or tampered feed
still refuses before the first PUT. A transfer whose bytes disagree with
the receipt now gets the shared download's retries before it fails, and
the error reads "Artifact checksum mismatch".

New test: test_publish_from_env_takes_each_feed_only_from_its_own_arch_receipt
moves the x64 feed's receipt row into the arm64 receipt and expects a
refusal with no PUT. It passes on the previous head too (that code
looked the row up per receipt); it fails on a mutant that fetches both
arches in one handoff.fetch call, which is the shape this change has to
avoid.
2026-11-29 00:19:46 -06:00
BearHuddleston
0d523559c9 refactor(releases): drop the Linux publisher's unused fetcher copies of the R2 helpers
Greptile on #161336: linux.py threaded an optional `fetcher` through
every R2 call and, when one was set, ran its own copies of
r2.verify_remote_artifact and r2.put_object (checksums, request
hashes, Cache-Control, error checks). Nothing passes a fetcher: the
workflow runs `python -m scripts.releases.linux publish` and the tests
drive the real transport against the loopback R2 fixture. The copies had
already drifted (the artifact check read `response.data`, which
r2.Response doesn't have), so the first caller would have hit an
AttributeError instead of a checksum verdict.

Remove the parameter and its branches. Artifact verification and the
conditional feed PUT now go only through r2.verify_remote_artifact and
r2.put_object, and _get_live_feed keeps only the 404 handling that
r2.signed_request can actually raise. No behaviour change on the real
path, so the existing loopback tests are the proof: the same 36 test ids
in tests/scripts/test_release_linux.py pass before and after.
2026-11-29 00:19:46 -06:00
BearHuddleston
a7d0f2a301 ci(releases): wire diagnostic Linux AppImage updater feed publication 2026-11-29 00:19:46 -06:00
BearHuddleston
ce7373edc5 feat(releases): add Linux AppImage feed planner, admission gate, and R2 prune protection 2026-11-29 00:19:46 -06:00