commit | 32fb1097be1922dbb5158d7e3b2d8cfed1bdf423 | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Thu Feb 25 17:24:53 2021 +0100 |
committer | Edwin Kempin <ekempin@google.com> | Fri Feb 26 09:30:00 2021 +0100 |
tree | 42489e40b137beb6390376b78d94e33189cd3a4c | |
parent | 01a80cbbcba0431d3a0c511a05608fc0a9182ef8 [diff] |
CodeOwnerApprovalCheck: Avoid double instantiation of PathCodeOwners For every file touched in a change CodeOwnerApprovalCheck visits the relevant code owner config files to compute path code owners. This computation was done twice: 1. Once in CodeOwnerConfigHierarchy#visit which iterates over the relevant code owner config files for a path 2. Once in CodeOwnerResolver#resolvePathCodeOwners (invoked in CodeOwnerApprovalCheck#getCodeOwners which got called from the callback that is invoked from 1). Now instead of instantiating PathCodeOwners again at 2. modifiy the callback in 1. so that it provides the PathCodeOwners instance instead of the plain CodeOwnerConfig. There are other callers of 1. that only need the CodeOwnerConfig (and not the PathCodeOwners). For them we keep the old callback that provides CodeOwnerConfig, but now it's only a wrapper around the callback that provides PathCodeOwners. CodeOwnerResolver#resolvePathCodeOwners can be invoked either with a CodeOwnerConfig (as before, still used by other callers) or with PathCodeOwners (if PathCodeOwners are available this is preferred as it avoids re-instantiating PathCodeOwners). Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: Ic092c3dbb6b98cd9490893a05747a6fd48d17d57
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.