googleapis / googleapis/release-please

All commits added to changelog after merging a branch containing a release

Open
#2,044 6 comments 3 reactions 1 assignee Claimed by @chingor13 View on GitHub
priority: p3 type: bug
Dominant language
TypeScript
Stars
7.5k
Forks
588
Avg merge
12h 16m
Merged PRs (30d)
7

Description

#### TL;DR

After making a release with release-please on a "hotfix" emergency branch, I rebased on `main` and squash merged the hotfix branch to `main`. After creating a release pr on `main`, all commits since the beginning are added to the changelog.

#### Expected behavior

The changelog contains only the commits since latest ("hotfix") release.

####Observed behavior

The changelog contains all commits since the beginning of the repo.

#### Example repository

https://github.com/loderunner/devexp-flow

* the 1.1.1 release is the hotfix release
* the 1.2.0 release PR is the next trunk release
* the [1.2.0 release PR changelog](https://github.com/loderunner/devexp-flow/pull/15) shows all commits since the beginning
* [comparing 1.1.1 to `main`](https://github.com/loderunner/devexp-flow/compare/1.1.1...main) only yields 3 commits, that are the ones I expect to see in my changelog

#### Environment details

- OS: Ubuntu 20.04.6 LTS
- Node.js version: 20.2.0
- npm version: 9.6.6
- `release-please` version: 15.12.0

#### Steps to reproduce

1. Initialize `release-please` on a node project with `release-please bootstrap --type node`
2. Add a feature commit on `main`, `git commit -m 'feat: initial commit'`
3. Create a GitHub release on `main` with `release-please github-release --target-branch main`
4. Add a feature commit on `main`, `git commit -m 'feat: some feature'`
5. Create a release PR on `main` with `release-please release-pr --target-branch main`
6. Create a `hotfix` branch based on latest release (before "some feature") `git switch -c hotfix 1.0.0`
7. Add a fix commit on the `hotfix` branch, `git commit -m 'fix: some fix'`
8. Create a release PR on the hotfix branch `release-please release-pr --target-branch hotfix`
9. Squash merge the release PR into the `hotfix` branch
10. Create a release from the `hotfix` branch, `release-please github-release --target-branch hotfix`
11. Rebase the `hotfix` branch on `main`, `git rebase main hotfix`
12. Open a PR from `hotfix` to `main` and squash merge it (commit message 'fix: some fix')
13. Update the release PR on `main`, `release-please release-pr --target-branch main`

If I didn't get this wrong, the release PR changelog _should_ include `feat: initial commit`. Feel free to ask me follow-up questions as this scenario is drawn from memory and might not work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.