diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-07-26 13:09:49 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2021-07-29 13:28:14 +0300 |
commit | 241290c104d58ebb88d01bc9704fd94d4e705ab2 (patch) | |
tree | 84079a8f44ff9e5378e5b0b8039312ffaa50fc4a /proto/ref.proto | |
parent | bf55b6fc1a0c9bba1e9d1af29cf4ccab168d30e0 (diff) |
gitaly: Sort the tags returned by FindAllTags RPC
The gitlab uses FindAllTags to fetch all tags and it requires
to do sorting in-memory after fetch. By this change we provide
ability to sort tags on the gitaly side by: tag name or creation
date in ascending or descending order.
The default remains the same as if no sorting requested - sort by
tag name, so it should not affect any existing clients.
Closes: https://gitlab.com/gitlab-org/gitaly/-/issues/3592
Changelog: added
Diffstat (limited to 'proto/ref.proto')
-rw-r--r-- | proto/ref.proto | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/proto/ref.proto b/proto/ref.proto index 122088302..0bc6d4d46 100644 --- a/proto/ref.proto +++ b/proto/ref.proto @@ -43,6 +43,7 @@ service RefService { op: ACCESSOR }; } + // Returns a stream of tags repository has. rpc FindAllTags(FindAllTagsRequest) returns (stream FindAllTagsResponse) { option (op_type) = { op: ACCESSOR @@ -235,6 +236,20 @@ message FindTagResponse { message FindAllTagsRequest { Repository repository = 1 [(target_repository)=true]; + // SortBy allows to specify desired order of the elements. + message SortBy { + // Key is a key used for sorting. + enum Key { + NAME = 0; + UPDATED = 1; + } + + Key key = 1; + SortDirection direction = 2; + } + + // SortBy allows to request tags in particular order. + SortBy sort_by = 2; } message FindAllTagsResponse { @@ -327,7 +342,7 @@ message ListTagNamesContainingCommitResponse { repeated bytes tag_names = 2; } -// GetTagSignaturesRequest is a request for the GetTagSignatures RPC. +// GetTagSignaturesRequest is a request for the GetTagSignatures RPC. message GetTagSignaturesRequest { // Repository is the repository in which tag signatures should be looked up. Repository repository = 1 [(target_repository)=true]; |