Support Relationships in CODEOWNERS (or Approval Rules)
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Proposal
Currently we can use CODEOWNERS to control the approvers for individual parts of the codebase, or approval rules to cover more generic requirements. These are both all-or-nothing options with no granularity beyond mandatory or optional.
We would like to propose a mechanism is provided where relationships can be defined between elements of the code base, perhaps using an approach similar to merge request approval segregation of duties
For example if we have a CODEOWNERS thus:
* @alice
/path/to/file-1 @bob @carol
/path/to/file-2 @dan
/path/to/file-3 @dan
/.gitlab/CODEOWNERS @erin
We would like to be able to specify a rule that
- if
file-1is changed then@bobor@carolhave to approve (existing CODEOWNERS capability) - if
file-3is changed then@danhas to approve (existing CODEOWNERS capability)
but
- if
file-2is changed then@danhas to approve (existing CODEOWNERS capability) and one of@bobor@carolfor reasons, e.g. becausefile-1is directly consumingfile-2(proposed new approval rule capability)
At the moment there is no easy way to systemise these sorts of relationships leading to an incomplete approval chain.