Latest merge request title is not used as default squash commit message if it's changed after 'merge when pipeline succeeds' button is pressed
Summary
When squash commits is enabled on an MR, the MR title is used as the default squash commit message. But, if the MR title changes after Merge when pipeline succeeds button is pressed, the latest MR title won't make it to the squash commit message when the MR is finally merged after the pipeline is complete. It uses the MR title from the point when the Merge when pipeline succeeds button is pressed as squash commit message.
Steps to reproduce
- Create a project with a CI pipeline that runs for a minute or so.
- Create an MR and enable squash commits.
- Press
Merge when pipeline succeedsbutton when the pipeline is running. - Edit the MR title to something else while the pipeline is still running.
- Notice the squash commit message after the MR is merged.
Example Project
Happens on .COM and Self-Managed.
What is the current bug behavior?
Latest MR title is not used as squash commit message.
What is the expected correct behavior?
Latest MR title should be used as squash commit message.
Work around
Use custom Squash commit messages: https://docs.gitlab.com/ee/user/project/merge_requests/squash_and_merge.html#squash-commits-in-a-merge-request API: https://docs.gitlab.com/ee/api/merge_requests.html
Proposal
If merge information is changed after the merge process has started, but before merge (in the case of MWPS), the merge request should be removed from the merge process, and someone should need to re-add the merge request to the merge queue.