Add parser for reading/writing proto code owner configurations
Going forward we want to use a proto syntax for storing code owner
configs, as this syntax is easier to extend, read and maintain as the
custom syntax that is used by the find-owners plugin. This change starts
adding a code owners backend that supports the proto syntax. With this
change only a parser for reading/writing proto code owner configurations
is added, other parts of the proto code owners backend will be added by
follow-up changes.
In contrast to the find-owners backend, the proto backend stores code
owner configs in OWNER_METADATA files (not OWNERS files).
The proto syntax that is added by this change only covers the minimum of
messages/fields that are necessary for defining a set of code owners for
a folder in a branch. The final proto syntax is not fully defined yet,
which means that the proto will still be changed. These changes will be
incompatible changes, which means the proto syntax should not be used in
any productive setups yet.
To avoid code duplication between code owner backends we define a
common interface for code owner config parsers that each backend can
implement for its syntax. The behaviour of the code owner config parsers
is mostly the same across backends. To avoid writing tests for the
common behaviour multiple times, we add an abstract base class for the
code owner config parser tests that covers the common logic.
Differences in behaviour exist in regards to handling of invalid lines,
invalid emails and inline comments (the proto backend fails parsing on
invalid lines, but accepts invalid emails and inline comments, the
find-owners backend ignores invalid lines, invalid emails and lines with
inline comments). These differences are OK for now and may be addressed
later (e.g. when we start implementing consistency checks). For now
(this change + follow-up changes) we are only interested in adding a
minimal working backend for the proto syntax.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I6ed55133832fc12b29b95c53141ba2b2f41e5a63
15 files changed
tree: bfb0c6d76d23aa1af8e2c2bd51ec65c22cce3d13
- java/
- javatests/
- proto/
- resources/
- .gitreview
- BUILD
- LICENSE
- README.md
README.md
Gerrit Code Review code-owners plugin
This plugin provides support for defining code owners for files in a repository.
If the code-owners plugin is enabled, changes can only be submitted if all touched files are covered by approvals from code owners.
Also see resources/Documentation/about.md