Repository navigation
Make a release recoverable without deleting the tag - #36
Conversation
Three v0.2.0 attempts have each burned a tag. The release job creates the GitHub release before publishing to npm, so when the npm step fails, as it has on a bad tarball path and then on an npm token that demands an interactive OTP, the run leaves a published GitHub release advertising a package that does not exist, with a Homebrew formula pointing at a registry URL that 404s. Recovery meant deleting the release, deleting the tag and tagging again, and a re-run could not help because it would trip over its own release. Publishing to npm now runs first. It is the credential-dependent step and the one that fails; with nothing created before it, a failure leaves nothing to undo. Both publishing steps now tolerate having already run. npm skips a version already on the registry, because a published version can never be replaced and one irreversible step must not fail the rest of the release. The release step uploads over an existing release instead of refusing to create it. Together these make a re-run finish a partly completed release rather than fail. Re-uploading assets is safe because npm pack is byte-reproducible at a commit: two packs of this tree produce the same sha256, so the tarball a re-run rebuilds cannot contradict what an earlier attempt published, and the rendered formula's checksum stays true. Two tests cover the invariants rather than the text: reverting the order fails the first with "the GitHub release is created before npm publish runs", and removing the registry check fails the second. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WrwFcAcntyBBSk21irvgAV
|
Why it is not this change. The diff is
What is established about the failure, separately from this PR:
If that is the cause it is the third instance of one bug class in this repo: a fixed activation deadline written as a hang-backstop but sized inside the variance of a loaded machine. I am not making that change here. It is unrelated to release ordering, it would widen this PR, and it deserves its own reproduction and its own review. No test is being skipped or weakened. Generated by Claude Code |
|
Coordination note from the TypeScript conversion in #37, which the maintainer asked to roll into this release work.
Generated by Claude Code |
|
Follow-up to the coordination note: #37 (the TypeScript conversion) is now merged on top of this PR as Generated by Claude Code |
Problem and change
Three
v0.2.0attempts have each burned a tag. The cause is step order, not any one bug:npm publishis the credential-dependent step. It failed on a tarball path npm read as a GitHub repo, and then onEOTP— a token that demands an interactive one-time password. Each time the GitHub release had already been created, so the run left a published release advertising a package that does not exist, with aurlcode.rbpointing at a registry URL that 404s. Recovery meant deleting the release, deleting the tag, and tagging again — and a re-run could not help, because it would trip over the release its own earlier attempt created.npm publish now runs first. With nothing created before it, a failure there leaves nothing to undo: delete the tag, or just fix the credential and re-run.
Both publishing steps now tolerate having already run:
Together, a re-run finishes a partly completed release instead of failing.
Re-uploading assets is safe, and I checked rather than assumed.
npm packis byte-reproducible at a commit — two packs of this tree produced the identical sha256:So the tarball a re-run rebuilds cannot contradict what an earlier attempt published, and the formula's measured checksum stays true against the npm tarball it names. Had
npm packbeen non-deterministic,--clobberwould have been a correctness bug — a release asset silently disagreeing with the published package.Verification
Both new tests cover the invariant, not the wording. I confirmed each fails on the regression it names:
The workflow parses as YAML and every
run:block passesbash -n, since reordering steps and restructuring shell is exactly where a silent syntax error would hide.Not verified: the release workflow only runs on a tag push, so this cannot be exercised before merging. The next tagged run is the proof.
Compatibility and security
PUBLISH_NPM/NPM_TOKENguard is unchanged: publishing stays off unless the variable is set, and an empty token still fails loudly.name@versionalready on the registry. It cannot mask a failed publish of a version that is not there.Separate from this PR, still outstanding:
NPM_TOKENcurrently holds a token that requires an OTP. A Granular Access Token or a classic Automation token bypasses 2FA; a classic Publish token does not. And thev0.2.0tag and release need deleting once more before the next attempt — the last time, if this works.🤖 Generated with Claude Code
https://claude.ai/code/session_01WrwFcAcntyBBSk21irvgAV
Generated by Claude Code