Repository navigation
Description
Is your feature request related to a problem? Please describe.
Repositories with multiple directory-scoped OWNERS files often share the same groups of reviewers and approvers across directories. Right now OWNERS_ALIASES is not read (docs/prow-for-your-org.md), leaving two options:
- Duplicate individual GitHub handles across every
OWNERSfile. - Use
@org/teamgroups (Add support for GitHub Groups to the Approve plugin #485 / feat(owners): support GitHub groups in OWNERS #486), which requires managing membership in GitHub's org UI (outside PR review / git history) and supplying a custom token with org-level Members: read (read:org) instead of the defaultGITHUB_TOKEN.
Supporting Kubernetes-style OWNERS_ALIASES gives repositories git-reviewed, reusable owner groups that work out of the box with GITHUB_TOKEN (contents: read).
Describe the solution you'd like
Read an optional OWNERS_ALIASES file at the repository root in standard Kubernetes Prow YAML format:
aliases:
sig-api-approvers:
- alice
- bob
sig-api-reviewers:
- carolWhen an OWNERS file lists an alias name under approvers or reviewers, expand it to its member logins everywhere OWNERS are evaluated:
- Pull request ownership (
loadPullRequestOwners/loadOwnersTree+probeOwnerswhen truncated): readOWNERS_ALIASESfrom the same base-branch tip commit (baseSha) asOWNERSso a PR cannot modify its own aliases, memoized per ref inRunState. This automatically covers/approve,/lgtm,trigger(/retest,/test,/ok-to-test), theapproveplugin ([APPROVALNOTIFIER]+suggestApprovers+approve.github_review), andblunderbuss. - Issue / root-OWNERS authorization (
src/utils/auth.ts:assertRootOwnerandrootOwnersIncludesforauthorization: trusted): readOWNERS_ALIASESfrom the default branch (memoized inRunState) and expand inownersIncludeafter the direct-listing fast path. - Keep
branchHasOwners/repoHasOwnersmatchingOWNERSfiles only so a repo with onlyOWNERS_ALIASESdoes not enable OWNERS mode. - Case-insensitive matching on both alias names and member logins, matching
parseOwnersand Prow. - Zero extra API calls when
OWNERS_ALIASESis absent from a non-truncated git tree (one memoized blob fetch when present).
Design questions to align on before opening a PR
- Malformed
OWNERS_ALIASES: Should invalid YAML or a non-string-list alias entry fail closed (throw, matchingparseOwnersinsrc/utils/owners.ts), or warn and treat as empty (matching upstream Prow'sloadAliasesFrom)? And should an empty/whitespace-only file oralias:(null) be treated as empty ([]), matchingparseOwners? - Nested aliases: Should expansion be single-level (matching upstream Prow's
RepoAliases.ExpandAliases) or recursive with cycle detection? - Alias / username collision: Match upstream Prow's replacement semantics (if an entry matches an alias key, replace it with the alias's members rather than keeping the alias key as a literal login)?
- Interaction with
@org/team: Expand aliases beforeexpandGroupsso an alias can reference@org/teamentries, or keep aliases to plain logins only?
Describe alternatives you've considered
@org/teaminOWNERS(feat(owners): support GitHub groups in OWNERS #486): Great for org-wide teams, but requires a PAT/App token with org Members: read and keeps membership changes outside git review.- Generating
OWNERSfromOWNERS.in+OWNERS_ALIASESvia a repo script in CI: Works as a temporary workaround, but adds generator scripts and boilerplate diff noise to every adopting repository.
Additional context
Happy to open a PR with the implementation, unit tests, dist/index.js bundle e2e tests, and doc updates (docs/prow-for-your-org.md, docs/commands.md, and __tests__/docsYamlExamples.test.ts) once the edge cases above are agreed on.
Activity
moficodes commentedon Nov 26, 2026
/kind feature
moficodes commentedon Nov 26, 2026
@thockin FYI.
moficodes commentedon Nov 26, 2026
/assign mrbobbytables