commit | 0a99349e432a4df0eb509bad04c9e0fa0ef8063d | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Mon Aug 21 12:39:16 2023 +0000 |
committer | Edwin Kempin <ekempin@google.com> | Mon Aug 21 13:09:46 2023 +0000 |
tree | a509a1d3ad48287fac2cdad50282c6bf110c12f6 | |
parent | 38e76eff7bc0c83ae0a7b621c9c663a7e31087b7 [diff] |
plugins.py: Set an explicit limit to avoid the index default limit plugins.py lists projects via the List Projects REST endpoint [1] without paginating over the results. For Gerrit servers at Google we are replacing the implementation of the List Projects REST endpoint with a wrapper that forwards requests to Query Projects [2]. When we do this query limits will be applied (1. the max limit that is permitted for the calling user [3], 2. the index default limit that was added by [4]). The index default limit will be set to 100 for us. This means requests that do not specify an explicit limit will received only 100 results by default. For plugins.py this means it will only get the first 100 plugin projects. Since there are ~150 plugin projects it would miss some results. To prevent this set 500 as an explicit limit. If an explicit limit is set the index default limit (100) is not applied, but only the maximum allows limit is applied (500 by default). This means by setting limit=500 we should get 500 results which is good enough for now, but this will break when the number of plugin projects grows beyond 500. Fixing this is tracked by Issue 296837507. [1] https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#list-projects [2] https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#query-projects [3] https://gerrit-review.googlesource.com/Documentation/access-control.html#capability_queryLimit [4] https://gerrit-review.googlesource.com/c/gerrit/+/380955 Change-Id: Icba2de15479478dead8043fbabab1e139fda8e55 Signed-off-by: Edwin Kempin <ekempin@google.com> Bug: Issue 296837507
Homepage for Gerrit Code Review.
Instructions how to publish the Gerrit documentation can be found at: https://www.gerritcodereview.com/publishing.html