diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2020-06-03 20:01:11 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2020-06-19 15:55:02 +0300 |
commit | 7ed81f1389da5dc41c2cad0508ea335863425852 (patch) | |
tree | 2f16535bc4db73f6af7d6ae7ce866fb61cb30440 /proto/ref.proto | |
parent | e3b1d6e5d2379977de477a2614f960d4f19e6dea (diff) |
Allow pagination for FindAllLocalBranches
Pagination has always been ad hoc within Gitaly, and there was no
convergence to a standard. This change creates a structure around this,
which an implementation for one RPC to try it.
The structure uses a page token, as proposed in:
https://gitlab.com/gitlab-org/gitaly/-/issues/2704#note_349733942.
This allows a generic field to hold what's usually a numeric `offset`
field. Where `offset` can be unstable over a series of requests due to
race conditions, the page token could prevent that.
The change does alter the implementation for `lines.Send()` a little,
which create a situation where for other RPCs there's been slight
normalization on their input to `lines.Send()` to make this change
backward as well as forward compatible.
Helps with: https://gitlab.com/gitlab-org/gitlab-foss/-/issues/48097#note_354316835
Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/2704
Diffstat (limited to 'proto/ref.proto')
-rw-r--r-- | proto/ref.proto | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/proto/ref.proto b/proto/ref.proto index 8e99267fa..1943b83c4 100644 --- a/proto/ref.proto +++ b/proto/ref.proto @@ -167,6 +167,11 @@ message FindLocalBranchesRequest { UPDATED_DESC = 2; } SortBy sort_by = 2; + // The page token is the branch name, with the `refs/heads/` prefix, for + // example "refs/heads/master". After the first branch name is encountered + // which lexicographically exceeds the page token, it will be the first result + // send as part of the response. + PaginationParameter pagination_params = 3; } message FindLocalBranchesResponse { |