Compute only as many owned paths as needed, not all

When a code owner approval is applied and when a code owner is added as
a reviewer we post a change message that lists the owned paths. To avoid
that the change messages get too large there is a configurable limit for
the maximum number of paths that should be shown in change messages. If
a user owns more paths the change message includes "(X more files)" to
let the user know about this. For being able to post this message we are
computing all paths of the change that are owned by the user.

Computing owned path is rather expensive and if a change touches many
files this increases the latency of the post review call. To improve the
latency we are now limiting the computation of the owned paths to the
number of paths that we are going to include into the change message, +1
to know if there are more owned files. This means that the change
message can no longer say how many more owned files there are, but
improving the latency seems more important than keeping this number
included. If there are more owned files we will now only say "(more
files)" to let the user know about this.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Id33722dc09144710758db5c84de4772656b9a4b5
6 files changed
tree: cbc9094f1843b1a56b8f8ac90c375cca45c34d47
  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.