intuit / intuit/auto

bug(conventional-commits): PR commit bumps override (downgrade) merge commit bump

Open
#2,527 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.5k
Forks
221
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

When a squash-merged PR has a breaking change indicator in its title (e.g. `feat!:`), the conventional-commits plugin correctly parses the merge commit as `major`. However, the `parseCommit` hook then fetches the individual pre-squash PR commits and unconditionally overwrites the bump with the highest bump found among those commits — which may be lower (e.g. `minor` from `feat:` commits).

This means the merge commit's breaking change signal is silently lost.

**To Reproduce**

1. Configure auto with the `conventional-commits` plugin
2. Create a PR with individual commits like `feat: add feature` and `chore: update config`
3. Set the PR title to `feat!: breaking change` (note the `!`)
4. Squash-merge the PR (GitHub uses the PR title as the squash commit message)
5. Run `auto shipit -vv`
6. Observe the log output: `Found "minor" from conventional commit message: feat!: breaking change`
7. The release is `minor` instead of `major`

**Expected behavior**

The release should be `major` because the squash merge commit message is `feat!:`, which the plugin's own `breakingHeaderPattern` correctly matches.

**Screenshots**

Build log showing the bug in practice:
```
Found "minor" from conventional commit message: feat!: AB-4116 - add shared `@xxx/auto-config` package
```

**Environment information:**

```txt
auto version: 11.3.6
node version: v22.x
conventional-commits plugin version: 11.3.6
```

**Additional context**

The root cause is in `plugins/conventional-commits/src/index.ts`, in the `parseCommit` hook:

```typescript
let bump = await getBump(message); // correctly returns "major" for "feat!:"

if (commit.pullRequest && !prHasSemverLabel) {
const prBumps = /* bumps from individual PR commits */;
// Unconditionally overwrites bump — can downgrade major → minor
if (prBumps.includes(SEMVER.major)) {
bump = SEMVER.major;
} else if (prBumps.includes(SEMVER.minor)) {
bump = SEMVER.minor; // ← overwrites "major" with "minor"
}
}
```

The PR commit bumps should only be able to *upgrade* the release type, never downgrade it. The fix is to include the merge commit's own bump in the comparison array.

Possibly related: #2280 (feature request about using PR titles as the conventional commit source)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.