Repository navigation
Wait out registry propagation before deciding a version is unpublished - #116
Merged
Merged
Conversation
The release step reads npm right after the publish step, and npm serves a publish it just accepted a few seconds later, so the last packages published can still be missing. It now re-reads only the missing versions on a bounded backoff (60s total) before failing, and says how long it waited.
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.
Problem
The 0.11.1
Releaserun published all eight family packages successfully, then failed 4 seconds later in "Tag and create GitHub release (lockstep family)":Both packages were published. From the run's attempt-1 log, the publish step reported
+ @retreejs/create@0.11.1at 22:13:27 and+ @retreejs/babel-plugin-compiler@0.11.1at 22:13:33; the tag step read npm at 22:13:33-22:13:37. The six packages published 15-45s earlier were all visible; the two published in the last 10 seconds were not. npm accepts a publish before every read path serves it, so a singlenpm viewright after publishing can miss the versions published last. Rerunning the job unchanged succeeded.Solution
create-github-release.mjsnow re-reads only the still-missing versions on a bounded backoff (2s, 4s, 8s, 16s, 30s — 60s total) before concluding a package is unpublished, logging each wait so the step is not silent. A genuinely unpublished package still fails the step, and the error now says how long it waited.The polling lives in
scripts/publish-package-selection.mjsasfindUnpublishedVersions, next to thenpmVersionStateread it drives, with the registry read and the sleep injectable so it is unit-testable. The--dry-runpreview passes no delays, so it still answers from the registry as it reads right now.Alternatives considered
Have the publish step emit what it just published (step output or artifact) and tag from that. Rejected: it contradicts #110's "tag from registry state". The tag step deliberately runs when publishing failed, was skipped because everything was already on npm, or a missing package was published by hand — in all of those the run has no authoritative output to read, so the registry check would still be needed and the step output would only be extra machinery for the one case already covered.
Verification
npm run typecheck,npm run test(123 files, 1708 tests),npm run doctor,npm run lint:architectureall pass.scripts/publish-package-selection.spec.mjscover: no wait when everything is visible, waiting out a version that appears on a later read (and re-reading only the missing one), and reporting what is still missing plus the elapsed wait.node scripts/create-github-release.mjs --dry-runon this branch still short-circuits on the existing v0.11.1 release.