GetOwnedPath: Limit the number of returned paths

Computing all owned paths can be expensive for large changes.

Often callers do not need all owned paths, hence it should be possible
to limit the result. E.g. the frontend may use this REST endpoint to
highlight files on the change screen that are owned by the current user,
but for large changes the frontend is not showing all files by default,
hence retrieving all owned files in this case would be wasteful.

To avoid unintended high latency when using this REST endpoint we limit
the results in the response by default to 50 and if callers want to get
more results they need to set a higher limit explicitly. This behaviour
is consistent with the get code owners REST endpoints with also have a
default limit.

We also add a start parameter that allows to skip owned files. This can
be used to paginate over the owned files.

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