Assign approvers based on code owners
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:
overall_approversmethod now returnsUserinstead ofApprover. This is because it needs to include code owners, which are dynamically calculated therefore does not have a correspondingApprovercolumn.- Due to the above, calls to
overall_approversare changed to work withUserinstead. - And due to the above, one action is added to enable deleting of approver by using
user_idinstead. This is because we only haveUserinstead ofApprover, 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 usinguser_idinstead. - 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?
- Changelog entry added, if necessary
- Documentation created/updated
- Tests added for this feature/bug
- Conforms to the code review guidelines
- Conforms to the merge request performance guidelines
- Conforms to the style guides
- Conforms to the database guides
- EE specific content should be in the top level
/eefolder - For a paid feature, have we considered GitLab.com plans, how it works for groups, and is there a design for promoting it to users who aren't on the correct plan?
Edited by 🤖 GitLab Bot 🤖