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

  1. Create a new project in GitLab EE with proper license.
  2. Create new branches of subint and child.
  3. Enable "Protected Branches approval by Code Owners" on protected branches of master and subint*.
  4. Create CODEOWNERS file under root of the repository. Make a specific file/directory owned by different user on master and subint1.
  5. Make change to above mentioned specific file on child branch.
  6. Create a merge request between child and subint1.
  7. 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)

Edited Dec 13, 2019 by Xiaogang Wen
Assignee Loading
Time tracking Loading