fix(scripts): retry release asset upload on transient 404 #37
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/upload-assets-retry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
scripts/publish/upload-assets.shnow retries each asset upload up to three times with exponential backoff (5s, 10s, 15s). Tolerates the Forgejo tag→release index lag that breaks fresh releases on this host.Why
publish:upload-assetswith HTTP 404 on/releases/tags/v0.5.2, 73 seconds aftercreate_release. The same failure mode hit v0.5.1's run 72.getRelease({tag})to resolve the release ID; when that 404s, the upload fails.publish.yaml. Less flexible, adds latency to every release even when the index is warm.clear-assets.shstill silently swallows 404s (post-mortem follow-up #2);prepare-assets.shstill doesn't cleandist/(follow-up #4). Both deferred to separate PRs.Verification
bun run linton the branchbun run typecheckon the branchtsc --noEmitexit 0bun teston the branchupload-assets.shset -euo pipefailupload-assets.shagainst v0.5.2 release id 560Out of scope
clear-assets.shfail-loudly on 404 — post-mortem follow-up #2.prepare-assets.shcleandist/before pack — post-mortem follow-up #4.event_name/refclaim rules — admin-UI change; the loosened rules were needed forworkflow_dispatch, which the trigger no longer accepts after PR #35.Follow-ups after merge
release: published→ derive-tag usesFORGEJO_REF_NAMEfallback → check-pkg idempotent → publish:npm succeeds → upload-assets retries through the index lag and succeeds on attempt 2 or 3, no manual recovery needed.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.