Stop an ordinary merge from arming the release gate - #12
Merged
Merged
Conversation
`release.yml` fires on every push to `main`, and the release chain is gated only on there being no pending Changesets. That is as true of a documentation merge as of a Version Packages merge, so every commit ran version, verify, seal, and browser_e2e and then parked a deployment at the `npm-production` gate. Approving one is worse than pointless. The sealed commit no longer matches the commit named in the published packages' provenance, so the publisher answers `[REGISTRY_PROVENANCE]` and refuses the set — correctly, because it must not certify bytes it did not produce. Merging the previous fix demonstrated it: every build job passed, publish was approved, and it failed on exactly that check with the registry untouched. A gate that can only fail is a trap left standing open on `main`. `verify` now also requires something left to publish. `published.mjs` asks the registry whether every package in the fixed set already carries the working tree's version, and the workflow reads it before Changesets rewrites those manifests, so the question is about the commit that was pushed. An unreachable registry reports not-published. A registry this cannot read is one it cannot claim anything about, and the safe direction is to let the chain run: the worst case is the pending deployment this exists to avoid, whereas wrongly reporting "published" would silently skip a real release. Partial publication reports not-published for the same reason, which is what keeps the documented resume path reachable.
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.
Why
release.ymltriggers on every push tomain, and the release chain is gated only onhasChangesets == 'false'. That is satisfied by any ordinary merge, not just a Version Packages merge — so every commit tomainruns the full chain and parks a deployment at thenpm-productiongate.Approving one cannot succeed. The sealed commit no longer matches the commit named in the published packages' provenance:
That refusal is correct — the publisher must not certify bytes it did not produce, and
RELEASING.mdalready says resumption must be "from the exact same commit". But it leaves a gate onmainthat can only ever fail.This was demonstrated by merging #11:
version,verify,seal, andbrowser_e2eall passed, publish was approved, and it failed on exactly that check. The registry was untouched.What changed
scripts/release/published.mjs(new) asks the registry whether every package in the fixed set already carries the working tree's version, and prints{ version, allPublished, missing }.verifynow also requiresallPublished == 'false'.seal,browser_e2e, andpublishall descend fromverify, so they skip with it and no deployment is created.Fail direction
An unreachable registry reports not published, so the chain runs. A registry the script cannot read is one it cannot make claims about, and the worst case of proceeding is the pending deployment this change exists to avoid — whereas wrongly reporting "published" would silently skip a real release. Partial publication reports not-published for the same reason, which keeps the documented resume path reachable.
Verification
Tested against the live registry in both directions:
check.mjs allandcheck.mjs workflowpass, and the workflow YAML parses with the expectedverify.ifand job outputs.Behaviour after this lands: merges to
mainskip the release chain entirely; a Version Packages merge still runs it, because the new version is not yet on the registry.