Skip to content

Commit 24157ec

Browse files
authored
chore(codeowners): keep architects as owners in every non-governance rule (#3738)
## What this PR does CODEOWNERS applies only the **last** matching rule, and matching is not additive: a scoped rule fully replaces the `*` catch-all instead of extending it. As a result `@kvaps` and `@lllamnyp` were not code owners for most scoped paths (21 and 36 of the 76 owner-bearing rules, respectively), and several paths (`/hack/`, `/.github/`, `/Makefile`, `/.pre-commit-config.yaml`, `/docs/`) were owned by exactly two people — with "Require review from Code Owners" enforced on `main`, a PR authored by one of them could only be approved by the other. This PR: - appends `@kvaps` and `@lllamnyp` to every rule that lists owners, keeping existing owners and their order; the governance block deliberately stays with `@tym83 @kvaps`, and the ownerless rules for generated files stay ownerless; - spells out the non-additive last-match semantics in the file header; - adds `hack/codeowners-invariant.bats` (auto-discovered by `make bats-unit-tests`), so a future scoped rule that omits the catch-all owners fails unit tests instead of silently carving its path out from under them. ### Screenshots Not a UI change. ### Downstream repositories - [x] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: - [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up: - [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up: - [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) - follow-up: - [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) - follow-up: - [ ] [cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server) - follow-up: - [ ] [cozystack/external-apps-example](https://github.com/cozystack/external-apps-example) - follow-up: - [ ] [cozystack/examples](https://github.com/cozystack/examples) - follow-up: ### Release note ```release-note chore(codeowners): @kvaps and @lllamnyp are now code owners for every path except governance files, removing single-approver review bottlenecks; a unit test guards the invariant ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated code ownership rules across dashboards, packages, Kubernetes components, backups, GPU and SeaweedFS components, Keycloak, documentation, and CI files. * Expanded area-specific review ownership while preserving existing governance and API review assignments. * **Tests** * Added automated validation to ensure ownership rules include the required default reviewers. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents cfaf2e0 + 361c729 commit 24157ec

2 files changed

Lines changed: 90 additions & 34 deletions

File tree

‎.github/CODEOWNERS‎

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
# from broad to specific. The API review gate block stays last so it cannot be
1111
# overridden.
1212
#
13+
# Matching is NOT additive: the last matching rule fully REPLACES every broader
14+
# one, including the * catch-all. There is no way to say "these people can
15+
# review anything" other than repeating their handles in every rule — a scoped
16+
# rule that omits them silently strips their ownership for that path, exactly
17+
# like the write-access pitfall below, just with valid handles. Policy: @kvaps
18+
# and @lllamnyp are listed in every rule, except the governance block which is
19+
# deliberately owned by @tym83 @kvaps alone.
20+
#
1321
# "Require review from Code Owners" is already enabled on main, so these rules
1422
# gate merges from the moment this file lands — they are not an intention to be
1523
# tightened later. That makes an unhonoured owner worse than a wrong one: GitHub
@@ -21,36 +29,36 @@
2129
* @kvaps @lllamnyp
2230

2331
# --- Dashboards, examples, tests (largest fall-throughs to the default) ---
24-
/dashboards/ @myasnikovdaniil @IvanHunters
25-
/examples/ @lllamnyp @myasnikovdaniil
26-
/examples/backups/ @androndo @lllamnyp
27-
/test/ @myasnikovdaniil
32+
/dashboards/ @myasnikovdaniil @IvanHunters @kvaps @lllamnyp
33+
/examples/ @lllamnyp @myasnikovdaniil @kvaps
34+
/examples/backups/ @androndo @lllamnyp @kvaps
35+
/test/ @myasnikovdaniil @kvaps @lllamnyp
2836

2937
# --- All packages: general owners (overridden by the specific areas below) ---
30-
/packages/ @lexfrei @IvanHunters @myasnikovdaniil @sircthulhu
38+
/packages/ @lexfrei @IvanHunters @myasnikovdaniil @sircthulhu @kvaps @lllamnyp
3139

3240
# --- Go source: general owners (specific cmd/pkg areas overridden below) ---
3341
/cmd/ @kvaps @lllamnyp @sircthulhu @lexfrei
3442
/internal/ @kvaps @lllamnyp @sircthulhu @lexfrei
3543
/pkg/ @kvaps @lllamnyp @sircthulhu @lexfrei
3644

3745
# --- Apps: default owners (specific apps overridden below) ---
38-
/packages/apps/ @lexfrei @IvanHunters @myasnikovdaniil @scooby87
46+
/packages/apps/ @lexfrei @IvanHunters @myasnikovdaniil @scooby87 @kvaps @lllamnyp
3947
/packages/apps/vm-instance/ @scooby87 @lllamnyp @kvaps @myasnikovdaniil
4048
/packages/apps/vm-disk/ @scooby87 @lllamnyp @kvaps @myasnikovdaniil
4149
/packages/apps/vpc/ @kvaps @lllamnyp
4250

4351
# --- Managed Kubernetes: app chart, node pools, resource definitions, control plane, CAPI ---
44-
/packages/apps/kubernetes/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei
45-
/packages/apps/kubernetes-nodes/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei
46-
/packages/system/kubernetes-rd/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei
47-
/packages/system/kubernetes-nodes-rd/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei
48-
/packages/system/kamaji/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei
49-
/packages/system/capi-operator/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei
50-
/packages/system/capi-providers-core/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei
51-
/packages/system/capi-providers-bootstrap/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei
52-
/packages/system/capi-providers-cpprovider/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei
53-
/packages/system/capi-providers-infraprovider/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei
52+
/packages/apps/kubernetes/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei @lllamnyp
53+
/packages/apps/kubernetes-nodes/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei @lllamnyp
54+
/packages/system/kubernetes-rd/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei @lllamnyp
55+
/packages/system/kubernetes-nodes-rd/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei @lllamnyp
56+
/packages/system/kamaji/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei @lllamnyp
57+
/packages/system/capi-operator/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei @lllamnyp
58+
/packages/system/capi-providers-core/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei @lllamnyp
59+
/packages/system/capi-providers-bootstrap/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei @lllamnyp
60+
/packages/system/capi-providers-cpprovider/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei @lllamnyp
61+
/packages/system/capi-providers-infraprovider/ @IvanHunters @kvaps @myasnikovdaniil @lexfrei @lllamnyp
5462

5563
# --- Extra apps ---
5664
/packages/extra/ @kvaps @lllamnyp @IvanHunters @lexfrei @myasnikovdaniil
@@ -68,24 +76,24 @@
6876
/packages/system/vm-default-images/ @scooby87 @lllamnyp @kvaps @myasnikovdaniil
6977

7078
# --- Backups ---
71-
/packages/system/backup-controller/ @androndo @lllamnyp @lexfrei
72-
/packages/system/backupstrategy-controller/ @androndo @lllamnyp
73-
/packages/system/velero/ @androndo @lllamnyp @lexfrei
74-
/cmd/backup-controller/ @androndo @lllamnyp
75-
/cmd/backupstrategy-controller/ @androndo @lllamnyp
79+
/packages/system/backup-controller/ @androndo @lllamnyp @lexfrei @kvaps
80+
/packages/system/backupstrategy-controller/ @androndo @lllamnyp @kvaps
81+
/packages/system/velero/ @androndo @lllamnyp @lexfrei @kvaps
82+
/cmd/backup-controller/ @androndo @lllamnyp @kvaps
83+
/cmd/backupstrategy-controller/ @androndo @lllamnyp @kvaps
7684

7785
# --- Flux ---
7886
/packages/system/fluxcd/ @kingdonb @kvaps @lllamnyp @myasnikovdaniil
7987
/packages/system/fluxcd-operator/ @kingdonb @kvaps @lllamnyp @myasnikovdaniil
8088

8189
# --- GPU ---
82-
/packages/system/hami/ @lexfrei @kvaps
83-
/packages/system/gpu-operator/ @lexfrei @kvaps
84-
/dashboards/gpu/ @lexfrei @kvaps
90+
/packages/system/hami/ @lexfrei @kvaps @lllamnyp
91+
/packages/system/gpu-operator/ @lexfrei @kvaps @lllamnyp
92+
/dashboards/gpu/ @lexfrei @kvaps @lllamnyp
8593

8694
# --- SeaweedFS ---
87-
/packages/system/seaweedfs/ @IvanHunters @lexfrei @myasnikovdaniil
88-
/packages/extra/seaweedfs/ @sircthulhu @lexfrei @myasnikovdaniil
95+
/packages/system/seaweedfs/ @IvanHunters @lexfrei @myasnikovdaniil @kvaps @lllamnyp
96+
/packages/extra/seaweedfs/ @sircthulhu @lexfrei @myasnikovdaniil @kvaps @lllamnyp
8997

9098
# --- cozystack-api / controller / lineage webhook ---
9199
/packages/system/cozystack-api/ @IvanHunters @kvaps @lllamnyp @lexfrei
@@ -96,9 +104,9 @@
96104
/cmd/lineage-controller-webhook/ @IvanHunters @kvaps @lllamnyp @lexfrei
97105

98106
# --- Keycloak ---
99-
/packages/system/keycloak/ @sircthulhu @lexfrei @IvanHunters @myasnikovdaniil
100-
/packages/system/keycloak-operator/ @sircthulhu @lexfrei @IvanHunters @myasnikovdaniil
101-
/packages/system/keycloak-configure/ @sircthulhu @lexfrei @IvanHunters @myasnikovdaniil
107+
/packages/system/keycloak/ @sircthulhu @lexfrei @IvanHunters @myasnikovdaniil @kvaps @lllamnyp
108+
/packages/system/keycloak-operator/ @sircthulhu @lexfrei @IvanHunters @myasnikovdaniil @kvaps @lllamnyp
109+
/packages/system/keycloak-configure/ @sircthulhu @lexfrei @IvanHunters @myasnikovdaniil @kvaps @lllamnyp
102110

103111
# --- API surface (architects): API types, aggregated apiserver, registry ---
104112
/api/ @kvaps @lllamnyp
@@ -120,13 +128,13 @@
120128
/packages/system/*/cozyrds/
121129

122130
# --- Docs ---
123-
/docs/ @lexfrei @myasnikovdaniil
131+
/docs/ @lexfrei @myasnikovdaniil @kvaps @lllamnyp
124132

125133
# --- CI / automation ---
126-
/.github/ @myasnikovdaniil @lexfrei
127-
/hack/ @myasnikovdaniil @lexfrei
128-
/Makefile @myasnikovdaniil @lexfrei
129-
/.pre-commit-config.yaml @myasnikovdaniil @lexfrei
134+
/.github/ @myasnikovdaniil @lexfrei @kvaps @lllamnyp
135+
/hack/ @myasnikovdaniil @lexfrei @kvaps @lllamnyp
136+
/Makefile @myasnikovdaniil @lexfrei @kvaps @lllamnyp
137+
/.pre-commit-config.yaml @myasnikovdaniil @lexfrei @kvaps @lllamnyp
130138

131139
# --- Governance, licensing, project docs ---
132140
/LICENSE @tym83 @kvaps

‎hack/codeowners-invariant.bats‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bats
2+
# -----------------------------------------------------------------------------
3+
# Coverage invariant for .github/CODEOWNERS.
4+
#
5+
# CODEOWNERS applies only the LAST matching rule, and matching is not
6+
# additive: a scoped rule fully replaces the * catch-all instead of extending
7+
# it. The only way to keep the default owners able to review everything is to
8+
# repeat their handles in every scoped rule. A rule that omits them silently
9+
# carves its path out from under the catch-all — that is how /hack/,
10+
# /.github/, /Makefile, /.pre-commit-config.yaml and /docs/ ended up owned by
11+
# exactly two people, deadlocking every PR one of them authored while the
12+
# other was away ("Require review from Code Owners" is enforced on main, and
13+
# stale reviews are dismissed on push, so there is no way around a missing
14+
# owner short of an admin override).
15+
#
16+
# The invariant: every rule that lists owners must include every owner of the
17+
# * catch-all. Two deliberate exceptions:
18+
# - ownerless rules — generated files whose review is waived on purpose;
19+
# - the governance roster, owned by exactly @tym83 @kvaps. It is identified
20+
# by that owner set rather than by its position in the file, so the
21+
# exemption cannot leak to rules appended under other sections.
22+
#
23+
# Changing the catch-all owners or growing the governance roster is a policy
24+
# change; this test failing on such a change is the point — adjust the
25+
# expectation here in the same PR, with the policy discussion linked.
26+
# -----------------------------------------------------------------------------
27+
28+
@test "every CODEOWNERS rule that lists owners repeats the catch-all owners (governance excepted)" {
29+
[ -f .github/CODEOWNERS ]
30+
31+
awk '
32+
/^[[:space:]]*(#|$)/ { next }
33+
$1 == "*" { for (i = 2; i <= NF; i++) defaults[$i]; ndef = NF - 1; next }
34+
NF < 2 { next }
35+
NF == 3 && (($2 == "@tym83" && $3 == "@kvaps") || ($2 == "@kvaps" && $3 == "@tym83")) { next }
36+
{
37+
for (d in defaults) {
38+
found = 0
39+
for (i = 2; i <= NF; i++) if ($i == d) found = 1
40+
if (!found) { printf "line %d: rule %s is missing default owner %s\n", FNR, $1, d; bad = 1 }
41+
}
42+
}
43+
END {
44+
if (ndef == 0) { print "no * catch-all rule with owners found"; exit 1 }
45+
exit bad
46+
}
47+
' .github/CODEOWNERS
48+
}

0 commit comments

Comments
 (0)