Skip to content

ci: exempt Changesets pre-release (RC) mode from the no-major guard#3342

Merged
os-zhuang merged 1 commit into
mainfrom
ci/changeset-no-major-rc-exempt
Jul 20, 2026
Merged

ci: exempt Changesets pre-release (RC) mode from the no-major guard#3342
os-zhuang merged 1 commit into
mainfrom
ci/changeset-no-major-rc-exempt

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

Make the launch-window no-major guard (scripts/check-changeset-no-major.mjs) stand aside while Changesets is in pre-release (RC) mode.

Why

The guard scans every pending changeset in the tree (not the PR diff), so a single major changeset sitting on main makes the Check Changeset job red on every subsequent PR that lacks the allow-major label. That is exactly what is happening now: .changeset/remove-session-tenantid-alias.md (#3290) declares three major bumps.

But the repo is currently in changeset pre enter rc mode (.changeset/pre.json"mode": "pre", "tag": "rc"). In pre-release mode a major only ever produces a X.0.0-rc.N pre-release — nothing final publishes until changeset pre exit. Accumulating the next major's breaking changes is precisely what an RC window is for, so the guard should not fight its own release process by reding every PR with a per-PR allow-major toll.

Change

  • If .changeset/pre.json exists with mode: "pre", the guard prints the pending majors as ::notice:: annotations (so the RC curator can still eyeball them) and exits 0 instead of failing.
  • Outside pre-mode the behavior is unchanged: any major still fails, escape hatch remains the allow-major label.
  • The exemption keys off the Changesets state machine itself, so it re-arms automatically on changeset pre exit — zero per-PR maintenance.

Verification (local, both branches)

# RC mode (pre.json present, one major changeset)
✓ Changesets is in pre-release mode (tag: rc) — skipping the no-major guard.
::notice ...pending major in .changeset/remove-session-tenantid-alias.md: @objectstack/spec, @objectstack/objectql, @objectstack/runtime
exit=0

# non-pre mode (pre.json moved aside)
⛔ Changeset(s) declare a `major` bump.  ... exit=1

CI-tooling-only change (no publishable package touched) → skip-changeset.

🤖 Generated with Claude Code

check-changeset-no-major.mjs scans every pending changeset (not the PR diff),
so a single `major` sitting on main reds the "Check Changeset" job on every
subsequent PR. During an RC window that major is intentional: in Changesets
pre-release mode a `major` only yields a `X.0.0-<tag>.N` pre-release, and
nothing final ships until `changeset pre exit`.

Detect `.changeset/pre.json` (mode: "pre") and stand the guard aside for the
duration, emitting the pending majors as `::notice::` annotations so the RC
curator can still eyeball them. The guard re-arms automatically once pre-mode
exits, so it keeps protecting the lockstep `fixed` group the rest of the time.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@os-zhuang os-zhuang added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Jul 20, 2026
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment Jul 20, 2026 2:30am

Request Review

@os-zhuang
os-zhuang merged commit 629fbae into main Jul 20, 2026
17 of 18 checks passed
@os-zhuang
os-zhuang deleted the ci/changeset-no-major-rc-exempt branch July 20, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant