commit | 07747c9a297821c4f64700e09cf3d1755c9b757a | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Mon Jan 18 10:45:47 2021 +0100 |
committer | Edwin Kempin <ekempin@google.com> | Thu Jan 21 09:34:08 2021 +0100 |
tree | fa3efa4cae7134409196f9d6d8e3b4fe08a937b4 | |
parent | 07d6a76596a6c0ae4b62631a46ecc3bb3a6fbc45 [diff] |
When listing code owners for a path let callers know if all users own it Adds a ownedByAllUsers boolean field to CodeOwnersInfo which is returned by the get code owners REST endpoints (GetCodeOwnersForPathInChange and GetCodeOwnersForPathInBranch). This allows callers to know if a path is owned by all users. E.g. the Gerrit frontend should make this transparent to users when suggesting code owners. In order to know whether a path is owned by all users we need to continue inspecting code owner configs in parent folders even if we have already found enough code owners to satisfy the requested limit, as parent code owner configs may assign code ownership to all users, which we need to know in order to populate the ownedByAllUsers field in the response. We can still abort the iteration over code owner config files if we have already found that the path is owned by all users. Needing to check all relevant code owner config files if paths are not owned by all users means that the get code owners calls become a bit more expensive, but it shouldn't be significantly slower. If performance becomes an issue we need to implement caching for code owner configs. FWIW if we ever add further scores for code owners (besides the distance score), which we likely will do, we also need to iterate over all relevant code owner configs. So iterating over all code owner configs already now, shouldn't be an issue. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I8c564c959850ad21822bef0b1e58d23b7ac0ff24
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