Skip to content

Survive registry hiccups when re-running a publish - #30

Merged
lambdalisue merged 1 commit into
mainfrom
fix/publish-skip-existing
Oct 10, 2026
Merged

lambdalisue merged 1 commit into
mainfrom
fix/publish-skip-existing

Conversation

@lambdalisue

Copy link
Copy Markdown
Member

Summary

  • scripts/publish.ts treats npm refusing a version because it already exists (409 "Cannot publish over previously staged version", 403 "cannot publish over the previously published versions") as already published.
  • jsr publish is retried twice after 30s.

Why

The first release (v20261010.01) hit both problems:

  1. JSR answered 503 Service Unavailable midway through jsr publish, failing the run after npm had published every package.
  2. Re-running the failed job then failed on npm: npm view @probitas-test/client-sql-mysql@0.5.1 still returned 404 a few minutes after the publish (registry caching), so the script published it again and npm refused with 409 Conflict.

The workflow is meant to be re-runnable (the plan is reused from the Release); this makes that hold despite registry caching and transient JSR errors. jsr publish skips versions it already published, so repeating it is safe.

Test Plan

  • bun run verify (new alreadyPublished cases for the 409 and 403 messages and for unrelated errors)

🤖 Generated with Claude Code

https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq

The first release run stopped when JSR answered 503 midway through
`jsr publish`. Re-running it then failed on npm: `npm view` did not
yet return a version published minutes earlier, so the script tried to
publish it again and npm refused with 409 Conflict.

- npm refusing a version because it already exists now counts as
  published, so re-runs are idempotent despite registry caching.
- `jsr publish` is retried twice after 30s; it skips the versions it
  already published, so repeating it is safe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N3xvJ1TaozjYSE6eoyo9mq
Copilot AI balanced review requested due to automatic review settings October 10, 2026 14:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@lambdalisue
lambdalisue merged commit 2eabb96 into main Oct 10, 2026
2 checks passed
@lambdalisue
lambdalisue deleted the fix/publish-skip-existing branch October 10, 2026 14:16
@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants