Skip to content

chore(release): cap auto-bumps at minor to avoid accidental majors#1608

Open
MuncleUscles wants to merge 1 commit intomainfrom
chore/cap-auto-bump-at-minor
Open

chore(release): cap auto-bumps at minor to avoid accidental majors#1608
MuncleUscles wants to merge 1 commit intomainfrom
chore/cap-auto-bump-at-minor

Conversation

@MuncleUscles
Copy link
Copy Markdown
Member

Summary

Add { breaking: true, release: "minor" } as the first entry in releaseRules so that commits with a BREAKING CHANGE footer or !: marker produce a minor bump instead of a major one.

Why

@semantic-release/commit-analyzer ships with a built-in default rule { breaking: true, release: "major" }. That default is consulted whenever the user-provided releaseRules don't cover a commit. The existing user rules (feat → minor, * → patch) do not match on the breaking flag, so a stray "BREAKING CHANGE:" line in any commit body would immediately ship a major release.

At the current 0.117.x state, that means the next accidental breaking footer would jump the project to 1.0.0 — not as a deliberate stability declaration, but as a side effect of commit-message parsing. genlayer-js hit exactly that trap yesterday (0.28.7 → 1.0.0 unintentionally); this PR prevents the same thing here.

Mirrors the equivalent fixes in:

How it works

Per @semantic-release/commit-analyzer docs: user rules in releaseRules are evaluated first; the default release rules are only consulted when no user rule matches. By explicitly matching breaking: true at the top of our rules, we keep the default major rule from firing for those commits.

Effect

Commit type Before After
BREAKING CHANGE footer / !: marker major minor
feat: minor minor
Everything else (fix:, chore:, docs:, …) patch patch
Explicit semantic-release --release major major major (unchanged)

Test plan

  • node -e 'require(\"./release.config.js\")' parses clean
  • After merge, verify that the next merged PR produces the expected bump level via the auto-release logs. If a BREAKING CHANGE: footer happens to land, it should produce a minor version, not a major.

Add `{ breaking: true, release: "minor" }` as the first entry in
`releaseRules` so that commits carrying a BREAKING CHANGE footer or
`!:` marker produce a minor bump instead of a major one.

Background: `@semantic-release/commit-analyzer` ships with a built-in
default rule `{ breaking: true, release: "major" }`. That default is
consulted whenever the user-provided `releaseRules` don't cover a
commit. The existing user rules (`feat` → minor, `*` → patch) do
not match on the `breaking` flag, so a stray "BREAKING CHANGE:"
line in any commit body would immediately ship a major release — at
the current 0.117.x state, that means 0.117.x → 1.0.0 without any
intended stability declaration.

By explicitly matching `breaking: true` first, we keep the default
major-bump rule from being evaluated for those commits. Genuine
major releases still work via an explicit `semantic-release
--release major` override (or a deliberate config change).

Mirrors the equivalent fixes shipped in:
  - genlayer-js  (PR #159, release-it + whatBump)
  - genlayer-cli (PR #295, release-it + whatBump)

User rules are evaluated before the defaults (per semantic-release's
commit-analyzer documentation); defaults only apply when no user rule
matches. Adding `breaking: true` at the top of `releaseRules`
therefore prevents the default `major` rule from firing for breaking
commits.

Effect:
  - BREAKING CHANGE footer / `!:` marker → minor (was: major)
  - feat:                                 → minor (unchanged)
  - everything else                       → patch (unchanged)
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@MuncleUscles has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 7 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 24 minutes and 7 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 191ea85d-ae80-446f-9b54-e9e398a62724

📥 Commits

Reviewing files that changed from the base of the PR and between 2ae6e87 and 0bd2c4b.

📒 Files selected for processing (1)
  • release.config.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/cap-auto-bump-at-minor

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant