[API] Add after Support to Commit Listing (#155)

This commit is contained in:
Johannes Batzill 2023-01-04 16:59:43 -08:00 committed by GitHub
parent 1f1118f624
commit 7ada1af3aa
25 changed files with 346 additions and 429 deletions

View File

@ -83,29 +83,57 @@ func giteaParsePrettyFormatLogToList(giteaRepo *gitea.Repository, logs []byte) (
}
// ListCommits lists the commits reachable from ref.
// Note: ref can be Branch / Tag / CommitSHA.
// Note: ref & afterRef can be Branch / Tag / CommitSHA.
// Note: commits returned are [ref->...->afterRef).
func (g Adapter) ListCommits(ctx context.Context, repoPath string,
ref string, page int, pageSize int) ([]types.Commit, int64, error) {
ref string, afterRef string, page int, limit int) ([]types.Commit, error) {
giteaRepo, err := gitea.OpenRepository(ctx, repoPath)
if err != nil {
return nil, 0, err
return nil, err
}
defer giteaRepo.Close()
// Get the giteaTopCommit object for the ref
giteaTopCommit, err := giteaRepo.GetCommit(ref)
// Get the refCommitSHA object for the ref
refCommitSHA, err := giteaRepo.GetRefCommitID(ref)
if err != nil {
return nil, 0, processGiteaErrorf(err, "error getting commit top commit for ref '%s'", ref)
return nil, processGiteaErrorf(err, "error getting commit ID for ref '%s'", ref)
}
giteaCommits, err := giteaTopCommit.CommitsByRange(page, pageSize)
if err != nil {
return nil, 0, processGiteaErrorf(err, "error getting commits")
args := []string{"rev-list"}
// add pagination if requested
// TODO: we should add absolut limits to protect gitrpc (return error)
if limit > 0 {
args = append(args, "--max-count", fmt.Sprint(limit))
if page > 1 {
args = append(args, "--skip", fmt.Sprint((page-1)*limit))
}
}
totalCount, err := giteaTopCommit.CommitsCount()
// add refCommitSHA as starting point
args = append(args, refCommitSHA)
// return commits only up to a certain reference if requested
if afterRef != "" {
var afterRefCommitSHA string
afterRefCommitSHA, err = giteaRepo.GetRefCommitID(afterRef)
if err != nil {
return nil, processGiteaErrorf(err, "error getting commit ID for afterRef '%s'", afterRef)
}
// ^SHA tells the rev-list command to return only commits that aren't reachable by SHA
args = append(args, fmt.Sprintf("^%s", afterRefCommitSHA))
}
stdout, _, runErr := gitea.NewCommand(giteaRepo.Ctx, args...).RunStdBytes(&gitea.RunOpts{Dir: giteaRepo.Path})
if runErr != nil {
// TODO: handle error in case they don't have a common merge base!
return nil, fmt.Errorf("failed to trigger rev-list command: %w", runErr)
}
giteaCommits, err := giteaParsePrettyFormatLogToList(giteaRepo, bytes.TrimSpace(stdout))
if err != nil {
return nil, 0, processGiteaErrorf(err, "error getting total commit count")
return nil, err
}
commits := make([]types.Commit, len(giteaCommits))
@ -113,13 +141,12 @@ func (g Adapter) ListCommits(ctx context.Context, repoPath string,
var commit *types.Commit
commit, err = mapGiteaCommit(giteaCommits[i])
if err != nil {
return nil, 0, err
return nil, err
}
commits[i] = *commit
}
// TODO: save to cast to int from int64, or we expect exceeding int.MaxValue?
return commits, totalCount, nil
return commits, nil
}
// GetCommit returns the (latest) commit for a specific ref.

View File

@ -20,25 +20,13 @@ func (s RepositoryService) ListCommits(request *rpc.ListCommitsRequest,
repoPath := getFullPathForRepo(s.reposRoot, request.GetRepoUid())
ctx := stream.Context()
gitCommits, totalCount, err := s.adapter.ListCommits(ctx, repoPath, request.GetGitRef(),
int(request.GetPage()), int(request.GetPageSize()))
gitCommits, err := s.adapter.ListCommits(ctx, repoPath, request.GetGitRef(),
request.GetAfter(), int(request.GetPage()), int(request.GetLimit()))
if err != nil {
return processGitErrorf(err, "failed to get list of commits")
}
log.Ctx(ctx).Trace().Msgf("git adapter returned %d commits (total: %d)", len(gitCommits), totalCount)
// send info about total number of commits first
err = stream.Send(&rpc.ListCommitsResponse{
Data: &rpc.ListCommitsResponse_Header{
Header: &rpc.ListCommitsResponseHeader{
TotalCount: totalCount,
},
},
})
if err != nil {
return status.Errorf(codes.Internal, "failed to send response header: %v", err)
}
log.Ctx(ctx).Trace().Msgf("git adapter returned %d commits", len(gitCommits))
for i := range gitCommits {
var commit *rpc.Commit
@ -48,9 +36,7 @@ func (s RepositoryService) ListCommits(request *rpc.ListCommitsRequest,
}
err = stream.Send(&rpc.ListCommitsResponse{
Data: &rpc.ListCommitsResponse_Commit{
Commit: commit,
},
Commit: commit,
})
if err != nil {
return status.Errorf(codes.Internal, "failed to send commit: %v", err)

View File

@ -27,8 +27,8 @@ type GitAdapter interface {
opts *types.WalkReferencesOptions) error
GetCommit(ctx context.Context, repoPath string, ref string) (*types.Commit, error)
GetCommits(ctx context.Context, repoPath string, refs []string) ([]types.Commit, error)
ListCommits(ctx context.Context, repoPath string, ref string, page int,
pageSize int) ([]types.Commit, int64, error)
ListCommits(ctx context.Context, repoPath string,
ref string, afterRef string, page int, limit int) ([]types.Commit, error)
GetLatestCommit(ctx context.Context, repoPath string, ref string, treePath string) (*types.Commit, error)
GetAnnotatedTag(ctx context.Context, repoPath string, sha string) (*types.Tag, error)
GetAnnotatedTags(ctx context.Context, repoPath string, shas []string) ([]types.Tag, error)

View File

@ -22,14 +22,16 @@ type ListCommitsParams struct {
// RepoUID is the uid of the git repository
RepoUID string
// GitREF is a git reference (branch / tag / commit SHA)
GitREF string
Page int32
PageSize int32
GitREF string
// After is a git reference (branch / tag / commit SHA)
// If provided, commits only up to that reference will be returned (exlusive)
After string
Page int32
Limit int32
}
type ListCommitsOutput struct {
TotalCount int64
Commits []Commit
Commits []Commit
}
type Commit struct {
@ -55,28 +57,18 @@ func (c *Client) ListCommits(ctx context.Context, params *ListCommitsParams) (*L
return nil, ErrNoParamsProvided
}
stream, err := c.repoService.ListCommits(ctx, &rpc.ListCommitsRequest{
RepoUid: params.RepoUID,
GitRef: params.GitREF,
Page: params.Page,
PageSize: params.PageSize,
RepoUid: params.RepoUID,
GitRef: params.GitREF,
After: params.After,
Page: params.Page,
Limit: params.Limit,
})
if err != nil {
return nil, fmt.Errorf("failed to start stream for commits: %w", err)
}
// get header first
header, err := stream.Recv()
if err != nil {
return nil, processRPCErrorf(err, "error occured while receiving header")
}
if header.GetHeader() == nil {
return nil, fmt.Errorf("header missing")
}
// NOTE: don't use PageSize as initial slice capacity - as that theoretically could be MaxInt
output := &ListCommitsOutput{
TotalCount: header.GetHeader().TotalCount,
Commits: make([]Commit, 0, 16),
Commits: make([]Commit, 0, 16),
}
for {

View File

@ -80,20 +80,15 @@ enum TreeNodeMode {
message ListCommitsRequest {
string repo_uid = 1;
string git_ref = 2;
int32 page = 3;
int32 pageSize = 4;
string after = 3;
int32 page = 4;
int32 limit = 5;
}
message ListCommitsResponse {
oneof data {
ListCommitsResponseHeader header = 1;
Commit commit = 2;
}
Commit commit = 1;
}
message ListCommitsResponseHeader {
int64 total_count = 1;
}
message GetBlobRequest {
string repo_uid = 1;

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.9
// protoc v3.21.11
// source: diff.proto
package rpc

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.9
// - protoc v3.21.11
// source: diff.proto
package rpc

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.9
// protoc v3.21.11
// source: http.proto
package rpc

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.9
// - protoc v3.21.11
// source: http.proto
package rpc

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.9
// protoc v3.21.11
// source: operations.proto
package rpc
@ -248,7 +248,6 @@ type CommitFilesAction struct {
unknownFields protoimpl.UnknownFields
// Types that are assignable to Payload:
//
// *CommitFilesAction_Header
// *CommitFilesAction_Content
Payload isCommitFilesAction_Payload `protobuf_oneof:"payload"`
@ -332,7 +331,6 @@ type CommitFilesRequest struct {
unknownFields protoimpl.UnknownFields
// Types that are assignable to Payload:
//
// *CommitFilesRequest_Header
// *CommitFilesRequest_Action
Payload isCommitFilesRequest_Payload `protobuf_oneof:"payload"`

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.9
// - protoc v3.21.11
// source: operations.proto
package rpc

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.9
// protoc v3.21.11
// source: ref.proto
package rpc

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.9
// - protoc v3.21.11
// source: ref.proto
package rpc

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.9
// protoc v3.21.11
// source: repo.proto
package rpc
@ -130,7 +130,6 @@ type CreateRepositoryRequest struct {
unknownFields protoimpl.UnknownFields
// Types that are assignable to Data:
//
// *CreateRepositoryRequest_Header
// *CreateRepositoryRequest_File
Data isCreateRepositoryRequest_Data `protobuf_oneof:"data"`
@ -642,10 +641,11 @@ type ListCommitsRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
GitRef string `protobuf:"bytes,2,opt,name=git_ref,json=gitRef,proto3" json:"git_ref,omitempty"`
Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
PageSize int32 `protobuf:"varint,4,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
RepoUid string `protobuf:"bytes,1,opt,name=repo_uid,json=repoUid,proto3" json:"repo_uid,omitempty"`
GitRef string `protobuf:"bytes,2,opt,name=git_ref,json=gitRef,proto3" json:"git_ref,omitempty"`
After string `protobuf:"bytes,3,opt,name=after,proto3" json:"after,omitempty"`
Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"`
Limit int32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
}
func (x *ListCommitsRequest) Reset() {
@ -694,6 +694,13 @@ func (x *ListCommitsRequest) GetGitRef() string {
return ""
}
func (x *ListCommitsRequest) GetAfter() string {
if x != nil {
return x.After
}
return ""
}
func (x *ListCommitsRequest) GetPage() int32 {
if x != nil {
return x.Page
@ -701,9 +708,9 @@ func (x *ListCommitsRequest) GetPage() int32 {
return 0
}
func (x *ListCommitsRequest) GetPageSize() int32 {
func (x *ListCommitsRequest) GetLimit() int32 {
if x != nil {
return x.PageSize
return x.Limit
}
return 0
}
@ -713,11 +720,7 @@ type ListCommitsResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Types that are assignable to Data:
//
// *ListCommitsResponse_Header
// *ListCommitsResponse_Commit
Data isListCommitsResponse_Data `protobuf_oneof:"data"`
Commit *Commit `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"`
}
func (x *ListCommitsResponse) Reset() {
@ -752,90 +755,13 @@ func (*ListCommitsResponse) Descriptor() ([]byte, []int) {
return file_repo_proto_rawDescGZIP(), []int{9}
}
func (m *ListCommitsResponse) GetData() isListCommitsResponse_Data {
if m != nil {
return m.Data
}
return nil
}
func (x *ListCommitsResponse) GetHeader() *ListCommitsResponseHeader {
if x, ok := x.GetData().(*ListCommitsResponse_Header); ok {
return x.Header
}
return nil
}
func (x *ListCommitsResponse) GetCommit() *Commit {
if x, ok := x.GetData().(*ListCommitsResponse_Commit); ok {
if x != nil {
return x.Commit
}
return nil
}
type isListCommitsResponse_Data interface {
isListCommitsResponse_Data()
}
type ListCommitsResponse_Header struct {
Header *ListCommitsResponseHeader `protobuf:"bytes,1,opt,name=header,proto3,oneof"`
}
type ListCommitsResponse_Commit struct {
Commit *Commit `protobuf:"bytes,2,opt,name=commit,proto3,oneof"`
}
func (*ListCommitsResponse_Header) isListCommitsResponse_Data() {}
func (*ListCommitsResponse_Commit) isListCommitsResponse_Data() {}
type ListCommitsResponseHeader struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TotalCount int64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
}
func (x *ListCommitsResponseHeader) Reset() {
*x = ListCommitsResponseHeader{}
if protoimpl.UnsafeEnabled {
mi := &file_repo_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListCommitsResponseHeader) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListCommitsResponseHeader) ProtoMessage() {}
func (x *ListCommitsResponseHeader) ProtoReflect() protoreflect.Message {
mi := &file_repo_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListCommitsResponseHeader.ProtoReflect.Descriptor instead.
func (*ListCommitsResponseHeader) Descriptor() ([]byte, []int) {
return file_repo_proto_rawDescGZIP(), []int{10}
}
func (x *ListCommitsResponseHeader) GetTotalCount() int64 {
if x != nil {
return x.TotalCount
}
return 0
}
type GetBlobRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -849,7 +775,7 @@ type GetBlobRequest struct {
func (x *GetBlobRequest) Reset() {
*x = GetBlobRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_repo_proto_msgTypes[11]
mi := &file_repo_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -862,7 +788,7 @@ func (x *GetBlobRequest) String() string {
func (*GetBlobRequest) ProtoMessage() {}
func (x *GetBlobRequest) ProtoReflect() protoreflect.Message {
mi := &file_repo_proto_msgTypes[11]
mi := &file_repo_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -875,7 +801,7 @@ func (x *GetBlobRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetBlobRequest.ProtoReflect.Descriptor instead.
func (*GetBlobRequest) Descriptor() ([]byte, []int) {
return file_repo_proto_rawDescGZIP(), []int{11}
return file_repo_proto_rawDescGZIP(), []int{10}
}
func (x *GetBlobRequest) GetRepoUid() string {
@ -910,7 +836,7 @@ type GetBlobResponse struct {
func (x *GetBlobResponse) Reset() {
*x = GetBlobResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_repo_proto_msgTypes[12]
mi := &file_repo_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -923,7 +849,7 @@ func (x *GetBlobResponse) String() string {
func (*GetBlobResponse) ProtoMessage() {}
func (x *GetBlobResponse) ProtoReflect() protoreflect.Message {
mi := &file_repo_proto_msgTypes[12]
mi := &file_repo_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -936,7 +862,7 @@ func (x *GetBlobResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetBlobResponse.ProtoReflect.Descriptor instead.
func (*GetBlobResponse) Descriptor() ([]byte, []int) {
return file_repo_proto_rawDescGZIP(), []int{12}
return file_repo_proto_rawDescGZIP(), []int{11}
}
func (x *GetBlobResponse) GetBlob() *Blob {
@ -959,7 +885,7 @@ type Blob struct {
func (x *Blob) Reset() {
*x = Blob{}
if protoimpl.UnsafeEnabled {
mi := &file_repo_proto_msgTypes[13]
mi := &file_repo_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -972,7 +898,7 @@ func (x *Blob) String() string {
func (*Blob) ProtoMessage() {}
func (x *Blob) ProtoReflect() protoreflect.Message {
mi := &file_repo_proto_msgTypes[13]
mi := &file_repo_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -985,7 +911,7 @@ func (x *Blob) ProtoReflect() protoreflect.Message {
// Deprecated: Use Blob.ProtoReflect.Descriptor instead.
func (*Blob) Descriptor() ([]byte, []int) {
return file_repo_proto_rawDescGZIP(), []int{13}
return file_repo_proto_rawDescGZIP(), []int{12}
}
func (x *Blob) GetSha() string {
@ -1022,7 +948,7 @@ type GetSubmoduleRequest struct {
func (x *GetSubmoduleRequest) Reset() {
*x = GetSubmoduleRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_repo_proto_msgTypes[14]
mi := &file_repo_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1035,7 +961,7 @@ func (x *GetSubmoduleRequest) String() string {
func (*GetSubmoduleRequest) ProtoMessage() {}
func (x *GetSubmoduleRequest) ProtoReflect() protoreflect.Message {
mi := &file_repo_proto_msgTypes[14]
mi := &file_repo_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1048,7 +974,7 @@ func (x *GetSubmoduleRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetSubmoduleRequest.ProtoReflect.Descriptor instead.
func (*GetSubmoduleRequest) Descriptor() ([]byte, []int) {
return file_repo_proto_rawDescGZIP(), []int{14}
return file_repo_proto_rawDescGZIP(), []int{13}
}
func (x *GetSubmoduleRequest) GetRepoUid() string {
@ -1083,7 +1009,7 @@ type GetSubmoduleResponse struct {
func (x *GetSubmoduleResponse) Reset() {
*x = GetSubmoduleResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_repo_proto_msgTypes[15]
mi := &file_repo_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1096,7 +1022,7 @@ func (x *GetSubmoduleResponse) String() string {
func (*GetSubmoduleResponse) ProtoMessage() {}
func (x *GetSubmoduleResponse) ProtoReflect() protoreflect.Message {
mi := &file_repo_proto_msgTypes[15]
mi := &file_repo_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1109,7 +1035,7 @@ func (x *GetSubmoduleResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetSubmoduleResponse.ProtoReflect.Descriptor instead.
func (*GetSubmoduleResponse) Descriptor() ([]byte, []int) {
return file_repo_proto_rawDescGZIP(), []int{15}
return file_repo_proto_rawDescGZIP(), []int{14}
}
func (x *GetSubmoduleResponse) GetSubmodule() *Submodule {
@ -1131,7 +1057,7 @@ type Submodule struct {
func (x *Submodule) Reset() {
*x = Submodule{}
if protoimpl.UnsafeEnabled {
mi := &file_repo_proto_msgTypes[16]
mi := &file_repo_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1144,7 +1070,7 @@ func (x *Submodule) String() string {
func (*Submodule) ProtoMessage() {}
func (x *Submodule) ProtoReflect() protoreflect.Message {
mi := &file_repo_proto_msgTypes[16]
mi := &file_repo_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1157,7 +1083,7 @@ func (x *Submodule) ProtoReflect() protoreflect.Message {
// Deprecated: Use Submodule.ProtoReflect.Descriptor instead.
func (*Submodule) Descriptor() ([]byte, []int) {
return file_repo_proto_rawDescGZIP(), []int{16}
return file_repo_proto_rawDescGZIP(), []int{15}
}
func (x *Submodule) GetName() string {
@ -1187,7 +1113,7 @@ type GetCommitDivergencesRequest struct {
func (x *GetCommitDivergencesRequest) Reset() {
*x = GetCommitDivergencesRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_repo_proto_msgTypes[17]
mi := &file_repo_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1200,7 +1126,7 @@ func (x *GetCommitDivergencesRequest) String() string {
func (*GetCommitDivergencesRequest) ProtoMessage() {}
func (x *GetCommitDivergencesRequest) ProtoReflect() protoreflect.Message {
mi := &file_repo_proto_msgTypes[17]
mi := &file_repo_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1213,7 +1139,7 @@ func (x *GetCommitDivergencesRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetCommitDivergencesRequest.ProtoReflect.Descriptor instead.
func (*GetCommitDivergencesRequest) Descriptor() ([]byte, []int) {
return file_repo_proto_rawDescGZIP(), []int{17}
return file_repo_proto_rawDescGZIP(), []int{16}
}
func (x *GetCommitDivergencesRequest) GetRepoUid() string {
@ -1249,7 +1175,7 @@ type CommitDivergenceRequest struct {
func (x *CommitDivergenceRequest) Reset() {
*x = CommitDivergenceRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_repo_proto_msgTypes[18]
mi := &file_repo_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1262,7 +1188,7 @@ func (x *CommitDivergenceRequest) String() string {
func (*CommitDivergenceRequest) ProtoMessage() {}
func (x *CommitDivergenceRequest) ProtoReflect() protoreflect.Message {
mi := &file_repo_proto_msgTypes[18]
mi := &file_repo_proto_msgTypes[17]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1275,7 +1201,7 @@ func (x *CommitDivergenceRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommitDivergenceRequest.ProtoReflect.Descriptor instead.
func (*CommitDivergenceRequest) Descriptor() ([]byte, []int) {
return file_repo_proto_rawDescGZIP(), []int{18}
return file_repo_proto_rawDescGZIP(), []int{17}
}
func (x *CommitDivergenceRequest) GetFrom() string {
@ -1303,7 +1229,7 @@ type GetCommitDivergencesResponse struct {
func (x *GetCommitDivergencesResponse) Reset() {
*x = GetCommitDivergencesResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_repo_proto_msgTypes[19]
mi := &file_repo_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1316,7 +1242,7 @@ func (x *GetCommitDivergencesResponse) String() string {
func (*GetCommitDivergencesResponse) ProtoMessage() {}
func (x *GetCommitDivergencesResponse) ProtoReflect() protoreflect.Message {
mi := &file_repo_proto_msgTypes[19]
mi := &file_repo_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1329,7 +1255,7 @@ func (x *GetCommitDivergencesResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetCommitDivergencesResponse.ProtoReflect.Descriptor instead.
func (*GetCommitDivergencesResponse) Descriptor() ([]byte, []int) {
return file_repo_proto_rawDescGZIP(), []int{19}
return file_repo_proto_rawDescGZIP(), []int{18}
}
func (x *GetCommitDivergencesResponse) GetDivergences() []*CommitDivergence {
@ -1351,7 +1277,7 @@ type CommitDivergence struct {
func (x *CommitDivergence) Reset() {
*x = CommitDivergence{}
if protoimpl.UnsafeEnabled {
mi := &file_repo_proto_msgTypes[20]
mi := &file_repo_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1364,7 +1290,7 @@ func (x *CommitDivergence) String() string {
func (*CommitDivergence) ProtoMessage() {}
func (x *CommitDivergence) ProtoReflect() protoreflect.Message {
mi := &file_repo_proto_msgTypes[20]
mi := &file_repo_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1377,7 +1303,7 @@ func (x *CommitDivergence) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommitDivergence.ProtoReflect.Descriptor instead.
func (*CommitDivergence) Descriptor() ([]byte, []int) {
return file_repo_proto_rawDescGZIP(), []int{20}
return file_repo_proto_rawDescGZIP(), []int{19}
}
func (x *CommitDivergence) GetAhead() int32 {
@ -1456,126 +1382,119 @@ var file_repo_proto_rawDesc = []byte{
0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68,
0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x78, 0x0a, 0x12, 0x4c, 0x69, 0x73,
0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x69,
0x74, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69, 0x74,
0x52, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53,
0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53,
0x69, 0x7a, 0x65, 0x22, 0x7e, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x68, 0x65,
0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x70, 0x63,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65,
0x61, 0x64, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
0x74, 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x64,
0x61, 0x74, 0x61, 0x22, 0x3c, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e,
0x74, 0x22, 0x5b, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x10,
0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61,
0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20,
0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x30,
0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x1d, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x09, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62,
0x22, 0x46, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69,
0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x18,
0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x5d, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53,
0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x69,
0x74, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69, 0x74,
0x52, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x44, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x75,
0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x2c, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75,
0x6c, 0x65, 0x52, 0x09, 0x73, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x31, 0x0a,
0x09, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10,
0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c,
0x22, 0x8f, 0x01, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69,
0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x88, 0x01, 0x0a, 0x12, 0x4c, 0x69,
0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d,
0x61, 0x78, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
0x6d, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x72, 0x70, 0x63,
0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x73, 0x22, 0x3d, 0x0a, 0x17, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65,
0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a,
0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f,
0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74,
0x6f, 0x22, 0x57, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69,
0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73,
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d,
0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0b, 0x64,
0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x40, 0x0a, 0x10, 0x43, 0x6f,
0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14,
0x0a, 0x05, 0x61, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x61,
0x68, 0x65, 0x61, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x65, 0x68, 0x69, 0x6e, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x65, 0x68, 0x69, 0x6e, 0x64, 0x2a, 0x52, 0x0a, 0x0c,
0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10,
0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x54, 0x72, 0x65, 0x65,
0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79,
0x70, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x72, 0x65, 0x65,
0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x10, 0x02,
0x2a, 0x81, 0x01, 0x0a, 0x0c, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64,
0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64,
0x65, 0x46, 0x69, 0x6c, 0x65, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x72, 0x65, 0x65, 0x4e,
0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x10, 0x01,
0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x67,
0x69, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69,
0x74, 0x52, 0x65, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61,
0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14,
0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c,
0x69, 0x6d, 0x69, 0x74, 0x22, 0x3a, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d,
0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x63,
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
0x22, 0x5b, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x10, 0x0a,
0x03, 0x73, 0x68, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12,
0x1c, 0x0a, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01,
0x28, 0x03, 0x52, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x30, 0x0a,
0x0f, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x1d, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22,
0x46, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x18, 0x0a,
0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x5d, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x75,
0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19,
0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x69, 0x74,
0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69, 0x74, 0x52,
0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x44, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62,
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c,
0x0a, 0x09, 0x73, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c,
0x65, 0x52, 0x09, 0x73, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x31, 0x0a, 0x09,
0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a,
0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22,
0x8f, 0x01, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76,
0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x19, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61,
0x78, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d,
0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x73, 0x22, 0x3d, 0x0a, 0x17, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72,
0x67, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04,
0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d,
0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f,
0x22, 0x57, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76,
0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d,
0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0b, 0x64, 0x69,
0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x40, 0x0a, 0x10, 0x43, 0x6f, 0x6d,
0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x61, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x61, 0x68,
0x65, 0x61, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x65, 0x68, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x65, 0x68, 0x69, 0x6e, 0x64, 0x2a, 0x52, 0x0a, 0x0c, 0x54,
0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54,
0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x54, 0x72, 0x65, 0x65, 0x10,
0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70,
0x65, 0x42, 0x6c, 0x6f, 0x62, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x72, 0x65, 0x65, 0x4e,
0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x10, 0x02, 0x2a,
0x81, 0x01, 0x0a, 0x0c, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65,
0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65,
0x45, 0x78, 0x65, 0x63, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f,
0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x54, 0x72, 0x65, 0x65, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12,
0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6d, 0x6d,
0x69, 0x74, 0x10, 0x04, 0x32, 0x8e, 0x04, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74,
0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x10, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73,
0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74,
0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x40, 0x0a,
0x0b, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x54,
0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x48, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73,
0x12, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e,
0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x43, 0x0a, 0x0c, 0x47, 0x65, 0x74,
0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62,
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34,
0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d,
0x69, 0x74, 0x73, 0x12, 0x17, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f,
0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x5b, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43,
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73,
0x12, 0x20, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x21, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d,
0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x6e,
0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x46, 0x69, 0x6c, 0x65, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f,
0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x10, 0x01, 0x12,
0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x45,
0x78, 0x65, 0x63, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64,
0x65, 0x4d, 0x6f, 0x64, 0x65, 0x54, 0x72, 0x65, 0x65, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x54,
0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
0x74, 0x10, 0x04, 0x32, 0x8e, 0x04, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f,
0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x10, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x2e,
0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69,
0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f,
0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x40, 0x0a, 0x0b,
0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72,
0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48,
0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12,
0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f,
0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x70, 0x63,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x43, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x53,
0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47,
0x65, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6d,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a,
0x07, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47,
0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e,
0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
0x74, 0x73, 0x12, 0x17, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d,
0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x5b, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6f,
0x6d, 0x6d, 0x69, 0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12,
0x20, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x44,
0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x21, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
0x74, 0x44, 0x69, 0x76, 0x65, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x6e, 0x65,
0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1591,7 +1510,7 @@ func file_repo_proto_rawDescGZIP() []byte {
}
var file_repo_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_repo_proto_msgTypes = make([]protoimpl.MessageInfo, 21)
var file_repo_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
var file_repo_proto_goTypes = []interface{}{
(TreeNodeType)(0), // 0: rpc.TreeNodeType
(TreeNodeMode)(0), // 1: rpc.TreeNodeMode
@ -1605,54 +1524,52 @@ var file_repo_proto_goTypes = []interface{}{
(*TreeNode)(nil), // 9: rpc.TreeNode
(*ListCommitsRequest)(nil), // 10: rpc.ListCommitsRequest
(*ListCommitsResponse)(nil), // 11: rpc.ListCommitsResponse
(*ListCommitsResponseHeader)(nil), // 12: rpc.ListCommitsResponseHeader
(*GetBlobRequest)(nil), // 13: rpc.GetBlobRequest
(*GetBlobResponse)(nil), // 14: rpc.GetBlobResponse
(*Blob)(nil), // 15: rpc.Blob
(*GetSubmoduleRequest)(nil), // 16: rpc.GetSubmoduleRequest
(*GetSubmoduleResponse)(nil), // 17: rpc.GetSubmoduleResponse
(*Submodule)(nil), // 18: rpc.Submodule
(*GetCommitDivergencesRequest)(nil), // 19: rpc.GetCommitDivergencesRequest
(*CommitDivergenceRequest)(nil), // 20: rpc.CommitDivergenceRequest
(*GetCommitDivergencesResponse)(nil), // 21: rpc.GetCommitDivergencesResponse
(*CommitDivergence)(nil), // 22: rpc.CommitDivergence
(*FileUpload)(nil), // 23: rpc.FileUpload
(*Commit)(nil), // 24: rpc.Commit
(*GetBlobRequest)(nil), // 12: rpc.GetBlobRequest
(*GetBlobResponse)(nil), // 13: rpc.GetBlobResponse
(*Blob)(nil), // 14: rpc.Blob
(*GetSubmoduleRequest)(nil), // 15: rpc.GetSubmoduleRequest
(*GetSubmoduleResponse)(nil), // 16: rpc.GetSubmoduleResponse
(*Submodule)(nil), // 17: rpc.Submodule
(*GetCommitDivergencesRequest)(nil), // 18: rpc.GetCommitDivergencesRequest
(*CommitDivergenceRequest)(nil), // 19: rpc.CommitDivergenceRequest
(*GetCommitDivergencesResponse)(nil), // 20: rpc.GetCommitDivergencesResponse
(*CommitDivergence)(nil), // 21: rpc.CommitDivergence
(*FileUpload)(nil), // 22: rpc.FileUpload
(*Commit)(nil), // 23: rpc.Commit
}
var file_repo_proto_depIdxs = []int32{
3, // 0: rpc.CreateRepositoryRequest.header:type_name -> rpc.CreateRepositoryRequestHeader
23, // 1: rpc.CreateRepositoryRequest.file:type_name -> rpc.FileUpload
22, // 1: rpc.CreateRepositoryRequest.file:type_name -> rpc.FileUpload
9, // 2: rpc.GetTreeNodeResponse.node:type_name -> rpc.TreeNode
24, // 3: rpc.GetTreeNodeResponse.commit:type_name -> rpc.Commit
23, // 3: rpc.GetTreeNodeResponse.commit:type_name -> rpc.Commit
9, // 4: rpc.ListTreeNodesResponse.node:type_name -> rpc.TreeNode
24, // 5: rpc.ListTreeNodesResponse.commit:type_name -> rpc.Commit
23, // 5: rpc.ListTreeNodesResponse.commit:type_name -> rpc.Commit
0, // 6: rpc.TreeNode.type:type_name -> rpc.TreeNodeType
1, // 7: rpc.TreeNode.mode:type_name -> rpc.TreeNodeMode
12, // 8: rpc.ListCommitsResponse.header:type_name -> rpc.ListCommitsResponseHeader
24, // 9: rpc.ListCommitsResponse.commit:type_name -> rpc.Commit
15, // 10: rpc.GetBlobResponse.blob:type_name -> rpc.Blob
18, // 11: rpc.GetSubmoduleResponse.submodule:type_name -> rpc.Submodule
20, // 12: rpc.GetCommitDivergencesRequest.requests:type_name -> rpc.CommitDivergenceRequest
22, // 13: rpc.GetCommitDivergencesResponse.divergences:type_name -> rpc.CommitDivergence
2, // 14: rpc.RepositoryService.CreateRepository:input_type -> rpc.CreateRepositoryRequest
5, // 15: rpc.RepositoryService.GetTreeNode:input_type -> rpc.GetTreeNodeRequest
7, // 16: rpc.RepositoryService.ListTreeNodes:input_type -> rpc.ListTreeNodesRequest
16, // 17: rpc.RepositoryService.GetSubmodule:input_type -> rpc.GetSubmoduleRequest
13, // 18: rpc.RepositoryService.GetBlob:input_type -> rpc.GetBlobRequest
10, // 19: rpc.RepositoryService.ListCommits:input_type -> rpc.ListCommitsRequest
19, // 20: rpc.RepositoryService.GetCommitDivergences:input_type -> rpc.GetCommitDivergencesRequest
4, // 21: rpc.RepositoryService.CreateRepository:output_type -> rpc.CreateRepositoryResponse
6, // 22: rpc.RepositoryService.GetTreeNode:output_type -> rpc.GetTreeNodeResponse
8, // 23: rpc.RepositoryService.ListTreeNodes:output_type -> rpc.ListTreeNodesResponse
17, // 24: rpc.RepositoryService.GetSubmodule:output_type -> rpc.GetSubmoduleResponse
14, // 25: rpc.RepositoryService.GetBlob:output_type -> rpc.GetBlobResponse
11, // 26: rpc.RepositoryService.ListCommits:output_type -> rpc.ListCommitsResponse
21, // 27: rpc.RepositoryService.GetCommitDivergences:output_type -> rpc.GetCommitDivergencesResponse
21, // [21:28] is the sub-list for method output_type
14, // [14:21] is the sub-list for method input_type
14, // [14:14] is the sub-list for extension type_name
14, // [14:14] is the sub-list for extension extendee
0, // [0:14] is the sub-list for field type_name
23, // 8: rpc.ListCommitsResponse.commit:type_name -> rpc.Commit
14, // 9: rpc.GetBlobResponse.blob:type_name -> rpc.Blob
17, // 10: rpc.GetSubmoduleResponse.submodule:type_name -> rpc.Submodule
19, // 11: rpc.GetCommitDivergencesRequest.requests:type_name -> rpc.CommitDivergenceRequest
21, // 12: rpc.GetCommitDivergencesResponse.divergences:type_name -> rpc.CommitDivergence
2, // 13: rpc.RepositoryService.CreateRepository:input_type -> rpc.CreateRepositoryRequest
5, // 14: rpc.RepositoryService.GetTreeNode:input_type -> rpc.GetTreeNodeRequest
7, // 15: rpc.RepositoryService.ListTreeNodes:input_type -> rpc.ListTreeNodesRequest
15, // 16: rpc.RepositoryService.GetSubmodule:input_type -> rpc.GetSubmoduleRequest
12, // 17: rpc.RepositoryService.GetBlob:input_type -> rpc.GetBlobRequest
10, // 18: rpc.RepositoryService.ListCommits:input_type -> rpc.ListCommitsRequest
18, // 19: rpc.RepositoryService.GetCommitDivergences:input_type -> rpc.GetCommitDivergencesRequest
4, // 20: rpc.RepositoryService.CreateRepository:output_type -> rpc.CreateRepositoryResponse
6, // 21: rpc.RepositoryService.GetTreeNode:output_type -> rpc.GetTreeNodeResponse
8, // 22: rpc.RepositoryService.ListTreeNodes:output_type -> rpc.ListTreeNodesResponse
16, // 23: rpc.RepositoryService.GetSubmodule:output_type -> rpc.GetSubmoduleResponse
13, // 24: rpc.RepositoryService.GetBlob:output_type -> rpc.GetBlobResponse
11, // 25: rpc.RepositoryService.ListCommits:output_type -> rpc.ListCommitsResponse
20, // 26: rpc.RepositoryService.GetCommitDivergences:output_type -> rpc.GetCommitDivergencesResponse
20, // [20:27] is the sub-list for method output_type
13, // [13:20] is the sub-list for method input_type
13, // [13:13] is the sub-list for extension type_name
13, // [13:13] is the sub-list for extension extendee
0, // [0:13] is the sub-list for field type_name
}
func init() { file_repo_proto_init() }
@ -1783,18 +1700,6 @@ func file_repo_proto_init() {
}
}
file_repo_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListCommitsResponseHeader); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_repo_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBlobRequest); i {
case 0:
return &v.state
@ -1806,7 +1711,7 @@ func file_repo_proto_init() {
return nil
}
}
file_repo_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
file_repo_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBlobResponse); i {
case 0:
return &v.state
@ -1818,7 +1723,7 @@ func file_repo_proto_init() {
return nil
}
}
file_repo_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
file_repo_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Blob); i {
case 0:
return &v.state
@ -1830,7 +1735,7 @@ func file_repo_proto_init() {
return nil
}
}
file_repo_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
file_repo_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetSubmoduleRequest); i {
case 0:
return &v.state
@ -1842,7 +1747,7 @@ func file_repo_proto_init() {
return nil
}
}
file_repo_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
file_repo_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetSubmoduleResponse); i {
case 0:
return &v.state
@ -1854,7 +1759,7 @@ func file_repo_proto_init() {
return nil
}
}
file_repo_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
file_repo_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Submodule); i {
case 0:
return &v.state
@ -1866,7 +1771,7 @@ func file_repo_proto_init() {
return nil
}
}
file_repo_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
file_repo_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetCommitDivergencesRequest); i {
case 0:
return &v.state
@ -1878,7 +1783,7 @@ func file_repo_proto_init() {
return nil
}
}
file_repo_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
file_repo_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommitDivergenceRequest); i {
case 0:
return &v.state
@ -1890,7 +1795,7 @@ func file_repo_proto_init() {
return nil
}
}
file_repo_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
file_repo_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetCommitDivergencesResponse); i {
case 0:
return &v.state
@ -1902,7 +1807,7 @@ func file_repo_proto_init() {
return nil
}
}
file_repo_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
file_repo_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommitDivergence); i {
case 0:
return &v.state
@ -1919,17 +1824,13 @@ func file_repo_proto_init() {
(*CreateRepositoryRequest_Header)(nil),
(*CreateRepositoryRequest_File)(nil),
}
file_repo_proto_msgTypes[9].OneofWrappers = []interface{}{
(*ListCommitsResponse_Header)(nil),
(*ListCommitsResponse_Commit)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_repo_proto_rawDesc,
NumEnums: 2,
NumMessages: 21,
NumMessages: 20,
NumExtensions: 0,
NumServices: 1,
},

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.9
// - protoc v3.21.11
// source: repo.proto
package rpc

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.9
// protoc v3.21.11
// source: shared.proto
package rpc
@ -75,7 +75,6 @@ type FileUpload struct {
unknownFields protoimpl.UnknownFields
// Types that are assignable to Data:
//
// *FileUpload_Header
// *FileUpload_Chunk
Data isFileUpload_Data `protobuf_oneof:"data"`

View File

@ -19,14 +19,14 @@ import (
* ListCommits lists the commits of a repo.
*/
func (c *Controller) ListCommits(ctx context.Context, session *auth.Session,
repoRef string, gitRef string, filter *types.CommitFilter) ([]Commit, int64, error) {
repoRef string, gitRef string, filter *types.CommitFilter) ([]Commit, error) {
repo, err := c.repoStore.FindRepoFromRef(ctx, repoRef)
if err != nil {
return nil, 0, err
return nil, err
}
if err = apiauth.CheckRepo(ctx, c.authorizer, session, repo, enum.PermissionRepoView, false); err != nil {
return nil, 0, err
return nil, err
}
// set gitRef to default branch in case an empty reference was provided
@ -35,13 +35,14 @@ func (c *Controller) ListCommits(ctx context.Context, session *auth.Session,
}
rpcOut, err := c.gitRPCClient.ListCommits(ctx, &gitrpc.ListCommitsParams{
RepoUID: repo.GitUID,
GitREF: gitRef,
Page: int32(filter.Page),
PageSize: int32(filter.Size),
RepoUID: repo.GitUID,
GitREF: gitRef,
After: filter.After,
Page: int32(filter.Page),
Limit: int32(filter.Limit),
})
if err != nil {
return nil, 0, err
return nil, err
}
commits := make([]Commit, len(rpcOut.Commits))
@ -49,10 +50,10 @@ func (c *Controller) ListCommits(ctx context.Context, session *auth.Session,
var commit *Commit
commit, err = mapCommit(&rpcOut.Commits[i])
if err != nil {
return nil, 0, fmt.Errorf("failed to map commit: %w", err)
return nil, fmt.Errorf("failed to map commit: %w", err)
}
commits[i] = *commit
}
return commits, rpcOut.TotalCount, nil
return commits, nil
}

View File

@ -29,13 +29,15 @@ func HandleListCommits(repoCtrl *repo.Controller) http.HandlerFunc {
filter := request.ParseCommitFilter(r)
commits, totalCount, err := repoCtrl.ListCommits(ctx, session, repoRef, gitRef, filter)
commits, err := repoCtrl.ListCommits(ctx, session, repoRef, gitRef, filter)
if err != nil {
render.TranslatedUserError(w, err)
return
}
render.Pagination(r, w, filter.Page, filter.Size, int(totalCount))
// TODO: get last page indicator explicitly - current check is wrong in case len % limit == 0
isLastPage := len(commits) < filter.Limit
render.PaginationNoTotal(r, w, filter.Page, filter.Limit, isLastPage)
render.JSON(w, http.StatusOK, commits)
}
}

View File

@ -94,18 +94,3 @@ var queryParameterAfter = openapi3.ParameterOrRef{
},
},
}
var queryParameterBefore = openapi3.ParameterOrRef{
Parameter: &openapi3.Parameter{
Name: request.QueryParamBefore,
In: openapi3.ParameterInQuery,
Description: ptr.String("The result should contain only entries created before this timestamp (unix millis)."),
Required: ptr.Bool(false),
Schema: &openapi3.SchemaOrRef{
Schema: &openapi3.Schema{
Type: ptrSchemaType(openapi3.SchemaTypeInteger),
Minimum: ptr.Float64(0),
},
},
},
}

View File

@ -228,6 +228,21 @@ var queryParameterTypePullRequestActivity = openapi3.ParameterOrRef{
},
}
var queryParameterBeforePullRequestActivity = openapi3.ParameterOrRef{
Parameter: &openapi3.Parameter{
Name: request.QueryParamBefore,
In: openapi3.ParameterInQuery,
Description: ptr.String("The result should contain only entries created before this timestamp (unix millis)."),
Required: ptr.Bool(false),
Schema: &openapi3.SchemaOrRef{
Schema: &openapi3.Schema{
Type: ptrSchemaType(openapi3.SchemaTypeInteger),
Minimum: ptr.Float64(0),
},
},
},
}
//nolint:funlen
func pullReqOperations(reflector *openapi3.Reflector) {
createPullReq := openapi3.Operation{}
@ -285,7 +300,7 @@ func pullReqOperations(reflector *openapi3.Reflector) {
listPullReqActivities.WithMapOfAnything(map[string]interface{}{"operationId": "listPullReqActivities"})
listPullReqActivities.WithParameters(
queryParameterKindPullRequestActivity, queryParameterTypePullRequestActivity,
queryParameterAfter, queryParameterBefore, queryParameterLimit)
queryParameterAfter, queryParameterBeforePullRequestActivity, queryParameterLimit)
_ = reflector.SetRequest(&listPullReqActivities, new(listPullReqActivitiesRequest), http.MethodGet)
_ = reflector.SetJSONResponse(&listPullReqActivities, new([]types.PullReqActivity), http.StatusOK)
_ = reflector.SetJSONResponse(&listPullReqActivities, new(usererror.Error), http.StatusBadRequest)

View File

@ -238,6 +238,20 @@ var queryParameterQueryTags = openapi3.ParameterOrRef{
},
}
var queryParameterAfterCommits = openapi3.ParameterOrRef{
Parameter: &openapi3.Parameter{
Name: request.QueryParamAfter,
In: openapi3.ParameterInQuery,
Description: ptr.String("The result should only contain commits that occurred after the provided reference."),
Required: ptr.Bool(false),
Schema: &openapi3.SchemaOrRef{
Schema: &openapi3.Schema{
Type: ptrSchemaType(openapi3.SchemaTypeString),
},
},
},
}
//nolint:funlen
func repoOperations(reflector *openapi3.Reflector) {
createRepository := openapi3.Operation{}
@ -357,7 +371,8 @@ func repoOperations(reflector *openapi3.Reflector) {
opListCommits := openapi3.Operation{}
opListCommits.WithTags("repository")
opListCommits.WithMapOfAnything(map[string]interface{}{"operationId": "listCommits"})
opListCommits.WithParameters(queryParameterGitRef, queryParameterPage, queryParameterLimit)
opListCommits.WithParameters(queryParameterGitRef, queryParameterAfterCommits,
queryParameterPage, queryParameterLimit)
_ = reflector.SetRequest(&opListCommits, new(listCommitsRequest), http.MethodGet)
_ = reflector.SetJSONResponse(&opListCommits, []repo.Commit{}, http.StatusOK)
_ = reflector.SetJSONResponse(&opListCommits, new(usererror.Error), http.StatusInternalServerError)

View File

@ -64,7 +64,7 @@ func ParsePullReqFilter(r *http.Request) (*types.PullReqFilter, error) {
}
return &types.PullReqFilter{
Page: ParsePage(r),
Size: ParseSize(r),
Size: ParseLimit(r),
Query: ParseQuery(r),
CreatedBy: createdBy,
SourceRepoRef: r.FormValue("source_repo_ref"),

View File

@ -176,8 +176,8 @@ func ParsePage(r *http.Request) int {
return i
}
// ParseSize extracts the limit parameter from the url.
func ParseSize(r *http.Request) int {
// ParseLimit extracts the limit parameter from the url.
func ParseLimit(r *http.Request) int {
s := r.FormValue(QueryParamLimit)
i, _ := strconv.Atoi(s)
if i <= 0 {
@ -248,7 +248,7 @@ func ParseUserFilter(r *http.Request) *types.UserFilter {
Order: ParseOrder(r),
Page: ParsePage(r),
Sort: ParseSortUser(r),
Size: ParseSize(r),
Size: ParseLimit(r),
}
}
@ -259,7 +259,7 @@ func ParseSpaceFilter(r *http.Request) *types.SpaceFilter {
Order: ParseOrder(r),
Page: ParsePage(r),
Sort: ParseSortSpace(r),
Size: ParseSize(r),
Size: ParseLimit(r),
}
}
@ -270,7 +270,7 @@ func ParseRepoFilter(r *http.Request) *types.RepoFilter {
Order: ParseOrder(r),
Page: ParsePage(r),
Sort: ParseSortRepo(r),
Size: ParseSize(r),
Size: ParseLimit(r),
}
}
@ -280,16 +280,16 @@ func ParsePathFilter(r *http.Request) *types.PathFilter {
Order: ParseOrder(r),
Page: ParsePage(r),
Sort: ParseSortPath(r),
Size: ParseSize(r),
Size: ParseLimit(r),
}
}
// ParseCommitFilter extracts the commit query parameter from the url.
// TODO: do we need a separate filter?
func ParseCommitFilter(r *http.Request) *types.CommitFilter {
return &types.CommitFilter{
Page: ParsePage(r),
Size: ParseSize(r),
After: QueryParamOrDefault(r, QueryParamAfter, ""),
Page: ParsePage(r),
Limit: ParseLimit(r),
}
}
@ -301,7 +301,7 @@ func ParseBranchFilter(r *http.Request) *types.BranchFilter {
Sort: ParseSortBranch(r),
Order: ParseOrder(r),
Page: ParsePage(r),
Size: ParseSize(r),
Size: ParseLimit(r),
}
}
@ -313,6 +313,6 @@ func ParseTagFilter(r *http.Request) *types.TagFilter {
Sort: ParseSortTag(r),
Order: ParseOrder(r),
Page: ParsePage(r),
Size: ParseSize(r),
Size: ParseLimit(r),
}
}

View File

@ -27,7 +27,7 @@ func GetWebhookExecutionIDFromPath(r *http.Request) (int64, error) {
func ParseWebhookFilter(r *http.Request) *types.WebhookFilter {
return &types.WebhookFilter{
Page: ParsePage(r),
Size: ParseSize(r),
Size: ParseLimit(r),
}
}
@ -35,6 +35,6 @@ func ParseWebhookFilter(r *http.Request) *types.WebhookFilter {
func ParseWebhookExecutionFilter(r *http.Request) *types.WebhookExecutionFilter {
return &types.WebhookExecutionFilter{
Page: ParsePage(r),
Size: ParseSize(r),
Size: ParseLimit(r),
}
}

View File

@ -8,8 +8,9 @@ import "github.com/harness/gitness/types/enum"
// CommitFilter stores commit query parameters.
type CommitFilter struct {
Page int `json:"page"`
Size int `json:"size"`
After string `json:"after"`
Page int `json:"page"`
Limit int `json:"limit"`
}
// BranchFilter stores branch query parameters.