Merge commit message no longer updating with %{approved_by} value after MR approved, until page refreshed
Summary
A customer (ZD internal link) has reported that in GitLab.com since approximately 2023-11-20 merge commit messages are no longer being updated with the correct %{approved_by} values when the MR is approved, until the MR page is refreshed.
This leads to merge commits being created without the details necessary to meet their compliance requirements, which then requires laborious manual updating and force pushing of the branch to update the message.
I have reproduced this behavior in GitLab.com and in the current nightly image and I have also confirmed that it doesn't occur in version 16.6.0. This supports the report that the issue has only started occurring in GitLab.com over the last few days.
Steps to reproduce
- As
user2
, create a new project with merge commit as the merge method and with a merge commit message template containing a lineApproval: %{approved_by}
. - Add an approval rule requiring approval by
user1
. Inviteuser1
to the project as a maintainer. - As
user2
, make a change and create a new merge request. In the MR overview page confirm merging is blocked awaiting approval fromuser1
. Remain on this page. - In a separate incognito session, login as user1 and go to the MR overview page and approve the MR. Select the
Edit commit message
checkbox and note that the commit message does not show the approving user details. - Back on the
user2
MR overview page the MR status has automatically updated to allow Merging, but if you select teEdit commit message
checkbox the commit message does not show the approving user details. - Refreshing the
user1
oruser2
page will then show the approving user details in the commit message. - If the MR is merged from either page without first refreshing the page the incomplete commit message is saved.
Example Project
What is the current bug behavior?
What is the expected correct behavior?
Relevant logs and/or screenshots
version 16.6.0 after approving and viewing commit message:
gitlab.com/nightly after approving and viewing commit message:
Output of checks
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)