Skip to content

ci: align breaking-change detector with release-it parser semantics#353

Merged
MarioCadenas merged 1 commit intomainfrom
ci/breaking-change-detector-parity
May 6, 2026
Merged

ci: align breaking-change detector with release-it parser semantics#353
MarioCadenas merged 1 commit intomainfrom
ci/breaking-change-detector-parity

Conversation

@MarioCadenas
Copy link
Copy Markdown
Collaborator

@MarioCadenas MarioCadenas commented May 6, 2026

Summary

The detector added in #350 used a hand-rolled regex that didn't match what release-it (via conventional-changelog-conventionalcommits) actually treats as a major-bumping change. Surfaced while testing #352 — a PR with BREAKING CHANGES: ... (plural) in its description was passing the gate, but so were a few other inputs that release-it would silently bump major on.

I instrumented the live parser and ran ~30 commit-message variants through whatBump, then tightened the regex until it agreed with the parser on every case. The new regex differs in four ways:

  • Case-insensitive. Feat!:, FEAT!:, and breaking change: ... all bump major in release-it.
  • Leading whitespace allowed. BREAKING CHANGE: ... is a valid footer per the parser.
  • Colon optional. BREAKING CHANGE foo (no colon) is a valid footer; the parser tokenizes on word boundary.
  • Plural still excluded. BREAKING CHANGES is not breaking per the parser, so \b(?!S) keeps us from creating false positives on prose like "introduces some breaking changes:".

Verified end-to-end against PR #352's actual inputs.

Test plan

  • On the PR for this branch, confirm the workflow stays green (no breaking markers in this commit).
  • Rebase feat: breaking test #352 on this branch and confirm:
    • BREAKING CHANGES: ... (plural) in the description does not trigger the gate.
    • BREAKING CHANGE: ... (singular) in the description does trigger the gate.
    • breaking change: ... (lowercase singular) does trigger the gate.
    • Feat!: ... (mixed-case bang in title) does trigger the gate.

Verified the regex case-by-case against
`conventional-changelog-conventionalcommits` (the parser release-it
actually uses) and tightened it so it matches release-it's notion of
"this triggers a major bump" exactly:

- Case-insensitive match on both subject `type!:` and the
  `BREAKING[ -]CHANGE` footer keyword (e.g. `Feat!:` and
  `breaking change: ...` both bump major in release-it).
- Footer line allows leading whitespace (release-it accepts
  `  BREAKING CHANGE: ...`).
- Footer keyword no longer requires a `:` (release-it accepts
  `BREAKING CHANGE foo`); we now end on a word boundary.
- Plural `BREAKING CHANGES` is explicitly excluded with `\b(?!S)`
  because release-it does NOT treat it as breaking — flagging it
  would be a false positive that blocks harmless prose.
@MarioCadenas MarioCadenas requested a review from a team as a code owner May 6, 2026 17:12
@MarioCadenas MarioCadenas requested a review from atilafassina May 6, 2026 17:12
@MarioCadenas MarioCadenas changed the title ci: align breaking-change detector with release-it parser semantics Feat!: testing mixed-case bang May 6, 2026
@MarioCadenas MarioCadenas changed the title Feat!: testing mixed-case bang ci: align breaking-change detector with release-it parser semantics May 6, 2026
@MarioCadenas MarioCadenas force-pushed the ci/breaking-change-detector-parity branch from 813d9ba to 40731b9 Compare May 6, 2026 17:21
@MarioCadenas MarioCadenas enabled auto-merge (squash) May 6, 2026 17:25
@MarioCadenas MarioCadenas disabled auto-merge May 6, 2026 17:25
@MarioCadenas MarioCadenas enabled auto-merge (squash) May 6, 2026 17:25
@MarioCadenas MarioCadenas merged commit b67396c into main May 6, 2026
22 of 28 checks passed
@MarioCadenas MarioCadenas deleted the ci/breaking-change-detector-parity branch May 6, 2026 17:31
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.

2 participants