Skip to content

Assign approvers based on code owners

Mark Chao requested to merge 1012-assign-code-owner-as-approver into master

The CE port is at https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22513

What does this MR do?

Assign approvers based on code owners

  • Only allow assigning when code owner feature is available
  • Update owner when commit is pushed
  • Give code owner as option when creating merge request
  • Remove code owner as approver suggestion

Context

The major changes are:

  1. overall_approvers method now returns User instead of Approver. This is because it needs to include code owners, which are dynamically calculated therefore does not have a corresponding Approver column.
  2. Due to the above, calls to overall_approvers are changed to work with User instead.
  3. And due to the above, one action is added to enable deleting of approver by using user_id instead. This is because we only have User instead of Approver, and if we want to get an user's approver it would cause extra database queries. At the end I decided to allow deleting of approvers by using user_id instead.
  4. For code push, we need to compute the difference in code owners, before and after the push.

What are the relevant issue numbers?

Closes #1012 (closed)

Does this MR meet the acceptance criteria?

Edited by 🤖 GitLab Bot 🤖

Merge request reports