Check all top-level directories have CODEOWNER coverage

What does this MR do and why?

Check all top-level directories have CODEOWNER coverage.

Why? As part of moving away from relying on * rule, we want to ensure that all top-level directories have rules in .gitlab/CODEOWNERS. Not using the * rule reduces resets and ensures appropriate set of maintainers approving their relevant changes (e.g. FE maintainer should not approve workhorse changes)

Create static check to ensure that all top-level directories are included in .gitlab/CODEOWNERS

CI job added to .gitlab/ci/static-analysis.gitlab-ci.yml

How it works:

  1. Runs git ls-tree and extracts all unique top-level directory names (including dotfiles)
  2. Subtracts directories listed in the exclusion YAML
  3. For each remaining directory, checks if any non-catch-all CODEOWNERS line has a path with exactly /dirname/
  4. Exits 1 and prints the missing directories if any are uncovered

Any new top-level directory added to the repo will fail CI until it either gets an explicit CODEOWNERS entry or is added to the exclusion list with justification.

References

Screenshots or screen recordings

Before After

How to set up and validate locally

Run tooling/bin/validate_codeowners_coverage. You can adjust tooling/config/validate_codeowners_coverage.yml as needed.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thong Kuah

Merge request reports

Loading