commit | 55190aefb0c4368b634548844f54c9d0c5462782 | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Wed Jun 23 09:42:28 2021 +0200 |
committer | Edwin Kempin <ekempin@google.com> | Tue Jun 29 16:37:56 2021 +0200 |
tree | 08ca5352dba6c17654cb631e07ddfd71f801b25e | |
parent | 044d8cb5c0d0568effc9749db3e9a2a7c7d313e1 [diff] |
Drop possibility to pass in RevWalk into CodeOwnerBackend and ChangedFiles Earlier it was required to be able to pass in a RevWalk instance into CodeOwnerBackend and ChangedFiles, because commits that were newly created in the CreateChange REST endpoint where only visible through the specific RevWalk instance that was used when creating the commit. Any newly created RevWalk instance was not seeing the commit and any attempt to look it up failed with a MissingObjectException. However since change Ie8d447b79 Gerrit core always flushes the object readers when inserting new commits, so that using a specific RevWalk instance to look up newly created commits is no longer needed. Hence we can stop passing in the RevWalk instance into CodeOwnerBackend and ChangedFiles and just create a new RevWalk instance where needed. This makes a lot of method signature much cleaner. In addition, this will also enable us to use the new diff cache (aka DiffOperations) in all places. So far we couldn't use the new diff cache during the commit validation as the new diff cache didn't allow us to pass in the RevWalk instance, but now this is no longer needed. CodeOwnersPluginConfigValidatorTest.failsOnInvalidProjectConfig had to be adapted because it accidentally created the commit to be validated in the local repository, rather than in the server-side repository. Due to this a newly created server-side RevWalk instance, as we use it now, couldn't see that commit. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I489c26ac3889066ad61d88411ad0b3f89e73d98f
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.