dependabot-core
dependabot-core copied to clipboard
Update the release script to support merging PR's via squashing/rebasing
Is there an existing issue for this?
- [X] I have searched the existing issues
Code improvement description
If code is merged to dependabot-core
via squash or merge-via-rebase, then it messes with the release script in dependabot-core due to this code:
https://github.com/dependabot/dependabot-core/blob/764af2b5b755a0ceee1830457679d4d80291a7b2/bin/bump-version.rb#L30
So currently this requires us to merge PR's via the merge strategy... which pulls in the git commit history as-is from the PR.
However, we've got "Require branches to be up to date before merge" set because of how we deploy. So that means we're constantly having to click "update branch" before merging. While the GitHub button supports update-via-rebase, the default value is update-via-merge, so we get a lot of junk "merge main into
Additionally, some drive-by contributors on open source repos leave great PR's but horrid git history. We can ask PR authors to cleanup their commit history, but IME on other open source repos this typically has mixed results...
So allowing maintainers to squash/fixup the commit history can make future git blame
/ git bisect
spelunking a bit more pleasant...
So need to find a way for the release script to work even with merging PR's via rebasing or squashing.