AbstractGetCodeOwnersForPath: Replace suggest flag with overridable method

Instead of having a boolean suggest flag that is true for
GetCodeOwnersForPathInChange and false for GetCodeOwnersForPathInBranch
add a filterCodeOwners that can be overridden by the subclasses to
filter out additional results. Use this method in
GetCodeOwnersForPathInChange to filter out the service users that should
not show up in the code owner suggestion. Since the methods to detect
and filter out service users are only needed in
GetCodeOwnersForPathInChange they are moved into this class.

The new filterCodeOwners method has a parameter to provide the resource
on which the request is being performed. For this parameter we want to
use the resource type that is used by the subclass. To make this
possible we add a generic type for the resource to
AbstractGetCodeOwnersForPath.

Since we are already touching the filterOutServiceUsers method, add some
comments to explain the return values to avoid misreading them.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Ia7bbf579e808af4f3d615aa6edce1b24006c4afe
3 files changed
tree: 54b9b5e0613b3728b5691ab47048e830dcdc1fb4
  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