Support configuring multiple override approvals

With this change it is now possible to configure multiple approvals that
count as override for the code owners submit check. If multiple
approvals are configured, any of them is sufficient to override the code
owners submit check.

The configured override label is already returned to clients from the
Get Code Owner Branch Config REST endpoint and the Get Code Owner
Project Config REST endpoint, see the 'override_approval' field in the
respective response entity. Currently the 'override_approval' field
contains a RequiredApprovalInfo entity, but since we support multiple
override labels now we change this to a list of RequiredApprovalInfo
entities. This is an incompatible change that breaks the frontend. To
avoid a breakage the frontend was adapted in change I3677ab4d4 so that
it now understands the old and the new response format. We should submit
this only once that frontend change has been rolled out.

Duplicate override approvals are filtered out and are not returned to
the frontend. As duplicates we consider:

* exact identical override approvals (e.g. "Owners-Override+1" and
  "Owners-Override+1")
* override approvals with the same label name and a higher value (e.g.
  "Owners-Override+2" is not needed if "Owners-Override+1" is also set,
  since "Owners-Override+1" covers all "Owners-Override" approvals >= 1)

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I39e09c27ed4b52f60c460fe1ba1306e7073fe9fa
15 files changed
tree: d7dab500048b816fde38bbaf1ce548fce8d5bbe8
  1. java/
  2. javatests/
  3. proto/
  4. resources/
  5. test/
  6. ui/
  7. .eslintrc.json
  8. .gitignore
  9. .gitreview
  10. bower.json
  11. BUILD
  12. LICENSE
  13. package-lock.json
  14. package.json
  15. 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

IMPORTANT: Before installing/enabling the plugin follow the instructions from the setup guide, see resources/Documentation/setup-guide.md