Repository navigation
ci: derive the release version from tag + registry, bump on conflict - #4
Merged
Merged
Conversation
Same defect as nabheet/pcbway-mcp-server#71. The `latest` version came from `npm view <pkg>@latest`, and that packument read is CDN-cached for a minute or two. A second shipping merge inside the window computed an already-published version and the publish died with E409. - Baseline is now max(newest stable `vX.Y.Z` tag, registry `latest`). The tag is pushed right after a successful publish and does not lag; the registry stays because it also records a publish whose tag push failed. An ahead `package.json` is still honoured. - The publish job checkout gets `fetch-depth: 0`, otherwise the tag list is whatever the shallow clone happened to include. - A conflict on `latest` bumps a patch and republishes (bounded at two bumps) instead of retrying a version that can never succeed. Beta channels still fail fast. - Conflict detection is case-insensitive and matches npm's actual lines ("Cannot publish over ...", "previously staged", "npm error code E409"). It was case-sensitive, so the old loop retried a pinned version three times. - Tag candidates are filtered to plain `vX.Y.Z`: `sort -V` is not semver-aware and ranks `1.0.0-rc.1` above `1.0.0`.
nabheet
marked this pull request as ready for review
October 31, 2026 04:00
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.
Same defect as nabheet/pcbway-mcp-server#71, in this repo's copy of the publish job.
The race
Version came from
npm view opencode-rtk-plugin@latestplus a patch. That packument read is CDN-cached for a minute or two, so a second shipping merge inside the window computed a version that was already published and the run died withE409 Cannot publish over previously staged version. Nothing was lost (the next push picked the change up), but the merge showed a red run and cut no release.The second defect: the conflict regex was case-sensitive while npm prints
Cannot publish over, so the conflict was not recognised and the loop retried a pinned version three times at ~50s each.Fixes
max(newest stable vX.Y.Z tag, registry latest). The tag is pushed right after a successful publish and does not lag; the registry stays because it also records a publish whose tag push failed. An aheadpackage.jsonis still honoured.fetch-depth: 0on the publish checkout. Without it the tag list is only whatever the shallow clone happened to include, which would make the new baseline silently low.package.jsonafter publishing, so they follow the bump.cannot publish over,previously published,previously staged,npm error code E409.sort -Vranks1.0.0-rc.1above1.0.0and any word above any number, so candidates are filtered to^v[0-9]+\.[0-9]+\.[0-9]+$.Verification
actionlintclean (shellcheck is installed, sorun:blocks are shellchecked). Derivation and publish-loop logic exercised outside CI over the case table in the umbrella issue: stale registry → tag wins; registry ahead of tag → registry wins; no sources → tree version as-is; aheadpackage.json→ honoured; rc/beta/word tags ignored.Scope note
This repo publishes a patch on every push to
main(no release guard here), so merging this cuts a release. It is a workflow-only change, so that release carries no code change.Reviewed
Adversarial review of the pcbway version of this diff found stale header comments, a log line printed before the bump, a silent registry-read failure, an over-broad
e409match, and thesort -Vordering trap — all fixed here. Reviewer had no shell; each claim was verified by running the logic.