Fix resolving exempted users to accounts in background threads

The code-owners submit rule can be executed in background threads where
a current user is not available (e.g. when a change is indexed).
AccountResolver needs the current user to check the account visibility
and fails if it is not available. Hence we must not use AccountResolver
to resolve exempted users.

Using AccountResolver for this was also a mistake due to other reasons:
* it checks account visibility, which we don't want to do
* it may access the account index, which we also don't want to do
* it searched over all account fields, but we are only interested in
  emails (the code handled this case, but it adds unnecessary
  complexity)

Fix all of this by using the Emails class, instead of AccountResolver,
to resolve exempted users.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I238d343a7c9b1a64b789f4f671707bb0227e52b8
2 files changed
tree: 63eb7c7f478566ca28efd44b56749df56252015e
  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.