Improve Codeowner docs: require approval from multiple sets of approvers (e.g. 1 approval from the pool of tech writers and 1 approval from the pool product managers)
Problem
There are users that want to require approval from multiple sets of approvers (e.g. 1 approval from the pool of tech writers and 1 approval from the pool product managers). See the right column in #335451 (closed) for a list of customers.
It is in fact possible to do that today as Kai explained but it is not documented.
Proposal
Here is how it works: Have two sections that contain the same rule with different reviewers
[Documentation Team]
README.md @doc
[Product Team]
README.md @prod
Then for each section there will be an approval required:
![](/-/project/278964/uploads/57210c53539f077c916aba375f71acec/image.png)
Generally, the documentation and especially the headlines and subheadlines take too much of the perspective of the CODEOWNER file (e.g. When a file matches multiple CODEOWNERS entries
) rather than what the users want to achieve (e.g. "Have source code approved by multiple sets of reviewers"). Also the order of sections in https://docs.gitlab.com/ee/user/project/code_owners.html#when-a-file-matches-multiple-codeowners-entries seems questionable as we start with explaining what the system does in an edge case that could almost go into a trouble shoot section. Even the title Organize Code Owners by putting them into sections hides the main value of the sections, which is being able to require approval from multiple sets of reviewers. A better title would be Organize CODEOWNERS into sections to require approval from multiple sets of approvers
.
Side note, JiHu is contributing the use case shown in the left column of #335451 (closed). When reorganizing the structure of the CODEOWNERS documentation to achieve the above it may make sense to take into account that these changes from JiHu will be added soon.