Repository navigation
ci(release): make the npm publish re-runnable - #18
Conversation
An npm version can never be published twice, so re-running this job after a LATER step failed dies with "You cannot publish over the previously published versions". The Verify provenance landed comment worked around that by telling you to "never re-run this job" -- which leaves a release that published fine and then tripped over a later step with no recovery path at all. Paddock hit exactly this on 0.81.0: its provenance poll timed out, the re-run died on the republish, and the run is permanently red even though npm has the version with provenance (edspencer/paddock#988). Skip a version already on the registry, so "Re-run failed jobs" finishes the release. Localidraw, Hallway, Local Review, cli-contract, BragDoc and now Paddock all do this; Managers was the last one without it. Asks the registry directly with caching off, as Verify provenance landed does, rather than through `npm view`: a cached packument predating the publish would give a false "not on npm", which is the failure this guards against. Only a 200 skips -- a 404, or a registry having a bad day, publishes, exactly as this step did unconditionally before. Managers' 30-minute poll already covers the registry lag that broke Paddock's releases, so the verify step is unchanged apart from its comment no longer banning a re-run. CI-only, so no changeset and no version bump (CONTRIBUTING). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
This PR touches one file, Evidence that it is pre-existing and time-dependent, not caused here: this branch is cut from It will not go green on a re-run. Fixing it means bumping or triaging each of the four into So I am leaving this open rather than merging red. The companion fix in Paddock (edspencer/paddock#988) is independent and lands on its own. 🤖 Generated with Claude Code |
An npm version can never be published twice, so re-running
publish-npmafter a later step failed dies with:The
Verify provenance landedcomment worked around that by telling you to "never re-run this job" — which leaves a release that published fine and then tripped over a later step with no recovery path at all.Paddock hit exactly this on 0.81.0: its provenance poll timed out, the re-run died on the republish, and run 41960228079 is permanently red even though npm has 0.81.0 with SLSA provenance. Fixed there in edspencer/paddock#988; this is the other half of it.
What changes
Publishskips a version that is already on the registry, so "Re-run failed jobs" finishes the release. Localidraw, Hallway, Local Review, cli-contract, BragDoc and now Paddock all do this — Managers was the last one without it.It asks the registry directly, with caching off, the way
Verify provenance landedalready does, rather than throughnpm view:The five sibling repos use
npm view … version, but this repo deliberately avoids it in the verify step because a cached packument can predate the publish — and a false "not on npm" here is the very failure being guarded against, so consistency with the neighbouring step wins over consistency with the other repos. Only a 200 skips: a 404, or a registry having a bad day, publishes — exactly what this step did unconditionally before, so the guard is never more cautious than today's behaviour.The
Verify provenance landedstep is unchanged. Its 30-minute poll already covers the registry lag that broke Paddock's two releases (and the ~9-minute metadata delay on 0.2.0 that its own comment records). Only its comment changes: it no longer bans a re-run, and points at the Publish step's log instead.How I verified it
No UI, so no screenshots. I extracted the
run:block straight out of the committed workflow and drove it against the real public registry, with a stubnpmonPATHrecording whethernpm publishwas reached.@edspencer/managershas0.0.1, 0.2.0, 0.3.0, 0.3.1published.VERSION=0.2.0— really is publishedalready on the registry; not publishing it again, 0npm publishcallsVERSION=99.99.99— is notregistry answered 404 … — publishing, 1npm publishcall000PUBLISHThe third case is the one worth having: a network failure must not silently skip a publish that never happened.
curl's own error output goes nowhere near the log —-w '%{http_code}'reports the status instead, so a 404 reads as a status line rather than a scarycurl: (22) The requested URL returned error: 404.What CI here does and does not prove
release.ymlis not triggered by a pull request, so this PR's CI never executes the changed workflow. Green here means nothing else broke; the changed step is covered by the real-registry runs above. The first live exercise is the next release — and since the change only ever skips a publish that would have failed anyway, a wrong call cannot lose a version.Notes
🤖 Generated with Claude Code