Update code owner validators to allow inherited groups
What does this MR do and why?
Update code owner validators to allow inherited groups
This change is part of Acceptable CODEOWNERS Groups Should Inherit fro... (#288851 - closed)
This will ensure that the code owner validators work correctly with the code owner logic.
References
Acceptable CODEOWNERS Groups Should Inherit fro... (#288851 - closed)
How to set up and validate locally
- Setup a project with the following structure
group
|-- dev-group
|-- reporter-group
|-- product-group
|-- project
dev-group
reporter-group
- Invite
group/dev-groupanddev-grouptogroupwith a maximum role of developer - Invite
group/reporter-groupandreporter-grouptogroupwith a maximum role of reporter - Invite a developer to each group. Make sure there's a unique developer for each.
- Setup a code owners file in
group/product-group/projectand include all groups. We generate one error per line regardless of how many offences there are so each line should only have a single group. You can do this by having sections with*entry inside for each group i.e.
[Group]
* @group
[Dev Group]
* @dev-group
[Reporter Group]
* @reporter-group
...
- View a file in the project repo and look at the code owners
- It should show errors for all the groups
- Switch to this branch and reload (and enable
Feature.enable(:check_inherited_groups_for_codeowners)) - It should show errors for
group/reporter-groupmembers andreporter-groupmembers but not forgroup/dev-groupordev-group
Edited by Joe Woodward