Repository navigation
fix(publish-to-r2): upload payloads before metadata, with retries - #85
Merged
Merged
Conversation
One parallel aws s3 sync let SHA256SUMS go live before its payload. A failed R2 multipart upload (snosi run 41384581449) left ext/chatgpt/SHA256SUMS listing a file that returns 404. scripts/upload-to-r2.sh now uploads payloads, verifies them with a --dryrun --size-only sync, then uploads metadata, then directory indexes. Each upload phase retries; AWS_RETRY_MODE=standard and AWS_MAX_ATTEMPTS=10 by default. ADR-0017 records the decision. AGENTS.md: correct the stale snosi pin (now c3c9f63, v0.7.0).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…payload names Cross-review: *.pkg.tar.* and *.bottle.tar* also matched files under a directory named like a payload (ext/foo.pkg.tar.x/SHA256SUMS), so that manifest went up in phase 1 beside its payload. Patterns are now end-anchored, and phase 0 refuses a payload-like base name that no pattern covers before any upload. The README manual example now stops on a failed payload upload (&&).
… out of it Re-review: the guard refused generated sysext transfer files such as foo.pkg.tar.x.transfer. It now checks only the 2 detector shapes that are not end-anchored (.pkg.tar., .bottle.tar) and skips *.transfer. Tests include the transfer files and prove phase 1 ran.
…fer from phase 0 Re-review: any *.transfer name was exempt, so a bottle named *.bottle.tar.gz.transfer could go up beside its formula. Only the generated sysext transfer path is exempt now; a test proves the bottle case is refused before any sync.
bketelsen
approved these changes
Nov 2, 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.
Fixes #84.
Problem
publish-to-r2uploaded./repowith 1 parallelaws s3 sync. Metadata and payloads raced. On 2026-11-02 (snosi run 41384581449) 1 R2InvalidPartleftext/chatgpt/SHA256SUMSlisting a+r1payload that returns 404.Change
scripts/upload-to-r2.sh(called by the action's upload step) runs:--exclude '*'+ includes for*.raw*,*.apk,*.pkg.tar*incl..sig,*.bottle.tar*), retried;--dryrun --size-only; anyupload:line fails the step before metadata;index,index.htmlat any depth) last, retried.Retries:
UPLOAD_ATTEMPTS(4), wait15s * N;AWS_RETRY_MODE=standard,AWS_MAX_ATTEMPTS=10unless set. Bucket/prefix now reach the step throughenv:.Invariant: live metadata never references a payload that is not in the bucket. Residual (documented in ADR-0017):
SHA256SUMSandSHA256SUMS.gpgare still 2 PUTs, so a short signature mismatch is possible; callers must still serialize runs.Tests
internal/releaseasset/upload_order_test.go: a fakeawswith S3 filter semantics; order, per-format classification, permanent failure (old metadata untouched), transient retry, silent-skip caught by verify, action contract.aws-cli1.46 + a local moto S3 server: the 4 calls upload exactly payloads → metadata → indexes; a rerun uploads nothing; a skipped payload fails phase 2 and the oldSHA256SUMSstays.make build fmt lint test-unit,shellcheck,node scripts/check-docs.mjs: green.Migration
No input change. A consumer gets it by moving the action pin and
repogen-version/repogen-committogether to the release that contains it. Only consumer: frostyard/snosibuild.yml(pinc3c9f63, v0.7.0). The release is Brian's.Docs: ADR-0017 (Proposed),
docs/design/ci-cd.md,docs/specs/generators.md, README, AGENTS.md (stale snosi pin fixed).