Jeff Sharkey e2cc3f8bec Additional per-file OWNERS for shared directories.
Iteration based on areas of tree where detailed ownership was found
to be missing during routine code reviews.

Also add more detailed examples to OWNERS.md.

Bug: 174932174
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I46ccef33b34594181ae8dc62973d68020f827d6b
2020-12-10 08:37:23 -07:00

69 lines
2.6 KiB
Markdown

# Background
As general background, `OWNERS` files expedite code reviews by helping code
authors quickly find relevant reviewers, and they also ensure that stakeholders
are involved in code changes in their areas.
The structure of `frameworks/base/` is unique among Android repositories, and
it's evolved into a complex interleaved structure over the years. Because of
this structure, the best place to authoritatively define `OWNERS` can vary
wildly, but here are some common patterns:
* `core/java/` contains source that is included in the base classpath, and as
such it's where most APIs are defined:
* `core/java/android/app/`
* `core/java/android/content/`
* `services/core/` contains most system services, and these directories
typically have more granularity than `core/java/`, since they can be refactored
without API changes:
* `services/core/java/com/android/server/net/`
* `services/core/java/com/android/server/wm/`
* `services/` contains several system services that have been isolated from the
main `services/core/` project:
* `services/appwidget/`
* `services/midi/`
* `apex/` contains Mainline modules:
* `apex/jobscheduler/`
* `apex/permission/`
* Finally, some teams may have dedicated top-level directories:
* `media/`
* `wifi/`
# Design
Area maintainers are strongly encouraged to list people in a single
authoritative `OWNERS` file in **exactly one** location. Then, other paths
should reference that single authoritative `OWNERS` file using an include
directive. This approach ensures that updates are applied consistently across
the tree, reducing maintenance burden.
# Examples
The exact syntax of `OWNERS` files can be difficult to get correct, so here are
some common examples:
```
# Complete include of top-level owners from this repo
include /ZYGOTE_OWNERS
# Partial include of top-level owners from this repo
per-file ZygoteFile.java = file:/ZYGOTE_OWNERS
```
```
# Complete include of subdirectory owners from this repo
include /services/core/java/com/android/server/net/OWNERS
# Partial include of subdirectory owners from this repo
per-file NetworkFile.java = file:/services/core/java/com/android/server/net/OWNERS
```
```
# Complete include of top-level owners from another repo
include platform/libcore:/OWNERS
# Partial include of top-level owners from another repo
per-file LibcoreFile.java = file:platform/libcore:/OWNERS
```
```
# Complete include of subdirectory owners from another repo
include platform/frameworks/av:/camera/OWNERS
# Partial include of subdirectory owners from another repo
per-file CameraFile.java = file:platform/frameworks/av:/camera/OWNERS
```