Skip to content

Files are associated with PR instead of commit after rebase merge #2140

@lukekarrys

Description

@lukekarrys

Environment details

  • OS: Darwin pieholden-m1.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:12 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8103 arm64 arm Darwin
  • Node.js version: 20.7.0
  • npm version: 10.2.3
  • release-please version: 16.13.0

Steps to reproduce

  1. Create multiple commits for a manifest release with each commit targeting a different package. For example feat: ws1 changes workspace1/package.json and fix: ws2 changes workspace2/package.json.
  2. Create a PR with the above commits from a new branch to main
  3. Merge the pull request using Rebase and merge
  4. Run release-please on main to create the PR
  5. Observe that the body of the PR will show workspace2 having received a minor version bump.

Other Details

Here is a public PR where I observed this behavior: npm/cli#6609. There are a lot of unnecessary details in that PR but the specific bits are:

  • arborist got bumped to 6.3.0 via add new pkg fix command npm/cli#6626
  • That PR contained 3 commits, 2 of which changed files within workspaces/arborist/ with a fix: prefix
  • The other commit in the PR changed files outside of workspaces/arborist/ with a feat: prefix

I went through the code and found that this happens because files for a merge commit are backfilled from the PR instead of the commit. This is correct when a squash merge is performed, but I think it is incorrect for rebase merges.

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