Reputation: 5013
I love GitLab, but I am frustrated to assign approvers manually for each Merge Request. Gitlab friendly suggest to Tip: add a CODEOWNERS to automatically add approvers based on file paths and file types.
And so I did , I have created a file under : .gitlab/docs/CODEOWNERS.txt
Here is the contents of my file :
Multiple codeowners can be specified, separated by whitespace
CODEOWNERS @eduardo.baiao @n.belokopytov @viacheslav.iankovyi @yan.braslavsky
But unfortunately it does not auto assigns reviewers during Merge Requests. Did I do something wrong ? Am I missing something ?
Upvotes: 4
Views: 11043
Reputation: 947
Looks like there is a confusion in the previous answers here between
As a further clarification, I guess that the OP would like to choose the reviewers in the pool of approvers.
The OP is asking if Gitlab provides a feature to auto-choose reviewers, given the approval rules that apply to the current MR. Sadly, AFAIK, the answer is no.
However, you might want to look at what Gitlab itself is doing internally: their job danger-review
leverages a library danger
(https://danger.systems/js/) to run their "Reviewer Roulette": a process that assigns reviewer to a given MR (but I don't know if they take approval rules into account when doing so)
Upvotes: 4
Reputation: 362
Assigning approvers based on a CODEOWNERS
file requires either GitLab Premium or GitLab Silver (or higher).
CODEOWNERS
file should be placed in either .gitlab/ or docs/ or the root directory. I don't think it will find it in .gitlab/docs.CODEOWNERS
, not CODEOWNERS.txt
. Try removing the .txt extension and see if it works.Upvotes: 6