Summary
Add a flag that automatically discovers reviewers and approvers from the repository's OWNERS and OWNERS_ALIASES files (Prow/Kubernetes-style) and adds them to the reviewers whitelist. This avoids manually listing every reviewer in the systemd unit or CLI flags.
Problem
Currently, to respond to reviews from project maintainers, you must manually list every username in --reviewers:
--reviewers=coderabbitai[bot],nunnatsa,orenc1,awels,akalenyu,enxebre,csrwng,sjenning,muraee,bryan-cox,cblecker,jparrill,devguyio,sdminonne,clebs,Nirshal
This is fragile — when team membership changes, the flag must be updated manually. It also requires knowing the OWNERS file structure upfront.
Solution
Add a --reviewers-from-owners flag that reads the OWNERS and OWNERS_ALIASES files from the repo and automatically adds all listed reviewers and approvers to the whitelist.
New flag
| Flag |
Env var |
Default |
Description |
--reviewers-from-owners |
OOMPA_REVIEWERS_FROM_OWNERS |
false |
Auto-discover reviewers from OWNERS/OWNERS_ALIASES files |
Usage
# Auto-discover all reviewers/approvers from OWNERS files
oompa --repo openshift/hypershift --watch-prs 8365 \
--reviewers-from-owners \
--reviewers=coderabbitai[bot] # can still add extra reviewers (bots, etc.)
# The two lists are merged — OWNERS reviewers + explicit --reviewers
Implementation
- Add
ReviewersFromOwners bool to Config struct
- Add
--reviewers-from-owners flag in main.go
- After cloning the repo (in
EnsureRepoCloned), if the flag is set:
- Read
OWNERS file from the repo root (YAML format)
- Read
OWNERS_ALIASES file if it exists (resolves group names to usernames)
- Extract all
reviewers and approvers entries, resolving aliases
- Merge with any explicit
--reviewers list
- Support nested OWNERS files — for PRs that touch specific directories, also read OWNERS files from those directories (e.g.
test/e2e/OWNERS)
- Support the
filters format used by some projects (regex-based path matching with per-path reviewers/approvers)
OWNERS file formats to support
Standard format:
approvers:
- user1
- user2
reviewers:
- user3
- user4
With aliases:
approvers:
- team-approvers # resolved via OWNERS_ALIASES
reviewers:
- team-reviewers
OWNERS_ALIASES:
aliases:
team-approvers:
- user1
- user2
team-reviewers:
- user3
- user4
Filtered format (openshift/hypershift style):
filters:
".*":
approvers:
- core-approvers
reviewers:
- core-reviewers
".*kubevirt.*":
approvers:
- kubevirt-approvers
reviewers:
- kubevirt-reviewers
Open questions
- Should oompa only load reviewers matching the PR's changed files (path-filtered), or load all reviewers from the repo?
- Should OWNERS discovery happen once at startup or refresh periodically?
- Should there be a
--reviewers-from-owners-path to specify which OWNERS file to read (for repos with non-standard locations)?
Acceptance criteria
--reviewers-from-owners loads reviewers and approvers from OWNERS files
- OWNERS_ALIASES are resolved correctly
- Explicit
--reviewers are merged with OWNERS-discovered reviewers
- Bot reviewers (e.g.
coderabbitai[bot]) still work via explicit --reviewers
- Works with standard, aliased, and filtered OWNERS formats
- All existing tests pass
- New tests for OWNERS parsing
Summary
Add a flag that automatically discovers reviewers and approvers from the repository's
OWNERSandOWNERS_ALIASESfiles (Prow/Kubernetes-style) and adds them to the reviewers whitelist. This avoids manually listing every reviewer in the systemd unit or CLI flags.Problem
Currently, to respond to reviews from project maintainers, you must manually list every username in
--reviewers:This is fragile — when team membership changes, the flag must be updated manually. It also requires knowing the OWNERS file structure upfront.
Solution
Add a
--reviewers-from-ownersflag that reads theOWNERSandOWNERS_ALIASESfiles from the repo and automatically adds all listed reviewers and approvers to the whitelist.New flag
--reviewers-from-ownersOOMPA_REVIEWERS_FROM_OWNERSfalseUsage
Implementation
ReviewersFromOwners booltoConfigstruct--reviewers-from-ownersflag inmain.goEnsureRepoCloned), if the flag is set:OWNERSfile from the repo root (YAML format)OWNERS_ALIASESfile if it exists (resolves group names to usernames)reviewersandapproversentries, resolving aliases--reviewerslisttest/e2e/OWNERS)filtersformat used by some projects (regex-based path matching with per-path reviewers/approvers)OWNERS file formats to support
Standard format:
With aliases:
OWNERS_ALIASES:
Filtered format (openshift/hypershift style):
Open questions
--reviewers-from-owners-pathto specify which OWNERS file to read (for repos with non-standard locations)?Acceptance criteria
--reviewers-from-ownersloads reviewers and approvers from OWNERS files--reviewersare merged with OWNERS-discovered reviewerscoderabbitai[bot]) still work via explicit--reviewers