ci: wait for the registry, and keep the record when a later check fails - #79
Open
jiashuoz wants to merge 1 commit into
Open
ci: wait for the registry, and keep the record when a later check fails#79jiashuoz wants to merge 1 commit into
jiashuoz wants to merge 1 commit into
Conversation
v0.0.11 published onto `latest` correctly and the run still reported failure. The next line asked the registry for the version it had just written and got ETARGET: npm serves reads through a cache that lags the write by seconds. The verification now waits for the version to become resolvable, up to five minutes, before concluding anything about it. A published release is not broken merely because it is not readable yet. That failure then discarded the pins PR, for the second release running — the package was public and main went on describing the previous one. Recording is now keyed to the publish step's own outcome rather than the job's: once the package is public the record is written even if a later check fails, and it is not written if the publish did not happen. Also records v0.0.11's pins, which the aborted step would have written. They are the `release.js` from inside the published tarball, so main describes exactly what the registry serves. `latest` now resolves to 0.0.11. A bare `npm install -g @tokencanopy/rainier` reported `rainier v0.0.11` and refused `diff`, where before this pair of releases it installed 0.0.3. The compact `package.json` formatting survived the publish, confirming the in-place rewrite. Verified: YAML parses; 11/11 npm tests; no stale 0.0.10 reference in npm/; the committed release.js is identical to the published one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019SDSieWT6mnHB1EYXUyz7H
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.
v0.0.11 published onto
latestcorrectly and the run still reported failure.1. The registry lags its own writes
The publish succeeded; the very next line asked for the version it had just written and npm's read cache hadn't caught up. Verification now polls for resolvability (10s × 30, five minutes) before drawing any conclusion. A published release is not broken merely because it is not readable yet.
Confirmed by hand minutes later:
npm view @tokencanopy/rainier@0.0.11 version→0.0.11.2. That failure threw away the record — again
Second release running where a post-publish failure discarded the pins PR, leaving the package public and
maindescribing the previous release.Recording is now keyed to
steps.publish.outcome, not the job's status: once the package is public the record gets written even if a later check fails, and it is not written if the publish never happened.!cancelled()alone would have recorded pins for a release that failed to publish.3. v0.0.11's pins
Included here because the aborted step would have written them. Taken from the
release.jsinside the published tarball, somaindescribes exactly what the registry serves.The point of all this
A bare
npm install -g @tokencanopy/rainierreportsrainier v0.0.11and refusesdiff. Previously it installed 0.0.3 — a downgrade for anyone already on 0.0.9.The compact
package.jsonformatting also survived the publish, confirming the in-place rewrite from #78.Verification
Record the pins on maincarries the publish-scoped condition.0.0.10reference innpm/.release.jsis byte-identical to the published one.HOME.The retry path itself is not exercised until the next release — the lag it handles is observed in the run log above, not reproduced.
🤖 Generated with Claude Code
https://claude.ai/code/session_019SDSieWT6mnHB1EYXUyz7H