Use standard commit for merge commits on the train ref
What does this MR do and why?
Merge commits on the train ref look like:
Merge branch 1-3adee4d9-20cf-42d4-a6db-1bc715adbbb7 with refs/heads/main into refs/merge-requests/1/train
for semi linear merge strategy train ref merge commits will make it to the default branch.
We want to change them to use the default merge commit format as specified in your project settings. For instance without any changes that will look like:
Merge branch '6-c3158ed5-3174-475a-8e06-2c6e958a5900' into 'main'
MR #: 6
See merge request !6
How to set up and validate locally
Example below:
- In rails console enable the experiment fully
Feature.enable(:standard_merge_train_ref_merge_commit)
- Create a project with merge trains enabled. Using the code from !129728 (merged) we can do:
rake gitlab:seed:merge_trains:project
- Use the
merge commit
orsemi-linear
merge strategy in the projects merge request settings - Change the default merge commit message for the project to something recognizable in the projects mr settings
- Add an MR to the train
- Navigate to the pipeline tab and click on the commit for the pipeline with the 'merge train' label
- Change the url from
/commit/
to/commits/
to see the full commit history for the train ref - Confirm that the default url was used as the merge commit on the train ref
- Test with the various combinations of strategies with squash on and off
- Test with the various combinations of strategies with a custom squash or merge method for that MR
Screenshots
Merge strategy | flag value | screenshot |
---|---|---|
merge commit | false | |
merge commit | true | |
merge commit - with custom message | true |
We see the same style of merge commit messages for semi linear. FF lacks a merge commit message.
Edited by Allison Browne