Overview
The OWNERS file system provides fine-grained control over code review assignments in your repository. OWNERS files define approvers (who can approve PRs) and reviewers (who review but don’t approve) for specific directories and the entire repository.OWNERS File Format
Root OWNERS File
Place anOWNERS file at the repository root to define default approvers and reviewers:
Repository Root: OWNERS
Directory-Specific OWNERS Files
Place OWNERS files in subdirectories to override repository-level settings:backend/OWNERS
frontend/OWNERS
Field Definitions
approvers
List of GitHub usernames who can approve pull requests for this directory or repository.
- Approvals count toward
minimum-lgtmrequirement - Automatically added as reviewers to PRs touching their files
- Can use
/approvecommand on PRs - Appears in PR comments as “Required Approvers”
reviewers
List of GitHub usernames who can review pull requests but cannot approve.
- Can provide feedback and request changes
- Can use
/lgtmcommand (“Looks Good To Me”) - Automatically assigned to PRs touching their files
- Appears in PR comments as “Reviewers”
- Reviews don’t count toward approval requirements
root-approvers
Whether root approvers are required for PRs affecting this directory.
true(default): Root approvers must approve in addition to directory approversfalse: Only directory approvers needed, root approvers not required- Allows component teams to approve changes independently
allowed-users
List of GitHub usernames with special permissions to run restricted commands.
- Can use
/add-allowed-usercommand to add users dynamically - Typically used for bot accounts and automation
- Separate from reviewers/approvers
Reviewer Assignment Logic
How Reviewers are Assigned
When a pull request is opened, theOwnersFileHandler (webhook_server/libs/handlers/owners_files_handler.py) automatically assigns reviewers:
Find Matching OWNERS Files
For each changed file, traverse up the directory tree to find the nearest OWNERS file:
Check root-approvers Requirement
If any OWNERS file has
root-approvers: true or doesn’t specify it, include root approvers:Assignment Example
- Changed Files
- OWNERS Files
- Assigned Reviewers
Approval Requirements
Configuration
Set minimum number of approvals required inconfig.yaml:
Approval Counting
Approvals are tracked through review labels:- Approver approval:
approved-<username>label (counts towardminimum-lgtm) - Reviewer LGTM:
lgtm-<username>label (informational, doesn’t count) - Changes requested:
changes-requested-<username>label (blocks merge)
Merge Eligibility Check
Thecan-be-merged check validates:
Advanced OWNERS Patterns
Component-Based Ownership
- 🎯 Targeted reviews - Only relevant teams notified
- ⚡ Faster approvals - Independent component approval
- 🔒 Critical path protection - Database changes require CTO approval
- 📚 Documentation ownership - Tech writers own docs independently
Matrix Organization
backend/OWNERS
backend/database/OWNERS
Open Source Project Pattern
OWNERS
Commands Related to OWNERS
Reviewer Assignment
- OWNERS files have been updated
- Initial assignment was incorrect
- Additional reviewers needed
Approval Commands
Allowed Users
Real-World Examples
Example 1: Microservices Repository
OWNERS (root)
services/auth/OWNERS
services/payment/OWNERS
infrastructure/OWNERS
services/auth/api.py and services/payment/billing.py:
- Required approvers:
- 1 from auth team (auth-team-lead OR senior-auth-engineer)
- 1 from payment team (payment-team-lead OR payment-security-lead)
- 1 from root (platform-architect OR tech-lead) - because payment has root-approvers: true
Example 2: Monorepo with Shared Libraries
OWNERS (root)
libs/shared/OWNERS
apps/web/OWNERS
apps/mobile/OWNERS
libs/shared/utils.ts and apps/web/App.tsx:
- Required approvers:
- 1 from platform team (for shared library)
- 1 from web team (for web app)
- 1 from root (cto OR vp-engineering) - because shared lib has root-approvers: true
Best Practices
Keep OWNERS Files Up to Date
Keep OWNERS Files Up to Date
- Review OWNERS files during onboarding/offboarding
- Update when team structure changes
- Archive inactive users
- Use team aliases where supported
Balance Autonomy and Oversight
Balance Autonomy and Oversight
- Use
root-approvers: falsefor independent teams - Use
root-approvers: truefor critical paths (security, payments, infrastructure) - Let component teams approve their own changes
- Require senior review for architectural changes
Document Ownership Clearly
Document Ownership Clearly
- Add comments to OWNERS files explaining why certain approvers are required
- Document escalation paths for urgent approvals
- Link to team wikis or documentation
Avoid Review Bottlenecks
Avoid Review Bottlenecks
- Have multiple approvers per component (redundancy)
- Don’t make root approvers required for everything
- Balance reviewer counts (3-5 per component)
- Consider time zones for global teams
Start Conservative, Relax Later
Start Conservative, Relax Later
- Begin with
root-approvers: truefor new components - Relax to
falseonce team proves ownership - Add reviewers before removing approvers
- Test changes in staging/dev branches first
Troubleshooting
No Reviewers Assigned
Problem: PR opened but no reviewers assigned Causes:- No OWNERS file in repository or parent directories
- OWNERS file has invalid YAML syntax
- Changed files outside any OWNERS coverage
Wrong Reviewers Assigned
Problem: Incorrect reviewers assigned to PR Solution:Too Many Approvals Required
Problem: PR blocked waiting for too many approvals Check configuration:Related Documentation
User Commands
/approve, /lgtm, /assign-reviewers commandsConfiguration
minimum-lgtm and approval settingsWebhook Events
How OWNERS files trigger on PR events
Architecture
OwnersFileHandler implementation details