Remove sorting of owned paths to avoid that all owned paths are computed

Change Id33722dc0 added a limit to the stream that computes the owned
paths. However this limit has no real effect while the stream gets
sorted. This is because in order to sort all results have to be
available and hence be computed. Only afterwards the limit is applied.
This means the limit only reduces the number of returned owned path, but
doesn't prevent that all owned paths are computed.

To avoid the computation of all owned paths we remove the sorting on the
stream. Instead the sorting should happen before the stream computation
is done, which means we must sort the changed files which are the input
for this computation.

Fortunately these changed files are already sorted. So all we should do
is, document this fact in the ChangedFiles API and return an
ImmutableList instead of an ImmutableSet. Also we add tests to verify
that ChangedFiles returns sorted ChangeFile's.

The integration tests for owned paths already verify that they are
returned in a sorted order.

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