Skip to content

Commit ddc9edb

Browse files
committed
test(ci): fixture the no-major changeset guard and wire it into the exemption-free self-test step (#6923)
`scripts/check-changeset-no-major.mjs` was the one member of the changeset-gate family with no `--self-test`, which is why PR #6917 could not wire it into `lint.yml` alongside the other two. Refactor it into a pure `judge()` plus a pure `render()` (verdict -> lines + exit code), add 70 fixtures, and add the script to `check:changeset-gate-self-tests`. The fixtures were measured against `@changesets/parse@0.4.3` rather than reasoned about, and that measurement found a real divergence: the parser required its fence on line 1, so a changeset opening with a blank line declared nothing to this guard while changesets honoured its `major` and would have promoted the whole lockstep group. Both sibling parsers already skipped leading blanks, and all three carry a comment claiming the three read the same block -- so this was also the one place that comment was false. Fixed, and pinned. The enforcing half is still unexecuted on CI: `.changeset/pre.json` is `"mode": "pre"`, so the real scan takes the exemption branch on every run. What changed is that `enforce` is now produced by fixtures on every PR, in a job with no label exemption. Fixtured is not executed, and the header says so. Also corrects `check-empty-changeset.mjs`, whose consumer assertion stated in its own message that this script is "deliberately absent: it has no `--self-test` to run" -- true when #6917 wrote it, false as of this commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F8q5J1MQyocgtNspb15fSn
1 parent 63f3b87 commit ddc9edb

3 files changed

Lines changed: 580 additions & 55 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"check:prerelease-pins": "node scripts/check-prerelease-pin-watch.mjs --self-test && node scripts/check-prerelease-pin-watch.mjs",
6868
"check:empty-changeset": "node scripts/check-empty-changeset.mjs --self-test && node scripts/check-empty-changeset.mjs",
6969
"check:adr-0087-registration": "node scripts/check-adr-0087-registration.mjs --self-test && node scripts/check-adr-0087-registration.mjs",
70-
"check:changeset-gate-self-tests": "node scripts/check-empty-changeset.mjs --self-test && node scripts/check-adr-0087-registration.mjs --self-test",
70+
"check:changeset-gate-self-tests": "node scripts/check-empty-changeset.mjs --self-test && node scripts/check-adr-0087-registration.mjs --self-test && node scripts/check-changeset-no-major.mjs --self-test",
7171
"check:override-consistency": "node scripts/check-override-consistency.mjs --self-test && node scripts/check-override-consistency.mjs",
7272
"check:release-notes": "node scripts/check-release-notes.mjs",
7373
"check:release-body": "node scripts/release-github-releases.mjs --self-test",

0 commit comments

Comments
 (0)