Add parser for code owner configurations that use the find-owners syntax

One syntax for code owner configurations that we want to support is the
syntax that is used by the find-owners plugin [1].

For now we only support the simplest code owner configurations possible,
which means that a code owner configuration can only contain a set of
code owners.

In the find-owners syntax a set of code owners is represented as a list
of emails, one email per line. E.g.:

  a@example.com
  b@example.com
  c@example.com

Parsing this syntax is implemented in CodeOwnerConfigParser which is
defined in the new 'c.g.g.plugins.codeowners.backend.findowners'
package. This package will contain all classes of the find-owners code
owner backend.

For now invalid lines (lines that are not emails) are silently ignored
during the parsing so that owner configuration files that use syntax
elements that are not supported yet can be parsed. Later we will likely
change this so that invalid lines make the parsing fail.

The validations of the email is very basic for now and will be improved
in follow-up changes (see TODOs in CodeOwnerConfigParser and
CodeOwnerConfigParserTest).

The result of the parsing is a CodeOwnerConfig, which is the code owner
backend independent representation of a code owner configuration.

To make assertions of CodeOwnerConfigs easy we add a dedicated truth
subject for it (CodeOwnerConfigSubject) that knows how to extract the
code owner emails from a CodeOwnerConfig.

[1] https://gerrit.googlesource.com/plugins/find-owners/+/master/src/main/resources/Documentation/syntax.md

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Ie8200cf15fea88efbbc62772725b84a24269c897
8 files changed
tree: 58d7346100de8ea19735716620fc4017e1c24b11
  1. java/
  2. javatests/
  3. resources/
  4. .gitreview
  5. BUILD
  6. LICENSE
  7. 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