Merge commit message not updated appropriately if auto-merge is configured
Summary
One of our customers (internal) is using the Merge commit message template to add the user who approved the MR in the commit message. As an example:
Merge branch '%{source_branch}' into '%{target_branch}'
%{title}
%{issues}
See merge request %{reference}
%{approved_by}
This behaves odd when used with set to auto-merge.
If I click Set to auto-merge before approving the MR, the %{approved_by}
is not rendered in the commit message.
If I approved the MR before clicking Set to auto-merge, the %{approved_by}
is rendered in the commit message.
I suspect what happens here is that the commit message is finalized after clicking Set to auto-merge.
Steps to reproduce
- Configure Merge commit message template as mentioned above.
- Create an MR.
- Click Set to auto-merge.
- Approve the MR.
What is the current bug behavior?
Commit message doesn't render %{approved_by}
if the MR is set to auto-merge prior to approving the MR.
What is the expected correct behavior?
Commit message should render %{approved_by}
if the MR is set to auto-merge prior to approving the MR.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)