Skip to content

Let a release retry overwrite the assets it already uploaded - #9

Merged
adhikjoshi merged 1 commit into
mainfrom
fix/release-replace-existing-artifacts
Sep 9, 2026
Merged

Let a release retry overwrite the assets it already uploaded#9
adhikjoshi merged 1 commit into
mainfrom
fix/release-replace-existing-artifacts

Conversation

@adhikjoshi

@adhikjoshi adhikjoshi commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #8. The v0.2.0 retry cleared the tap credentials check (no more 401) and then died one step later:

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. 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: true is 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 check passes
  • 6 binaries collected from dist/artifacts.json — the count the workflow asserts with -eq 6
  • packaging/npm/build.mjs v0.2.0 → 6 platform packages plus the entry package pinning all of them
  • packaging/pypi/build.py v0.2.0 → 6 wheels, all stamped 0.2.0

Homebrew 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


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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
@adhikjoshi
adhikjoshi merged commit ecbc533 into main Sep 9, 2026
8 checks passed
@adhikjoshi
adhikjoshi deleted the fix/release-replace-existing-artifacts branch September 9, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant