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
14 files changed
tree: 08ca5352dba6c17654cb631e07ddfd71f801b25e
  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.