Code Owner Approval: Approvers not updated when target branch is changed in MR
Summary
When enabling Protected Branches approval by Code Owners on all protected branches, once the target branch of a merge request is changed to another protected branch, the approver list by code owners is not updated until a new commit to source branch.
Steps to reproduce
- Create a new project in GitLab EE with proper license.
- Create new branches of
subintandchild. - Enable "Protected Branches approval by Code Owners" on protected branches of
masterandsubint*. - Create
CODEOWNERSfile under root of the repository. Make a specific file/directory owned by different user onmasterandsubint1. - Make change to above mentioned specific file on
childbranch. - Create a merge request between
childandsubint1. - Update the target branch of above merge request to
master.
Example Project
xiaogang_gitlab/code-owner-approval-example!1
What is the current bug behavior?
Approver list is not updated after target branch changes. When a new commit is added to source branch the approver list gets updated to align with new target branch.
What is the expected correct behavior?
Approver list gets updated immediately once the target branch is changed.
Relevant logs and/or screenshots
N/A
Output of checks
This 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)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)