Suggest approvers based on code owners
A code owners file provides a version controlled way of documenting which groups or individuals are key stakeholders in specific areas of the codebase. These people are likely to be the best people to request a code review from and would likely make the best approvers.
Suggesting approvers when opening or editing a merge request is useful to open and flexible teams that do not want to impose rigid workflows, but want to document whom are the best people to request code reviews from.
We should build a simple suggestion based code owners feature, and then incrementally add levels of enforcement for stricter teams.
- Detect the presence of a code owners file in the target branch
- Show an interface to suggest approvers when creating or editing a merge request
The code owners file:
- follows the formatting conventions of gitignore
blank lines match no files and are ignored
A blank line matches no files, so it can serve as a separator for readability.
lines preceded by
A line starting with # serves as a comment. Put a backslash ("\") in front of the first hash for patterns that begin with a hash.
last matching rule has the highest precedence
rules consist of a pattern and a list of users and groups separated by whitespace
<pattern> <user> <user> ...
a user is specified with preceding
@john) or by email
- support for groups
- measure adoption of CODEOWNERS #5382