Skip to content

Commit overrides do not work when merges are not squashed #1899

@ivomurrell

Description

@ivomurrell

Environment details

  • OS: macOS 13.1
  • Node.js version: 16.14.0
  • npm version: 8.5.4
  • release-please version: 15.9.2

Steps to reproduce

  1. Make a commit to branch foo that's designated as a breaking change with a commit message like feat!: rewrite in rust
  2. Create a PR to merge foo into main
  3. Merge foo to your main branch along with a merge commit with git merge --no-ff foo. This is GitHub's behaviour when merging a PR with the 'Create a merge commit' dropdown option.
  4. Try to override the semver resolution to only do a minor version bump by overriding the commit message in the PR body with something like
BEGIN_COMMIT_OVERRIDE
feat: rewrite in rust
END_COMMIT_OVERRIDE
  1. Note that the PR generated by release-please is still treating the change as a major version bump.

This is because only the merge commit has a pullRequest associated with it, and so only the merge commit is overridden, whilst the rest of the commits merged in are preserved. So in this example the commits from this merge will be overridden from

Merge pull request #1 from example/repository
feat!: rewrite in rust

to

feat: rewrite in rust
feat!: rewrite in rust

So the major version bump from the original commit message wins out.

This means that it isn't possible to drop a change from a major version bump to a minor version bump via the PR body if you selected GitHub's 'Create a merge commit' option rather than its 'Squash and merge' option, even though both are stated to be supported by release-please.

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions