Skip to content

fix(changeset): stop lockstep group forcing a whole-stack major release#2788

Merged
os-zhuang merged 1 commit into
mainfrom
claude/framework-changeset-major-av359k
Jul 10, 2026
Merged

fix(changeset): stop lockstep group forcing a whole-stack major release#2788
os-zhuang merged 1 commit into
mainfrom
claude/framework-changeset-major-av359k

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Why "it always wants a major"

The pending .changeset/adr-0090-docs-audience-enforcement.md declared:

'@objectstack/spec': major

Every publishable package is enumerated in a single Changesets fixed (lockstep) group in .changeset/config.json. Changesets applies the highest bump found anywhere in the group to every package in it. So that one major on spec promotes the entire monorepo (~70 packages) from 14.2.015.0.0 — even though every other changeset was minor/patch. That is the source of "明明没提交 major,却每次想发大版本".

Changes

  • Downgrade @objectstack/spec to minor in the ADR-0090 changeset, per the launch-window convention (breaking changes ship as minor while the stack versions in lockstep — they don't burn a major version number). The changeset body still documents the break. Next release now computes 14.3.0 instead of 15.0.0.
  • Add scripts/check-changeset-no-major.mjs — a zero-dependency guard that fails if any changeset declares a major bump — and run it in the changeset-check CI job. This prevents an accidental/over-strict major from ever again silently turning a PR into a whole-stack major release.
  • Escape hatch: the CI step is skipped when the PR carries the allow-major label, for when a whole-stack major release is genuinely intended.

Verification

  • node scripts/check-changeset-no-major.mjs → passes on the current changesets (no major remaining).
  • Injecting a synthetic major changeset makes the guard exit 1 with a clear offender list.

🤖 Generated with Claude Code


Generated by Claude Code

The ADR-0090 changeset marked `@objectstack/spec: major`. Because every
publishable package sits in one Changesets `fixed` (lockstep) group, that
single `major` promotes the ENTIRE monorepo (~70 packages) to a new major
version — 14.2.0 → 15.0.0 — even though every other changeset was minor/patch.
That is why versioning "always wants a major" despite no major being intended.

- Downgrade the spec bump to `minor` per the launch-window convention
  (breaking changes ship as minor while the stack versions in lockstep;
  the changeset body still documents the break). Next release computes 14.3.0.
- Add `scripts/check-changeset-no-major.mjs` (zero-dep) and run it in the
  `changeset-check` CI job so an accidental `major` can never again silently
  turn a PR into a whole-stack major release. Escape hatch: the `allow-major`
  PR label skips the guard when a major is genuinely intended.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018yGgQz1UdeGQN4PX29LNVz
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 10, 2026 12:09pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation ci/cd tooling size/m labels Jul 10, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review July 10, 2026 12:22
@os-zhuang
os-zhuang merged commit 1b0f3b4 into main Jul 10, 2026
15 checks passed
@os-zhuang
os-zhuang deleted the claude/framework-changeset-major-av359k branch July 10, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd documentation Improvements or additions to documentation size/m tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants