Repository navigation
fix(scripts): skip occupied beta versions (WCN-3802) - #10045
Conversation
dae9dfb to
6f4da3c
Compare
|
@claude review |
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
Findings marked 🟡 are optional suggestions and need no follow-up push.
Additional findings (outside the current diff — GitHub can't attach inline comments there):
-
🟣
scripts/prepareRelease/distTags.ts— pre-existing: A transient dist-tag fetch failure still skips the new collision check, so the release can retry an already-published version. The catch at distTags.ts:92-95 only warns and drops the module from the map. Withtagsundefined, prepare-release.ts:120 never callsfindFirstUnpublishedVersion, so the module keeps its repo version unprobed. Fix: rethrow every dist-tag error except a 404 (a genuinely new package), the same fail-closed rule the new probe follows. Also probe the kept version whenprevTagis undefined.Why this was flagged
The trigger is a 5xx, rate-limit or network error from
getDistTagsfor one published module duringgetDistTagsForModuleNames(distTags.ts:90-95). The catch logsFailed to fetch dist tags for ...and returns [], sodistTags.get(m)is undefined. InincrementVersionsForModuleLocation(prepare-release.ts:108-120)prevTagthen stays undefined. The new probe and the new rethrow are both skipped, and the module keeps the version in its package.json under the @ bitgo-beta scope. lerna then publishes a version that may already exist, which is the collision this PR is meant to prevent. The base behaves the same way, but the PR's new rule ('fails instead of guessing when the registry probe fails') is not applied to this sibling registry call.Verification: pre-existing. The unchanged catch at distTags.ts:92-95 drops the module from the map, so
if (prevTag)(prepare-release.ts:120) is skipped and the newfindFirstUnpublishedVersionprobe never runs. The function returns undefined with no throw, so the new fail-closedthrow einincrementVersions(prepare-release.ts:183) never fires either. The base behaves the same way by the same route.
|
Addressed Claude's unthreaded fail-open finding in ad730f5. Dist-tag HTTP 404 now represents a genuinely new package, whose manifest version is still probed before publish. Network errors, HTTP 429, and 5xx responses now reject the batch and abort preparation instead of silently dropping the module and bypassing collision detection. Added focused 404 and 503 tests; |
|
@claude review |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Description
Hotfix the beta/alpha release collision that left
@bitgo-beta/sdk-coin-ethon the oldbetatag.The preparation script now treats the dist-tag-derived version as a candidate, checks whether that exact immutable npm version already exists, and increments until it finds a free version. The selected version is still propagated through dependent manifests before the existing build and publish steps.
Registry reads fail closed: non-404 dist-tag errors abort preparation, while a genuinely new package keeps its manifest version and still receives an exact-version collision probe. An existing dist-tag cache continues to provide deterministic offline preparation.
The verifier also sets a failing exit code when normal-mode verification fails, preventing the false-green result seen in the incident.
RCA: sdk-coin-eth beta tag stuck after prerelease version collision
Issue Number
WCN-3802
Type of change
How Has This Been Tested?
yarn test:scripts— 17 passing, including free, occupied, consecutive-collision, registry-error, new-package, and dist-tag failure cases.4.4.1-beta.2099after detecting that4.4.1-beta.2098already exists.Follow-up
Keep broader registry polling, provenance validation, unpublished-version history, and recovery-mode redesign out of this hotfix and track them separately after the release is unblocked.