commit | 364152186c6258725b5e5ce2a93be55c2a911133 | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Fri Nov 20 11:01:39 2020 +0100 |
committer | Edwin Kempin <ekempin@google.com> | Fri Nov 20 11:31:49 2020 +0100 |
tree | 54b9b5e0613b3728b5691ab47048e830dcdc1fb4 | |
parent | b56e764ce200c2bd33ebdd1b557982148ab8b68e [diff] |
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
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