docs/code-ownership.md
This document describes the code ownership (OWNERS) model for the AMP open source project. This model is used in the amphtml repository and may be used by other AMP repositories as well.
For more information on the overall code contribution process that the OWNERS model is a part of, see the Contributing code and features documentation.
The goals of enforcing AMP code ownership are as follows:
The Chromium open source project implements a code ownership model that we would like to use for AMP HTML.
GitHub's native solution uses a CODEOWNERS file in each directory to determine who owns the files within the directory. It has wildcard support to specify different owners for different files / file types, and glob support to specify owners for an entire directory tree.
Unfortunately, this solution is missing a key feature: OWNERS files are not
recursive. In other words, the owner of a directory is not automatically the
owner of its subdirectories.
AMP will use a custom open-source web service available on GitHub at google/github-owners-bot. This will be deployed on ampproject/amphtml as a bot, which will update the status of a pull request in response to the following events:
After each of these events, the pull request's status will be updated by the bot to indicate whether it has been approved by a sufficient number of owners.
An earlier version of this bot was limited by GitHub's API, which could only post comments to pull requests. This did not scale well at the time, and use of the bot was discontinued.
Today, GitHub supports a new status API that will be used by the bot to directly update the status of pull requests as described above. Stay tuned for the latest changes.
Any change in AMP requires the approval of at least one owner of the code the change modifies, but this is a subset of the required approvals before a change may be merged. See the code contribution process for more details.
OWNERS fileThe OWNERS file for each directory will typically list the creator(s) of
the component or extension it contains, along with those who are most familiar
with the directory contents. To be added to an OWNERS file create a PR and
go through the normal code contribution process.