ci(changeset-check): gate on changesets the PR adds, not a non-empty dir#3376
Merged
Conversation
…ty dir The `Check Changeset` gate counted every `.md` in `.changeset/` (`find | wc -l`), so it only asserted the directory was non-empty — never that THIS PR contributed a changeset. In pre-release (RC) mode `changeset version` retains consumed changeset files, so the directory is permanently non-empty and the gate can never go red: #3373 merged a real spec / api-surface fix with no changeset while the step reported "Found 104 changeset(s)". Diff the base commit instead and count only changesets the PR adds. An empty-frontmatter changeset still counts — it is the sanctioned "releases nothing" declaration. Proven to go RED on #3373's diff (0 added) and GREEN on #3360's (1 added). Also backfills the missing #3373 changeset so the ViewFilterRule operator enum fix actually ships in the next release. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
changeset 是不是坏了— no. But theCheck Changesetgate is falsely green, which is why real changes (e.g. the #3373 spec fix) slipped ontomainwith no changeset and won't be released.The gate counted every
.mdin.changeset/:CHANGESET_COUNT=$(find .changeset -name '*.md' ! -name 'README.md' | wc -l)That only asserts the directory is non-empty — never that this PR added a changeset. In pre-release (RC) mode
changeset versionretains consumed changeset files, so the directory is permanently non-empty and the gate can never go red. Evidence: #3373 merged a real@objectstack/spec/api-surface.jsonfix with no changeset while this step reportedFound 104 changeset(s).What
git diff --diff-filter=A "$BASE_SHA" HEAD -- '.changeset/*.md'). RC residue no longer masks a missing changeset. An empty-frontmatter changeset still counts — it is the sanctioned "this PR releases nothing" declaration, on par with theskip-changesetlabel.@objectstack/specpatch) so the ViewFilterRule operator-enum fix actually ships in the next RC instead of being stranded onmain.Proof it can go red (防假绿)
Ran the new one-liner against real commits:
find= 104d419826a8^..d419826a8(spec fix, no changeset)2b5d7258d^..2b5d7258d(adds a changeset)This PR adds its own changeset, so it passes its own gate.
🤖 Generated with Claude Code