Skip to content

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

  1. Setup a project with the following structure
group
|-- dev-group
|-- reporter-group
|-- product-group
    |-- project
dev-group
reporter-group
  1. Invite group/dev-group and dev-group to group with a maximum role of developer
  2. Invite group/reporter-group and reporter-group to group with a maximum role of reporter
  3. Invite a developer to each group. Make sure there's a unique developer for each.
  4. Setup a code owners file in group/product-group/project and 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
  ...
  1. View a file in the project repo and look at the code owners
  2. It should show errors for all the groups
  3. Switch to this branch and reload (and enable Feature.enable(:check_inherited_groups_for_codeowners))
  4. It should show errors for group/reporter-group members and reporter-group members but not for group/dev-group or dev-group
Edited by Joe Woodward

Merge request reports

Loading