Let a release retry overwrite the assets it already uploaded - #9
Merged
Conversation
The v0.2.0 retry got past the tap credentials and then died on the upload:
upload failed error=POST .../releases/385736691/assets?name=modelslab_0.2.0_linux_arm64.tar.gz:
422 Validation Failed [{Resource:ReleaseAsset Field:name Code:already_exists}]
...once for each of the 11 assets the first, half-failed run had already
attached, and npm and PyPI were skipped again behind it.
`release.mode: replace` was the wrong lever. It governs the release NOTES; it
says nothing about artifacts. `replace_existing_artifacts` is the half that
overwrites them, and without it no retry of a run that got as far as uploading
can ever succeed — which is exactly the situation the retry exists for.
Verified locally end to end against a snapshot build: goreleaser check passes,
6 binaries collected (the count the workflow asserts), packaging/npm/build.mjs
produces the 6 platform packages plus the entry package pinning them, and
packaging/pypi/build.py produces the 6 wheels, all stamped 0.2.0.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QgkQePXPha8ShvoBerrVXL
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.
Follow-up to #8. The v0.2.0 retry cleared the tap credentials check (no more 401) and then died one step later:
— once for each of the 11 assets the first, half-failed run had already attached. npm and PyPI were skipped again behind it.
release.mode: replacewas the wrong lever. It governs the release notes; it says nothing about artifacts.replace_existing_artifacts: trueis the half that overwrites them. Without it, no retry of a run that got as far as uploading can ever succeed — which is precisely the situation the retry exists for.Verification
Ran the whole post-GoReleaser chain locally against a snapshot build, which is what I should have done before the last retry:
goreleaser checkpassesdist/artifacts.json— the count the workflow asserts with-eq 6packaging/npm/build.mjs v0.2.0→ 6 platform packages plus the entry package pinning all of thempackaging/pypi/build.py v0.2.0→ 6 wheels, all stamped0.2.0Homebrew and Scoop still need their PATs rotated; #8 makes them skip with a warning instead of taking the release down.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QgkQePXPha8ShvoBerrVXL
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.