Last step of publish is selecting the wrong merge target
See original GitHub issueAfter a release we merge the release branch back to the base branch:
Unfortunately it looks like our algorithm for determining which branch to merge into if not explicitly provided is wrong. The past two sentry
releases have merged back into the wrong branch:
https://github.com/getsentry/publish/runs/4218472116?check_suite_focus=true#step:8:123 → https://github.com/getsentry/sentry/commit/9ae170c4b3b2fd608caabb37e9ce08281d5e4747
https://github.com/getsentry/publish/runs/3909141316?check_suite_focus=true#step:8:666 → https://github.com/getsentry/sentry/commit/b15920f0c741c35f70dab85b3b2b76ffa0317602
The result is that (at least) the CHANGES file in the sentry repo has not been updated since 21.9.0 … we’re missing all of the new changelog-y goodness!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:20 (20 by maintainers)
Top GitHub Comments
I might have a solution to this. Depending on whether I can get to it, I will try to push up a PR and test this locally.
For background: The current approach searches the current branches history for branch annotations. This assumes that the base branch has not moved in the meanwhile, e.g.
master
still points to a direct ancestor.My idea is based on https://stackoverflow.com/a/17843908. Instead, use
git show-branch
to search for the nearest ancestor commit (marked with a*
) that resides in a different branch. Example borrowed from the stack overflow answer with the relevant ancestor commit marked:@jan-auer I chose the current method in https://stackoverflow.com/a/55238339/90297 due to the reasons they listed under “Why did not show-branch work for me”. I did not encounter them but the last case kind of looked possible (develop vs master for hotfixes). I think we can try the other approach and see if it actually gives us any headaches.