test(ci): fail fast when package.json and the lockfile disagree - #14
Merged
Merged
Conversation
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.
Adds the missing check from the 0.1.6-alpha.2 batch retrospective (R22): two releases in that batch reached CI with a
package.jsonpeer that the lockfile did not know about, because the local acceptance chain never ran a frozen install. The first thing that failed was the release workflow, withERR_PNPM_OUTDATED_LOCKFILE.What
scripts/check-lockfile-drift.mjsrunspnpm install --frozen-lockfile --lockfile-only --ignore-scripts:--frozen-lockfilemakes pnpm refuse to rewrite the lockfile and--lockfile-onlykeeps it away fromnode_modules, so the probe is read-only. Exit 0 = the two files agree; exit 1 prints the one-line fix (pnpm install --lockfile-only, then commit the lockfile).package.jsongainscheck:lockfile, and the documented Checks chain inAGENTS.mdincludes it right after theverify:*gates.This is the pilot for the family: the same script + one-line wiring can be copied into the other published repos (the batch's ~23 publishers), which is recorded as a rollout item rather than done everywhere at once.
Verified locally
pnpm run check:lockfile->lockfile ok: package.json and pnpm-lock.yaml agree(exit 0).package.jsonwithout touching the lockfile makes it exit 1 withlockfile drift: package.json and pnpm-lock.yaml disagree.+ the fix line; reverted immediately (git statusshows only the three intended changes).pnpm run typecheckexit 0,pnpm test133/133.