Skip to content

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

Merged
MuncleUscles merged 1 commit intomainfrom
chore/cap-auto-bump-at-minor
Apr 23, 2026
Merged

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

Conversation

@MuncleUscles
Copy link
Copy Markdown
Member

Summary

Convert .release-it.json.release-it.cjs and add a whatBump function that caps the recommended bump at minor even when a commit carries a BREAKING CHANGE footer or !: marker.

Why

Mirrors the fix shipped in genlayer-js PR #159. This CLI is currently on 0.38.x, and the existing config would happily bump it to 1.0.0 the moment anyone lands a commit with a "BREAKING CHANGE:" line in the body — even accidentally, e.g. via a copy-paste from a PR description. genlayer-js hit exactly that trap yesterday (0.28.7 → 1.0.0 unintentionally); this PR prevents the same thing happening here.

Most mature TS libraries don't let commit-message parsing ship majors. They leave that to a human running release-it major explicitly.

Effect

Commit type Before After
BREAKING CHANGE footer / !: marker major minor
feat: minor minor
fix: / chore: / docs: / ci: / style: / refactor: / perf: / test: patch patch
release-it major explicit major major (unchanged)

All other release-it settings (git, github, npm, types, hooks) carried over verbatim from the JSON config. JSON deleted because it takes precedence over CJS in release-it's config resolution order.

Test plan

  • release-it --dry-run --ci --no-npm --no-github --no-git — config loads, plugin runs, after:bump hook fires cleanly
  • Manual check after merge: next fix: commit produces a patch, not a major — review the auto-release version bump

Convert `.release-it.json` → `.release-it.cjs` so we can pass a custom
`whatBump` function to the conventional-changelog plugin. The function
caps the recommended bump at `minor`, even when a commit contains a
BREAKING CHANGE footer or `!:` marker.

Background: a stray "BREAKING CHANGE:" line in any commit body would
trip `conventional-recommended-bump` into recommending a major release,
which in this CLI's current 0.38.x state would instantly ship 1.0.0
without any intended stability declaration. Matching the fix applied
to genlayer-js (#159) so the two release pipelines behave the same.

Net effect:
  - BREAKING CHANGE footer / `!:` marker → minor bump (was: major)
  - feat:                                 → minor (unchanged)
  - fix: / chore: / docs: / ci: / etc.    → patch (unchanged)
  - `release-it major` still forces a major when genuinely needed

All other release-it settings (git, github, npm, types, hooks) carried
over verbatim from the JSON config. JSON deleted because it takes
precedence over CJS in release-it's config resolution order.
@coderabbitai
Copy link
Copy Markdown

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 26 minutes and 51 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 26 minutes and 51 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: f7238116-7d63-406b-bbee-55f5d2626cb0

📥 Commits

Reviewing files that changed from the base of the PR and between 2b5f177 and df312e0.

📒 Files selected for processing (2)
  • .release-it.cjs
  • .release-it.json
✨ 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.

@MuncleUscles MuncleUscles merged commit d0b5519 into main Apr 23, 2026
5 checks passed
@MuncleUscles MuncleUscles deleted the chore/cap-auto-bump-at-minor branch April 23, 2026 13:54
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