diff --git a/cli/server/harness.wire_gen.go b/cli/server/harness.wire_gen.go index 6cedee83f..369e5e56e 100644 --- a/cli/server/harness.wire_gen.go +++ b/cli/server/harness.wire_gen.go @@ -124,7 +124,7 @@ func initSystem(ctx context.Context, config *types.Config) (*system, error) { if err != nil { return nil, err } - webhookServer, err := webhook.ProvideServer(ctx, webhookConfig, readerFactory, webhookStore, webhookExecutionStore, repoStore, provider, principalStore) + webhookServer, err := webhook.ProvideServer(ctx, webhookConfig, readerFactory, webhookStore, webhookExecutionStore, repoStore, provider, principalStore, gitrpcInterface) if err != nil { return nil, err } diff --git a/cli/server/standalone.wire_gen.go b/cli/server/standalone.wire_gen.go index 40ad16c5c..5949b01e6 100644 --- a/cli/server/standalone.wire_gen.go +++ b/cli/server/standalone.wire_gen.go @@ -85,7 +85,7 @@ func initSystem(ctx context.Context, config *types.Config) (*system, error) { if err != nil { return nil, err } - webhookServer, err := webhook.ProvideServer(ctx, webhookConfig, readerFactory, webhookStore, webhookExecutionStore, repoStore, provider, principalStore) + webhookServer, err := webhook.ProvideServer(ctx, webhookConfig, readerFactory, webhookStore, webhookExecutionStore, repoStore, provider, principalStore, gitrpcInterface) if err != nil { return nil, err } diff --git a/gitrpc/commit.go b/gitrpc/commit.go new file mode 100644 index 000000000..fe506b8ac --- /dev/null +++ b/gitrpc/commit.go @@ -0,0 +1,199 @@ +// Copyright 2022 Harness Inc. All rights reserved. +// Use of this source code is governed by the Polyform Free Trial License +// that can be found in the LICENSE.md file for this repository. + +package gitrpc + +import ( + "context" + "errors" + "fmt" + "io" + "time" + + "github.com/harness/gitness/gitrpc/rpc" + + "github.com/rs/zerolog/log" +) + +type GetCommitParams struct { + ReadParams + // SHA is the git commit sha + SHA string +} + +type GetCommitOutput struct { + Commit Commit +} + +type Commit struct { + SHA string + Title string + Message string + Author Signature + Committer Signature +} + +type Signature struct { + Identity Identity + When time.Time +} + +type Identity struct { + Name string + Email string +} + +func (c *Client) GetCommit(ctx context.Context, params *GetCommitParams) (*GetCommitOutput, error) { + if params == nil { + return nil, ErrNoParamsProvided + } + result, err := c.repoService.GetCommit(ctx, &rpc.GetCommitRequest{ + Base: mapToRPCReadRequest(params.ReadParams), + Sha: params.SHA, + }) + if err != nil { + return nil, fmt.Errorf("failed to get commit: %w", err) + } + + commit, err := mapRPCCommit(result.GetCommit()) + if err != nil { + return nil, fmt.Errorf("failed to map rpc commit: %w", err) + } + + return &GetCommitOutput{ + Commit: *commit, + }, nil +} + +type ListCommitsParams struct { + ReadParams + // GitREF is a git reference (branch / tag / commit SHA) + 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 { + Commits []Commit +} + +func (c *Client) ListCommits(ctx context.Context, params *ListCommitsParams) (*ListCommitsOutput, error) { + if params == nil { + return nil, ErrNoParamsProvided + } + stream, err := c.repoService.ListCommits(ctx, &rpc.ListCommitsRequest{ + Base: mapToRPCReadRequest(params.ReadParams), + 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) + } + // NOTE: don't use PageSize as initial slice capacity - as that theoretically could be MaxInt + output := &ListCommitsOutput{ + Commits: make([]Commit, 0, 16), + } + + for { + var next *rpc.ListCommitsResponse + next, err = stream.Recv() + if errors.Is(err, io.EOF) { + log.Ctx(ctx).Debug().Msg("received end of stream") + break + } + if err != nil { + return nil, processRPCErrorf(err, "received unexpected error from server") + } + if next.GetCommit() == nil { + return nil, fmt.Errorf("expected commit message") + } + + var commit *Commit + commit, err = mapRPCCommit(next.GetCommit()) + if err != nil { + return nil, fmt.Errorf("failed to map rpc commit: %w", err) + } + + output.Commits = append(output.Commits, *commit) + } + + return output, nil +} + +type GetCommitDivergencesParams struct { + ReadParams + MaxCount int32 + Requests []CommitDivergenceRequest +} + +type GetCommitDivergencesOutput struct { + Divergences []CommitDivergence +} + +// CommitDivergenceRequest contains the refs for which the converging commits should be counted. +type CommitDivergenceRequest struct { + // From is the ref from which the counting of the diverging commits starts. + From string + // To is the ref at which the counting of the diverging commits ends. + To string +} + +// CommitDivergence contains the information of the count of converging commits between two refs. +type CommitDivergence struct { + // Ahead is the count of commits the 'From' ref is ahead of the 'To' ref. + Ahead int32 + // Behind is the count of commits the 'From' ref is behind the 'To' ref. + Behind int32 +} + +func (c *Client) GetCommitDivergences(ctx context.Context, + params *GetCommitDivergencesParams) (*GetCommitDivergencesOutput, error) { + if params == nil { + return nil, ErrNoParamsProvided + } + + // build rpc request + req := &rpc.GetCommitDivergencesRequest{ + Base: mapToRPCReadRequest(params.ReadParams), + MaxCount: params.MaxCount, + Requests: make([]*rpc.CommitDivergenceRequest, len(params.Requests)), + } + for i := range params.Requests { + req.Requests[i] = &rpc.CommitDivergenceRequest{ + From: params.Requests[i].From, + To: params.Requests[i].To, + } + } + resp, err := c.repoService.GetCommitDivergences(ctx, req) + if err != nil { + return nil, processRPCErrorf(err, "failed to get diverging commits from server") + } + + divergences := resp.GetDivergences() + if divergences == nil { + return nil, fmt.Errorf("server response divergences were nil") + } + + // build output + output := &GetCommitDivergencesOutput{ + Divergences: make([]CommitDivergence, len(divergences)), + } + for i := range divergences { + if divergences[i] == nil { + return nil, fmt.Errorf("server returned nil divergence") + } + + output.Divergences[i] = CommitDivergence{ + Ahead: divergences[i].Ahead, + Behind: divergences[i].Behind, + } + } + + return output, nil +} diff --git a/gitrpc/interface.go b/gitrpc/interface.go index a0df0ea98..a00d2245f 100644 --- a/gitrpc/interface.go +++ b/gitrpc/interface.go @@ -23,6 +23,7 @@ type Interface interface { /* * Commits service */ + GetCommit(ctx context.Context, params *GetCommitParams) (*GetCommitOutput, error) ListCommits(ctx context.Context, params *ListCommitsParams) (*ListCommitsOutput, error) ListCommitTags(ctx context.Context, params *ListCommitTagsParams) (*ListCommitTagsOutput, error) GetCommitDivergences(ctx context.Context, params *GetCommitDivergencesParams) (*GetCommitDivergencesOutput, error) diff --git a/gitrpc/internal/service/commit.go b/gitrpc/internal/service/commit.go index 7afe3ad92..d735e63fe 100644 --- a/gitrpc/internal/service/commit.go +++ b/gitrpc/internal/service/commit.go @@ -15,6 +15,36 @@ import ( "google.golang.org/grpc/status" ) +func (s RepositoryService) GetCommit(ctx context.Context, + request *rpc.GetCommitRequest) (*rpc.GetCommitResponse, error) { + base := request.GetBase() + if base == nil { + return nil, types.ErrBaseCannotBeEmpty + } + + // ensure the provided SHA is valid (and not a reference) + sha := request.GetSha() + if !isValidGitSHA(sha) { + return nil, status.Errorf(codes.InvalidArgument, "the provided commit sha '%s' is of invalid format.", sha) + } + + repoPath := getFullPathForRepo(s.reposRoot, base.GetRepoUid()) + + gitCommit, err := s.adapter.GetCommit(ctx, repoPath, sha) + if err != nil { + return nil, processGitErrorf(err, "failed to get commit") + } + + commit, err := mapGitCommit(gitCommit) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to map git commit: %v", err) + } + + return &rpc.GetCommitResponse{ + Commit: commit, + }, nil +} + func (s RepositoryService) ListCommits(request *rpc.ListCommitsRequest, stream rpc.RepositoryService_ListCommitsServer) error { base := request.GetBase() diff --git a/gitrpc/internal/service/repo.go b/gitrpc/internal/service/repo.go index d9b78e3d0..93d313f21 100644 --- a/gitrpc/internal/service/repo.go +++ b/gitrpc/internal/service/repo.go @@ -12,6 +12,7 @@ import ( "io" "os" "path" + "regexp" "github.com/harness/gitness/gitrpc/internal/types" "github.com/harness/gitness/gitrpc/rpc" @@ -39,6 +40,11 @@ var ( } gitServerHookNames = []string{"pre-receive", "update", "post-receive"} + + // gitSHARegex defines the valid SHA format accepted by GIT (full form and short forms). + // Note: as of now SHA is at most 40 characters long, but in the future it's moving to sha256 + // which is 64 chars - keep this forward-compatible. + gitSHARegex = regexp.MustCompile("^[0-9a-f]{4,64}$") ) type Storage interface { @@ -176,3 +182,8 @@ func (s RepositoryService) CreateRepository(stream rpc.RepositoryService_CreateR log.Info().Msgf("repository created. Path: %s", repoPath) return nil } + +// isValidGitSHA returns true iff the provided string is a valid git sha (short or long form). +func isValidGitSHA(sha string) bool { + return gitSHARegex.MatchString(sha) +} diff --git a/gitrpc/operations.go b/gitrpc/operations.go index 9342ae62d..09b9061ad 100644 --- a/gitrpc/operations.go +++ b/gitrpc/operations.go @@ -11,163 +11,10 @@ import ( "errors" "fmt" "io" - "time" "github.com/harness/gitness/gitrpc/rpc" - - "github.com/rs/zerolog/log" ) -type ListCommitsParams struct { - ReadParams - // GitREF is a git reference (branch / tag / commit SHA) - 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 { - Commits []Commit -} - -type Commit struct { - SHA string - Title string - Message string - Author Signature - Committer Signature -} - -type Signature struct { - Identity Identity - When time.Time -} - -type Identity struct { - Name string - Email string -} - -func (c *Client) ListCommits(ctx context.Context, params *ListCommitsParams) (*ListCommitsOutput, error) { - if params == nil { - return nil, ErrNoParamsProvided - } - stream, err := c.repoService.ListCommits(ctx, &rpc.ListCommitsRequest{ - Base: mapToRPCReadRequest(params.ReadParams), - 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) - } - // NOTE: don't use PageSize as initial slice capacity - as that theoretically could be MaxInt - output := &ListCommitsOutput{ - Commits: make([]Commit, 0, 16), - } - - for { - var next *rpc.ListCommitsResponse - next, err = stream.Recv() - if errors.Is(err, io.EOF) { - log.Ctx(ctx).Debug().Msg("received end of stream") - break - } - if err != nil { - return nil, processRPCErrorf(err, "received unexpected error from server") - } - if next.GetCommit() == nil { - return nil, fmt.Errorf("expected commit message") - } - - var commit *Commit - commit, err = mapRPCCommit(next.GetCommit()) - if err != nil { - return nil, fmt.Errorf("failed to map rpc commit: %w", err) - } - - output.Commits = append(output.Commits, *commit) - } - - return output, nil -} - -type GetCommitDivergencesParams struct { - ReadParams - MaxCount int32 - Requests []CommitDivergenceRequest -} - -type GetCommitDivergencesOutput struct { - Divergences []CommitDivergence -} - -// CommitDivergenceRequest contains the refs for which the converging commits should be counted. -type CommitDivergenceRequest struct { - // From is the ref from which the counting of the diverging commits starts. - From string - // To is the ref at which the counting of the diverging commits ends. - To string -} - -// CommitDivergence contains the information of the count of converging commits between two refs. -type CommitDivergence struct { - // Ahead is the count of commits the 'From' ref is ahead of the 'To' ref. - Ahead int32 - // Behind is the count of commits the 'From' ref is behind the 'To' ref. - Behind int32 -} - -func (c *Client) GetCommitDivergences(ctx context.Context, - params *GetCommitDivergencesParams) (*GetCommitDivergencesOutput, error) { - if params == nil { - return nil, ErrNoParamsProvided - } - - // build rpc request - req := &rpc.GetCommitDivergencesRequest{ - Base: mapToRPCReadRequest(params.ReadParams), - MaxCount: params.MaxCount, - Requests: make([]*rpc.CommitDivergenceRequest, len(params.Requests)), - } - for i := range params.Requests { - req.Requests[i] = &rpc.CommitDivergenceRequest{ - From: params.Requests[i].From, - To: params.Requests[i].To, - } - } - resp, err := c.repoService.GetCommitDivergences(ctx, req) - if err != nil { - return nil, processRPCErrorf(err, "failed to get diverging commits from server") - } - - divergences := resp.GetDivergences() - if divergences == nil { - return nil, fmt.Errorf("server response divergences were nil") - } - - // build output - output := &GetCommitDivergencesOutput{ - Divergences: make([]CommitDivergence, len(divergences)), - } - for i := range divergences { - if divergences[i] == nil { - return nil, fmt.Errorf("server returned nil divergence") - } - - output.Divergences[i] = CommitDivergence{ - Ahead: divergences[i].Ahead, - Behind: divergences[i].Behind, - } - } - - return output, nil -} - type FileAction string const ( diff --git a/gitrpc/proto/repo.proto b/gitrpc/proto/repo.proto index 2bbb90ecd..ca3e58266 100644 --- a/gitrpc/proto/repo.proto +++ b/gitrpc/proto/repo.proto @@ -13,6 +13,7 @@ service RepositoryService { rpc GetSubmodule(GetSubmoduleRequest) returns (GetSubmoduleResponse); rpc GetBlob(GetBlobRequest) returns (GetBlobResponse); rpc ListCommits(ListCommitsRequest) returns (stream ListCommitsResponse); + rpc GetCommit(GetCommitRequest) returns (GetCommitResponse); rpc GetCommitDivergences(GetCommitDivergencesRequest) returns (GetCommitDivergencesResponse); } @@ -77,6 +78,15 @@ enum TreeNodeMode { TreeNodeModeCommit = 4; } +message GetCommitRequest { + ReadRequest base = 1; + string sha = 2; +} + +message GetCommitResponse { + Commit commit = 1; +} + message ListCommitsRequest { ReadRequest base = 1; string git_ref = 2; diff --git a/gitrpc/rpc/repo.pb.go b/gitrpc/rpc/repo.pb.go index 3155507bd..1e8f9c26d 100644 --- a/gitrpc/rpc/repo.pb.go +++ b/gitrpc/rpc/repo.pb.go @@ -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"` @@ -637,6 +636,108 @@ func (x *TreeNode) GetPath() string { return "" } +type GetCommitRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Base *ReadRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + Sha string `protobuf:"bytes,2,opt,name=sha,proto3" json:"sha,omitempty"` +} + +func (x *GetCommitRequest) Reset() { + *x = GetCommitRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_repo_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCommitRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCommitRequest) ProtoMessage() {} + +func (x *GetCommitRequest) ProtoReflect() protoreflect.Message { + mi := &file_repo_proto_msgTypes[8] + 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 GetCommitRequest.ProtoReflect.Descriptor instead. +func (*GetCommitRequest) Descriptor() ([]byte, []int) { + return file_repo_proto_rawDescGZIP(), []int{8} +} + +func (x *GetCommitRequest) GetBase() *ReadRequest { + if x != nil { + return x.Base + } + return nil +} + +func (x *GetCommitRequest) GetSha() string { + if x != nil { + return x.Sha + } + return "" +} + +type GetCommitResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Commit *Commit `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"` +} + +func (x *GetCommitResponse) Reset() { + *x = GetCommitResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_repo_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCommitResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCommitResponse) ProtoMessage() {} + +func (x *GetCommitResponse) ProtoReflect() protoreflect.Message { + mi := &file_repo_proto_msgTypes[9] + 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 GetCommitResponse.ProtoReflect.Descriptor instead. +func (*GetCommitResponse) Descriptor() ([]byte, []int) { + return file_repo_proto_rawDescGZIP(), []int{9} +} + +func (x *GetCommitResponse) GetCommit() *Commit { + if x != nil { + return x.Commit + } + return nil +} + type ListCommitsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -652,7 +753,7 @@ type ListCommitsRequest struct { func (x *ListCommitsRequest) Reset() { *x = ListCommitsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_repo_proto_msgTypes[8] + mi := &file_repo_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -665,7 +766,7 @@ func (x *ListCommitsRequest) String() string { func (*ListCommitsRequest) ProtoMessage() {} func (x *ListCommitsRequest) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[8] + mi := &file_repo_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -678,7 +779,7 @@ func (x *ListCommitsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListCommitsRequest.ProtoReflect.Descriptor instead. func (*ListCommitsRequest) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{8} + return file_repo_proto_rawDescGZIP(), []int{10} } func (x *ListCommitsRequest) GetBase() *ReadRequest { @@ -727,7 +828,7 @@ type ListCommitsResponse struct { func (x *ListCommitsResponse) Reset() { *x = ListCommitsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_repo_proto_msgTypes[9] + mi := &file_repo_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -740,7 +841,7 @@ func (x *ListCommitsResponse) String() string { func (*ListCommitsResponse) ProtoMessage() {} func (x *ListCommitsResponse) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[9] + mi := &file_repo_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -753,7 +854,7 @@ func (x *ListCommitsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListCommitsResponse.ProtoReflect.Descriptor instead. func (*ListCommitsResponse) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{9} + return file_repo_proto_rawDescGZIP(), []int{11} } func (x *ListCommitsResponse) GetCommit() *Commit { @@ -776,7 +877,7 @@ type GetBlobRequest struct { func (x *GetBlobRequest) Reset() { *x = GetBlobRequest{} if protoimpl.UnsafeEnabled { - mi := &file_repo_proto_msgTypes[10] + mi := &file_repo_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -789,7 +890,7 @@ func (x *GetBlobRequest) String() string { func (*GetBlobRequest) ProtoMessage() {} func (x *GetBlobRequest) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[10] + mi := &file_repo_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -802,7 +903,7 @@ func (x *GetBlobRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBlobRequest.ProtoReflect.Descriptor instead. func (*GetBlobRequest) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{10} + return file_repo_proto_rawDescGZIP(), []int{12} } func (x *GetBlobRequest) GetBase() *ReadRequest { @@ -837,7 +938,7 @@ type GetBlobResponse struct { func (x *GetBlobResponse) Reset() { *x = GetBlobResponse{} if protoimpl.UnsafeEnabled { - mi := &file_repo_proto_msgTypes[11] + mi := &file_repo_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -850,7 +951,7 @@ func (x *GetBlobResponse) String() string { func (*GetBlobResponse) ProtoMessage() {} func (x *GetBlobResponse) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[11] + mi := &file_repo_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -863,7 +964,7 @@ func (x *GetBlobResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBlobResponse.ProtoReflect.Descriptor instead. func (*GetBlobResponse) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{11} + return file_repo_proto_rawDescGZIP(), []int{13} } func (x *GetBlobResponse) GetBlob() *Blob { @@ -886,7 +987,7 @@ type Blob struct { func (x *Blob) Reset() { *x = Blob{} if protoimpl.UnsafeEnabled { - mi := &file_repo_proto_msgTypes[12] + mi := &file_repo_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -899,7 +1000,7 @@ func (x *Blob) String() string { func (*Blob) ProtoMessage() {} func (x *Blob) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[12] + mi := &file_repo_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -912,7 +1013,7 @@ func (x *Blob) ProtoReflect() protoreflect.Message { // Deprecated: Use Blob.ProtoReflect.Descriptor instead. func (*Blob) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{12} + return file_repo_proto_rawDescGZIP(), []int{14} } func (x *Blob) GetSha() string { @@ -949,7 +1050,7 @@ type GetSubmoduleRequest struct { func (x *GetSubmoduleRequest) Reset() { *x = GetSubmoduleRequest{} if protoimpl.UnsafeEnabled { - mi := &file_repo_proto_msgTypes[13] + mi := &file_repo_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -962,7 +1063,7 @@ func (x *GetSubmoduleRequest) String() string { func (*GetSubmoduleRequest) ProtoMessage() {} func (x *GetSubmoduleRequest) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[13] + mi := &file_repo_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -975,7 +1076,7 @@ func (x *GetSubmoduleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSubmoduleRequest.ProtoReflect.Descriptor instead. func (*GetSubmoduleRequest) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{13} + return file_repo_proto_rawDescGZIP(), []int{15} } func (x *GetSubmoduleRequest) GetBase() *ReadRequest { @@ -1010,7 +1111,7 @@ type GetSubmoduleResponse struct { func (x *GetSubmoduleResponse) Reset() { *x = GetSubmoduleResponse{} if protoimpl.UnsafeEnabled { - mi := &file_repo_proto_msgTypes[14] + mi := &file_repo_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1023,7 +1124,7 @@ func (x *GetSubmoduleResponse) String() string { func (*GetSubmoduleResponse) ProtoMessage() {} func (x *GetSubmoduleResponse) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[14] + mi := &file_repo_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1036,7 +1137,7 @@ func (x *GetSubmoduleResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSubmoduleResponse.ProtoReflect.Descriptor instead. func (*GetSubmoduleResponse) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{14} + return file_repo_proto_rawDescGZIP(), []int{16} } func (x *GetSubmoduleResponse) GetSubmodule() *Submodule { @@ -1058,7 +1159,7 @@ type Submodule struct { func (x *Submodule) Reset() { *x = Submodule{} if protoimpl.UnsafeEnabled { - mi := &file_repo_proto_msgTypes[15] + mi := &file_repo_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1071,7 +1172,7 @@ func (x *Submodule) String() string { func (*Submodule) ProtoMessage() {} func (x *Submodule) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[15] + mi := &file_repo_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1084,7 +1185,7 @@ func (x *Submodule) ProtoReflect() protoreflect.Message { // Deprecated: Use Submodule.ProtoReflect.Descriptor instead. func (*Submodule) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{15} + return file_repo_proto_rawDescGZIP(), []int{17} } func (x *Submodule) GetName() string { @@ -1114,7 +1215,7 @@ type GetCommitDivergencesRequest struct { func (x *GetCommitDivergencesRequest) Reset() { *x = GetCommitDivergencesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_repo_proto_msgTypes[16] + mi := &file_repo_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1127,7 +1228,7 @@ func (x *GetCommitDivergencesRequest) String() string { func (*GetCommitDivergencesRequest) ProtoMessage() {} func (x *GetCommitDivergencesRequest) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[16] + mi := &file_repo_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1140,7 +1241,7 @@ func (x *GetCommitDivergencesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCommitDivergencesRequest.ProtoReflect.Descriptor instead. func (*GetCommitDivergencesRequest) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{16} + return file_repo_proto_rawDescGZIP(), []int{18} } func (x *GetCommitDivergencesRequest) GetBase() *ReadRequest { @@ -1176,7 +1277,7 @@ type CommitDivergenceRequest struct { func (x *CommitDivergenceRequest) Reset() { *x = CommitDivergenceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_repo_proto_msgTypes[17] + mi := &file_repo_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1189,7 +1290,7 @@ func (x *CommitDivergenceRequest) String() string { func (*CommitDivergenceRequest) ProtoMessage() {} func (x *CommitDivergenceRequest) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[17] + mi := &file_repo_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1202,7 +1303,7 @@ func (x *CommitDivergenceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CommitDivergenceRequest.ProtoReflect.Descriptor instead. func (*CommitDivergenceRequest) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{17} + return file_repo_proto_rawDescGZIP(), []int{19} } func (x *CommitDivergenceRequest) GetFrom() string { @@ -1230,7 +1331,7 @@ type GetCommitDivergencesResponse struct { func (x *GetCommitDivergencesResponse) Reset() { *x = GetCommitDivergencesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_repo_proto_msgTypes[18] + mi := &file_repo_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1243,7 +1344,7 @@ func (x *GetCommitDivergencesResponse) String() string { func (*GetCommitDivergencesResponse) ProtoMessage() {} func (x *GetCommitDivergencesResponse) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[18] + mi := &file_repo_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1256,7 +1357,7 @@ func (x *GetCommitDivergencesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCommitDivergencesResponse.ProtoReflect.Descriptor instead. func (*GetCommitDivergencesResponse) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{18} + return file_repo_proto_rawDescGZIP(), []int{20} } func (x *GetCommitDivergencesResponse) GetDivergences() []*CommitDivergence { @@ -1278,7 +1379,7 @@ type CommitDivergence struct { func (x *CommitDivergence) Reset() { *x = CommitDivergence{} if protoimpl.UnsafeEnabled { - mi := &file_repo_proto_msgTypes[19] + mi := &file_repo_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1291,7 +1392,7 @@ func (x *CommitDivergence) String() string { func (*CommitDivergence) ProtoMessage() {} func (x *CommitDivergence) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[19] + mi := &file_repo_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1304,7 +1405,7 @@ func (x *CommitDivergence) ProtoReflect() protoreflect.Message { // Deprecated: Use CommitDivergence.ProtoReflect.Descriptor instead. func (*CommitDivergence) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{19} + return file_repo_proto_rawDescGZIP(), []int{21} } func (x *CommitDivergence) GetAhead() int32 { @@ -1386,121 +1487,133 @@ var file_repo_proto_rawDesc = []byte{ 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, 0x93, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, - 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, - 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, - 0x65, 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, 0x66, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, - 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, + 0x70, 0x61, 0x74, 0x68, 0x22, 0x4a, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 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, 0x68, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, - 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x04, 0x62, 0x61, 0x73, 0x65, 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, 0x9a, 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, 0x24, 0x0a, 0x04, 0x62, - 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, - 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, - 0x65, 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, 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, + 0x22, 0x38, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 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, 0x93, 0x01, 0x0a, 0x12, 0x4c, + 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 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, 0x66, 0x0a, 0x0e, + 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, + 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, + 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, + 0x62, 0x61, 0x73, 0x65, 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, 0x68, + 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 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, 0x9a, 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, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 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, 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, 0xca, 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, 0x3a, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x12, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, + 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 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, 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, + 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 ( @@ -1516,7 +1629,7 @@ func file_repo_proto_rawDescGZIP() []byte { } var file_repo_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_repo_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_repo_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_repo_proto_goTypes = []interface{}{ (TreeNodeType)(0), // 0: rpc.TreeNodeType (TreeNodeMode)(0), // 1: rpc.TreeNodeMode @@ -1528,63 +1641,69 @@ var file_repo_proto_goTypes = []interface{}{ (*ListTreeNodesRequest)(nil), // 7: rpc.ListTreeNodesRequest (*ListTreeNodesResponse)(nil), // 8: rpc.ListTreeNodesResponse (*TreeNode)(nil), // 9: rpc.TreeNode - (*ListCommitsRequest)(nil), // 10: rpc.ListCommitsRequest - (*ListCommitsResponse)(nil), // 11: rpc.ListCommitsResponse - (*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 - (*WriteRequest)(nil), // 23: rpc.WriteRequest - (*ReadRequest)(nil), // 24: rpc.ReadRequest - (*Commit)(nil), // 25: rpc.Commit + (*GetCommitRequest)(nil), // 10: rpc.GetCommitRequest + (*GetCommitResponse)(nil), // 11: rpc.GetCommitResponse + (*ListCommitsRequest)(nil), // 12: rpc.ListCommitsRequest + (*ListCommitsResponse)(nil), // 13: rpc.ListCommitsResponse + (*GetBlobRequest)(nil), // 14: rpc.GetBlobRequest + (*GetBlobResponse)(nil), // 15: rpc.GetBlobResponse + (*Blob)(nil), // 16: rpc.Blob + (*GetSubmoduleRequest)(nil), // 17: rpc.GetSubmoduleRequest + (*GetSubmoduleResponse)(nil), // 18: rpc.GetSubmoduleResponse + (*Submodule)(nil), // 19: rpc.Submodule + (*GetCommitDivergencesRequest)(nil), // 20: rpc.GetCommitDivergencesRequest + (*CommitDivergenceRequest)(nil), // 21: rpc.CommitDivergenceRequest + (*GetCommitDivergencesResponse)(nil), // 22: rpc.GetCommitDivergencesResponse + (*CommitDivergence)(nil), // 23: rpc.CommitDivergence + (*FileUpload)(nil), // 24: rpc.FileUpload + (*WriteRequest)(nil), // 25: rpc.WriteRequest + (*ReadRequest)(nil), // 26: rpc.ReadRequest + (*Commit)(nil), // 27: rpc.Commit } var file_repo_proto_depIdxs = []int32{ 3, // 0: rpc.CreateRepositoryRequest.header:type_name -> rpc.CreateRepositoryRequestHeader - 22, // 1: rpc.CreateRepositoryRequest.file:type_name -> rpc.FileUpload - 23, // 2: rpc.CreateRepositoryRequestHeader.base:type_name -> rpc.WriteRequest - 24, // 3: rpc.GetTreeNodeRequest.base:type_name -> rpc.ReadRequest + 24, // 1: rpc.CreateRepositoryRequest.file:type_name -> rpc.FileUpload + 25, // 2: rpc.CreateRepositoryRequestHeader.base:type_name -> rpc.WriteRequest + 26, // 3: rpc.GetTreeNodeRequest.base:type_name -> rpc.ReadRequest 9, // 4: rpc.GetTreeNodeResponse.node:type_name -> rpc.TreeNode - 25, // 5: rpc.GetTreeNodeResponse.commit:type_name -> rpc.Commit - 24, // 6: rpc.ListTreeNodesRequest.base:type_name -> rpc.ReadRequest + 27, // 5: rpc.GetTreeNodeResponse.commit:type_name -> rpc.Commit + 26, // 6: rpc.ListTreeNodesRequest.base:type_name -> rpc.ReadRequest 9, // 7: rpc.ListTreeNodesResponse.node:type_name -> rpc.TreeNode - 25, // 8: rpc.ListTreeNodesResponse.commit:type_name -> rpc.Commit + 27, // 8: rpc.ListTreeNodesResponse.commit:type_name -> rpc.Commit 0, // 9: rpc.TreeNode.type:type_name -> rpc.TreeNodeType 1, // 10: rpc.TreeNode.mode:type_name -> rpc.TreeNodeMode - 24, // 11: rpc.ListCommitsRequest.base:type_name -> rpc.ReadRequest - 25, // 12: rpc.ListCommitsResponse.commit:type_name -> rpc.Commit - 24, // 13: rpc.GetBlobRequest.base:type_name -> rpc.ReadRequest - 14, // 14: rpc.GetBlobResponse.blob:type_name -> rpc.Blob - 24, // 15: rpc.GetSubmoduleRequest.base:type_name -> rpc.ReadRequest - 17, // 16: rpc.GetSubmoduleResponse.submodule:type_name -> rpc.Submodule - 24, // 17: rpc.GetCommitDivergencesRequest.base:type_name -> rpc.ReadRequest - 19, // 18: rpc.GetCommitDivergencesRequest.requests:type_name -> rpc.CommitDivergenceRequest - 21, // 19: rpc.GetCommitDivergencesResponse.divergences:type_name -> rpc.CommitDivergence - 2, // 20: rpc.RepositoryService.CreateRepository:input_type -> rpc.CreateRepositoryRequest - 5, // 21: rpc.RepositoryService.GetTreeNode:input_type -> rpc.GetTreeNodeRequest - 7, // 22: rpc.RepositoryService.ListTreeNodes:input_type -> rpc.ListTreeNodesRequest - 15, // 23: rpc.RepositoryService.GetSubmodule:input_type -> rpc.GetSubmoduleRequest - 12, // 24: rpc.RepositoryService.GetBlob:input_type -> rpc.GetBlobRequest - 10, // 25: rpc.RepositoryService.ListCommits:input_type -> rpc.ListCommitsRequest - 18, // 26: rpc.RepositoryService.GetCommitDivergences:input_type -> rpc.GetCommitDivergencesRequest - 4, // 27: rpc.RepositoryService.CreateRepository:output_type -> rpc.CreateRepositoryResponse - 6, // 28: rpc.RepositoryService.GetTreeNode:output_type -> rpc.GetTreeNodeResponse - 8, // 29: rpc.RepositoryService.ListTreeNodes:output_type -> rpc.ListTreeNodesResponse - 16, // 30: rpc.RepositoryService.GetSubmodule:output_type -> rpc.GetSubmoduleResponse - 13, // 31: rpc.RepositoryService.GetBlob:output_type -> rpc.GetBlobResponse - 11, // 32: rpc.RepositoryService.ListCommits:output_type -> rpc.ListCommitsResponse - 20, // 33: rpc.RepositoryService.GetCommitDivergences:output_type -> rpc.GetCommitDivergencesResponse - 27, // [27:34] is the sub-list for method output_type - 20, // [20:27] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 26, // 11: rpc.GetCommitRequest.base:type_name -> rpc.ReadRequest + 27, // 12: rpc.GetCommitResponse.commit:type_name -> rpc.Commit + 26, // 13: rpc.ListCommitsRequest.base:type_name -> rpc.ReadRequest + 27, // 14: rpc.ListCommitsResponse.commit:type_name -> rpc.Commit + 26, // 15: rpc.GetBlobRequest.base:type_name -> rpc.ReadRequest + 16, // 16: rpc.GetBlobResponse.blob:type_name -> rpc.Blob + 26, // 17: rpc.GetSubmoduleRequest.base:type_name -> rpc.ReadRequest + 19, // 18: rpc.GetSubmoduleResponse.submodule:type_name -> rpc.Submodule + 26, // 19: rpc.GetCommitDivergencesRequest.base:type_name -> rpc.ReadRequest + 21, // 20: rpc.GetCommitDivergencesRequest.requests:type_name -> rpc.CommitDivergenceRequest + 23, // 21: rpc.GetCommitDivergencesResponse.divergences:type_name -> rpc.CommitDivergence + 2, // 22: rpc.RepositoryService.CreateRepository:input_type -> rpc.CreateRepositoryRequest + 5, // 23: rpc.RepositoryService.GetTreeNode:input_type -> rpc.GetTreeNodeRequest + 7, // 24: rpc.RepositoryService.ListTreeNodes:input_type -> rpc.ListTreeNodesRequest + 17, // 25: rpc.RepositoryService.GetSubmodule:input_type -> rpc.GetSubmoduleRequest + 14, // 26: rpc.RepositoryService.GetBlob:input_type -> rpc.GetBlobRequest + 12, // 27: rpc.RepositoryService.ListCommits:input_type -> rpc.ListCommitsRequest + 10, // 28: rpc.RepositoryService.GetCommit:input_type -> rpc.GetCommitRequest + 20, // 29: rpc.RepositoryService.GetCommitDivergences:input_type -> rpc.GetCommitDivergencesRequest + 4, // 30: rpc.RepositoryService.CreateRepository:output_type -> rpc.CreateRepositoryResponse + 6, // 31: rpc.RepositoryService.GetTreeNode:output_type -> rpc.GetTreeNodeResponse + 8, // 32: rpc.RepositoryService.ListTreeNodes:output_type -> rpc.ListTreeNodesResponse + 18, // 33: rpc.RepositoryService.GetSubmodule:output_type -> rpc.GetSubmoduleResponse + 15, // 34: rpc.RepositoryService.GetBlob:output_type -> rpc.GetBlobResponse + 13, // 35: rpc.RepositoryService.ListCommits:output_type -> rpc.ListCommitsResponse + 11, // 36: rpc.RepositoryService.GetCommit:output_type -> rpc.GetCommitResponse + 22, // 37: rpc.RepositoryService.GetCommitDivergences:output_type -> rpc.GetCommitDivergencesResponse + 30, // [30:38] is the sub-list for method output_type + 22, // [22:30] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } func init() { file_repo_proto_init() } @@ -1691,7 +1810,7 @@ func file_repo_proto_init() { } } file_repo_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsRequest); i { + switch v := v.(*GetCommitRequest); i { case 0: return &v.state case 1: @@ -1703,7 +1822,7 @@ func file_repo_proto_init() { } } file_repo_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsResponse); i { + switch v := v.(*GetCommitResponse); i { case 0: return &v.state case 1: @@ -1715,7 +1834,7 @@ func file_repo_proto_init() { } } file_repo_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBlobRequest); i { + switch v := v.(*ListCommitsRequest); i { case 0: return &v.state case 1: @@ -1727,7 +1846,7 @@ func file_repo_proto_init() { } } file_repo_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBlobResponse); i { + switch v := v.(*ListCommitsResponse); i { case 0: return &v.state case 1: @@ -1739,7 +1858,7 @@ func file_repo_proto_init() { } } file_repo_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Blob); i { + switch v := v.(*GetBlobRequest); i { case 0: return &v.state case 1: @@ -1751,7 +1870,7 @@ func file_repo_proto_init() { } } file_repo_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSubmoduleRequest); i { + switch v := v.(*GetBlobResponse); i { case 0: return &v.state case 1: @@ -1763,7 +1882,7 @@ func file_repo_proto_init() { } } file_repo_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSubmoduleResponse); i { + switch v := v.(*Blob); i { case 0: return &v.state case 1: @@ -1775,7 +1894,7 @@ func file_repo_proto_init() { } } file_repo_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Submodule); i { + switch v := v.(*GetSubmoduleRequest); i { case 0: return &v.state case 1: @@ -1787,7 +1906,7 @@ func file_repo_proto_init() { } } file_repo_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCommitDivergencesRequest); i { + switch v := v.(*GetSubmoduleResponse); i { case 0: return &v.state case 1: @@ -1799,7 +1918,7 @@ func file_repo_proto_init() { } } file_repo_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommitDivergenceRequest); i { + switch v := v.(*Submodule); i { case 0: return &v.state case 1: @@ -1811,7 +1930,7 @@ func file_repo_proto_init() { } } file_repo_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCommitDivergencesResponse); i { + switch v := v.(*GetCommitDivergencesRequest); i { case 0: return &v.state case 1: @@ -1823,6 +1942,30 @@ func file_repo_proto_init() { } } file_repo_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommitDivergenceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_repo_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCommitDivergencesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_repo_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CommitDivergence); i { case 0: return &v.state @@ -1845,7 +1988,7 @@ func file_repo_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_repo_proto_rawDesc, NumEnums: 2, - NumMessages: 20, + NumMessages: 22, NumExtensions: 0, NumServices: 1, }, diff --git a/gitrpc/rpc/repo_grpc.pb.go b/gitrpc/rpc/repo_grpc.pb.go index 8ba7814d8..77566bf38 100644 --- a/gitrpc/rpc/repo_grpc.pb.go +++ b/gitrpc/rpc/repo_grpc.pb.go @@ -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 @@ -28,6 +28,7 @@ type RepositoryServiceClient interface { GetSubmodule(ctx context.Context, in *GetSubmoduleRequest, opts ...grpc.CallOption) (*GetSubmoduleResponse, error) GetBlob(ctx context.Context, in *GetBlobRequest, opts ...grpc.CallOption) (*GetBlobResponse, error) ListCommits(ctx context.Context, in *ListCommitsRequest, opts ...grpc.CallOption) (RepositoryService_ListCommitsClient, error) + GetCommit(ctx context.Context, in *GetCommitRequest, opts ...grpc.CallOption) (*GetCommitResponse, error) GetCommitDivergences(ctx context.Context, in *GetCommitDivergencesRequest, opts ...grpc.CallOption) (*GetCommitDivergencesResponse, error) } @@ -164,6 +165,15 @@ func (x *repositoryServiceListCommitsClient) Recv() (*ListCommitsResponse, error return m, nil } +func (c *repositoryServiceClient) GetCommit(ctx context.Context, in *GetCommitRequest, opts ...grpc.CallOption) (*GetCommitResponse, error) { + out := new(GetCommitResponse) + err := c.cc.Invoke(ctx, "/rpc.RepositoryService/GetCommit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *repositoryServiceClient) GetCommitDivergences(ctx context.Context, in *GetCommitDivergencesRequest, opts ...grpc.CallOption) (*GetCommitDivergencesResponse, error) { out := new(GetCommitDivergencesResponse) err := c.cc.Invoke(ctx, "/rpc.RepositoryService/GetCommitDivergences", in, out, opts...) @@ -183,6 +193,7 @@ type RepositoryServiceServer interface { GetSubmodule(context.Context, *GetSubmoduleRequest) (*GetSubmoduleResponse, error) GetBlob(context.Context, *GetBlobRequest) (*GetBlobResponse, error) ListCommits(*ListCommitsRequest, RepositoryService_ListCommitsServer) error + GetCommit(context.Context, *GetCommitRequest) (*GetCommitResponse, error) GetCommitDivergences(context.Context, *GetCommitDivergencesRequest) (*GetCommitDivergencesResponse, error) mustEmbedUnimplementedRepositoryServiceServer() } @@ -209,6 +220,9 @@ func (UnimplementedRepositoryServiceServer) GetBlob(context.Context, *GetBlobReq func (UnimplementedRepositoryServiceServer) ListCommits(*ListCommitsRequest, RepositoryService_ListCommitsServer) error { return status.Errorf(codes.Unimplemented, "method ListCommits not implemented") } +func (UnimplementedRepositoryServiceServer) GetCommit(context.Context, *GetCommitRequest) (*GetCommitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCommit not implemented") +} func (UnimplementedRepositoryServiceServer) GetCommitDivergences(context.Context, *GetCommitDivergencesRequest) (*GetCommitDivergencesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCommitDivergences not implemented") } @@ -347,6 +361,24 @@ func (x *repositoryServiceListCommitsServer) Send(m *ListCommitsResponse) error return x.ServerStream.SendMsg(m) } +func _RepositoryService_GetCommit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCommitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RepositoryServiceServer).GetCommit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rpc.RepositoryService/GetCommit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RepositoryServiceServer).GetCommit(ctx, req.(*GetCommitRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _RepositoryService_GetCommitDivergences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetCommitDivergencesRequest) if err := dec(in); err != nil { @@ -384,6 +416,10 @@ var RepositoryService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetBlob", Handler: _RepositoryService_GetBlob_Handler, }, + { + MethodName: "GetCommit", + Handler: _RepositoryService_GetCommit_Handler, + }, { MethodName: "GetCommitDivergences", Handler: _RepositoryService_GetCommitDivergences_Handler, diff --git a/internal/webhook/branch.go b/internal/webhook/branch.go index bcf6cafff..be5b9fb81 100644 --- a/internal/webhook/branch.go +++ b/internal/webhook/branch.go @@ -6,8 +6,11 @@ package webhook import ( "context" + "errors" + "fmt" "github.com/harness/gitness/events" + "github.com/harness/gitness/gitrpc" gitevents "github.com/harness/gitness/internal/events/git" "github.com/harness/gitness/types" "github.com/harness/gitness/types/enum" @@ -23,6 +26,7 @@ type BranchBody struct { Ref string `json:"ref"` Before string `json:"before"` After string `json:"after"` + Commit *CommitInfo `json:"commit"` // Forced bool `json:"forced"` TODO: data has to be calculated explicitly } @@ -30,17 +34,22 @@ type BranchBody struct { // and triggers branch created webhooks for the source repo. func (s *Server) handleEventBranchCreated(ctx context.Context, event *events.Event[*gitevents.BranchCreatedPayload]) error { - return s.triggerWebhooksForEventWithRepoAndPrincipal(ctx, enum.WebhookTriggerBranchCreated, + return s.triggerForEventWithRepoAndPrincipal(ctx, enum.WebhookTriggerBranchCreated, event.ID, event.Payload.RepoID, event.Payload.PrincipalID, - func(repo *types.Repository, principal *types.Principal) interface{} { + func(repo *types.Repository, principal *types.Principal) (any, error) { + commitInfo, err := s.fetchCommitInfoForEvent(ctx, repo.GitUID, event.Payload.SHA) + if err != nil { + return nil, err + } return &BranchBody{ Trigger: enum.WebhookTriggerBranchCreated, - Repo: repositoryInfoFrom(repo, s.urlProvider), - Principal: principalInfoFrom(principal), + Repo: repositoryInfoFrom(*repo, s.urlProvider), + Principal: principalInfoFrom(*principal), Ref: event.Payload.Ref, Before: types.NilSHA, After: event.Payload.SHA, - } + Commit: &commitInfo, + }, nil }) } @@ -48,18 +57,24 @@ func (s *Server) handleEventBranchCreated(ctx context.Context, // and triggers branch updated webhooks for the source repo. func (s *Server) handleEventBranchUpdated(ctx context.Context, event *events.Event[*gitevents.BranchUpdatedPayload]) error { - return s.triggerWebhooksForEventWithRepoAndPrincipal(ctx, enum.WebhookTriggerBranchUpdated, + return s.triggerForEventWithRepoAndPrincipal(ctx, enum.WebhookTriggerBranchUpdated, event.ID, event.Payload.RepoID, event.Payload.PrincipalID, - func(repo *types.Repository, principal *types.Principal) interface{} { + func(repo *types.Repository, principal *types.Principal) (any, error) { + commitInfo, err := s.fetchCommitInfoForEvent(ctx, repo.GitUID, event.Payload.NewSHA) + if err != nil { + return nil, err + } + return &BranchBody{ Trigger: enum.WebhookTriggerBranchUpdated, - Repo: repositoryInfoFrom(repo, s.urlProvider), - Principal: principalInfoFrom(principal), + Repo: repositoryInfoFrom(*repo, s.urlProvider), + Principal: principalInfoFrom(*principal), Ref: event.Payload.Ref, Before: event.Payload.OldSHA, After: event.Payload.NewSHA, + Commit: &commitInfo, // Forced: true/false, // TODO: data not available yet - } + }, nil }) } @@ -67,16 +82,36 @@ func (s *Server) handleEventBranchUpdated(ctx context.Context, // and triggers branch deleted webhooks for the source repo. func (s *Server) handleEventBranchDeleted(ctx context.Context, event *events.Event[*gitevents.BranchDeletedPayload]) error { - return s.triggerWebhooksForEventWithRepoAndPrincipal(ctx, enum.WebhookTriggerBranchDeleted, + return s.triggerForEventWithRepoAndPrincipal(ctx, enum.WebhookTriggerBranchDeleted, event.ID, event.Payload.RepoID, event.Payload.PrincipalID, - func(repo *types.Repository, principal *types.Principal) interface{} { + func(repo *types.Repository, principal *types.Principal) (any, error) { return &BranchBody{ Trigger: enum.WebhookTriggerBranchDeleted, - Repo: repositoryInfoFrom(repo, s.urlProvider), - Principal: principalInfoFrom(principal), + Repo: repositoryInfoFrom(*repo, s.urlProvider), + Principal: principalInfoFrom(*principal), Ref: event.Payload.Ref, Before: event.Payload.SHA, After: types.NilSHA, - } + }, nil }) } + +func (s *Server) fetchCommitInfoForEvent(ctx context.Context, repoUID string, sha string) (CommitInfo, error) { + out, err := s.gitRPCClient.GetCommit(ctx, &gitrpc.GetCommitParams{ + ReadParams: gitrpc.ReadParams{ + RepoUID: repoUID, + }, + SHA: sha, + }) + + if errors.Is(err, gitrpc.ErrNotFound) { + // this could happen if the commit has been deleted and garbage collected by now - discard event + return CommitInfo{}, events.NewDiscardEventErrorf("commit with sha '%s' doesn't exist anymore", sha) + } + + if err != nil { + return CommitInfo{}, fmt.Errorf("failed to get commit with sha '%s': %w", sha, err) + } + + return commitInfoFrom(out.Commit), nil +} diff --git a/internal/webhook/common.go b/internal/webhook/common.go index 01225a506..855edfa06 100644 --- a/internal/webhook/common.go +++ b/internal/webhook/common.go @@ -5,6 +5,9 @@ package webhook import ( + "time" + + "github.com/harness/gitness/gitrpc" "github.com/harness/gitness/internal/url" "github.com/harness/gitness/types" ) @@ -20,7 +23,7 @@ type RepositoryInfo struct { } // repositoryInfoFrom gets the RespositoryInfo from a types.Repository. -func repositoryInfoFrom(repo *types.Repository, urlProvider *url.Provider) RepositoryInfo { +func repositoryInfoFrom(repo types.Repository, urlProvider *url.Provider) RepositoryInfo { return RepositoryInfo{ ID: repo.ID, Path: repo.Path, @@ -40,7 +43,7 @@ type PrincipalInfo struct { } // principalInfoFrom gets the PrincipalInfo from a types.Principal. -func principalInfoFrom(principal *types.Principal) PrincipalInfo { +func principalInfoFrom(principal types.Principal) PrincipalInfo { return PrincipalInfo{ ID: principal.ID, UID: principal.UID, @@ -48,3 +51,52 @@ func principalInfoFrom(principal *types.Principal) PrincipalInfo { Email: principal.Email, } } + +// CommitInfo describes the commit related info for a webhook payload. +// NOTE: don't use types package as we want webhook payload to be independent from API calls. +type CommitInfo struct { + SHA string `json:"sha"` + Message string `json:"message"` + Author SignatureInfo `json:"author"` + Committer SignatureInfo `json:"committer"` +} + +// commitInfoFrom gets the CommitInfo from a gitrpc.Commit. +func commitInfoFrom(commit gitrpc.Commit) CommitInfo { + return CommitInfo{ + SHA: commit.SHA, + Message: commit.Message, + Author: signatureInfoFrom(commit.Author), + Committer: signatureInfoFrom(commit.Committer), + } +} + +// SignatureInfo describes the commit signature related info for a webhook payload. +// NOTE: don't use types package as we want webhook payload to be independent from API calls. +type SignatureInfo struct { + Identity IdentityInfo `json:"identity"` + When time.Time `json:"when"` +} + +// signatureInfoFrom gets the SignatureInfo from a gitrpc.Signature. +func signatureInfoFrom(signature gitrpc.Signature) SignatureInfo { + return SignatureInfo{ + Identity: identityInfoFrom(signature.Identity), + When: signature.When, + } +} + +// IdentityInfo describes the signature identity related info for a webhook payload. +// NOTE: don't use types package as we want webhook payload to be independent from API calls. +type IdentityInfo struct { + Name string `json:"name"` + Email string `json:"email"` +} + +// identityInfoFrom gets the IdentityInfo from a gitrpc.Identity. +func identityInfoFrom(identity gitrpc.Identity) IdentityInfo { + return IdentityInfo{ + Name: identity.Name, + Email: identity.Email, + } +} diff --git a/internal/webhook/events.go b/internal/webhook/events.go index 9f1e81388..3c5363028 100644 --- a/internal/webhook/events.go +++ b/internal/webhook/events.go @@ -22,12 +22,12 @@ func generateTriggerIDFromEventID(eventID string) string { return fmt.Sprintf("event-%s", eventID) } -// triggerWebhooksForEventWithRepoAndPrincipal triggers all webhooks for the given repo and triggerType +// triggerForEventWithRepoAndPrincipal triggers all webhooks for the given repo and triggerType // using the eventID to generate a deterministic triggerID and using the output of bodyFn as payload. // The method tries to find the repository and principal and provides both to the bodyFn to generate the body. -func (s *Server) triggerWebhooksForEventWithRepoAndPrincipal(ctx context.Context, +func (s *Server) triggerForEventWithRepoAndPrincipal(ctx context.Context, triggerType enum.WebhookTrigger, eventID string, repoID int64, principalID int64, - createBodyFn func(*types.Repository, *types.Principal) interface{}) error { + createBodyFn func(*types.Repository, *types.Principal) (any, error)) error { // NOTE: technically we could avoid this call if we send the data via the event (though then events will get big) repo, err := s.findRepositoryForEvent(ctx, repoID) if err != nil { @@ -41,9 +41,12 @@ func (s *Server) triggerWebhooksForEventWithRepoAndPrincipal(ctx context.Context } // create body - body := createBodyFn(repo, principal) + body, err := createBodyFn(repo, principal) + if err != nil { + return fmt.Errorf("body creation function failed: %w", err) + } - return s.triggerWebhooksForEvent(ctx, eventID, enum.WebhookParentRepo, repo.ID, triggerType, body) + return s.triggerForEvent(ctx, eventID, enum.WebhookParentRepo, repo.ID, triggerType, body) } // findRepositoryForEvent finds the repository for the provided repoID. @@ -78,10 +81,10 @@ func (s *Server) findPrincipalForEvent(ctx context.Context, principalID int64) ( return principal, nil } -// triggerWebhooksForEvent triggers all webhooks for the given parentType/ID and triggerType +// triggerForEvent triggers all webhooks for the given parentType/ID and triggerType // using the eventID to generate a deterministic triggerID and sending the provided body as payload. -func (s *Server) triggerWebhooksForEvent(ctx context.Context, eventID string, - parentType enum.WebhookParent, parentID int64, triggerType enum.WebhookTrigger, body interface{}) error { +func (s *Server) triggerForEvent(ctx context.Context, eventID string, + parentType enum.WebhookParent, parentID int64, triggerType enum.WebhookTrigger, body any) error { triggerID := generateTriggerIDFromEventID(eventID) results, err := s.triggerWebhooksFor(ctx, parentType, parentID, triggerID, triggerType, body) diff --git a/internal/webhook/server.go b/internal/webhook/server.go index fd0859e9e..7b88fa870 100644 --- a/internal/webhook/server.go +++ b/internal/webhook/server.go @@ -11,6 +11,7 @@ import ( "time" "github.com/harness/gitness/events" + "github.com/harness/gitness/gitrpc" gitevents "github.com/harness/gitness/internal/events/git" "github.com/harness/gitness/internal/store" "github.com/harness/gitness/internal/url" @@ -36,6 +37,7 @@ type Server struct { urlProvider *url.Provider repoStore store.RepoStore principalStore store.PrincipalStore + gitRPCClient gitrpc.Interface readerCanceler *events.ReaderCanceler secureHTTPClient *http.Client @@ -46,13 +48,14 @@ func NewServer(ctx context.Context, config Config, gitReaderFactory *events.ReaderFactory[*gitevents.Reader], webhookStore store.WebhookStore, webhookExecutionStore store.WebhookExecutionStore, repoStore store.RepoStore, urlProvider *url.Provider, - principalStore store.PrincipalStore) (*Server, error) { + principalStore store.PrincipalStore, gitRPCClient gitrpc.Interface) (*Server, error) { server := &Server{ webhookStore: webhookStore, webhookExecutionStore: webhookExecutionStore, repoStore: repoStore, urlProvider: urlProvider, principalStore: principalStore, + gitRPCClient: gitRPCClient, // set after launching factory readerCanceler: nil, diff --git a/internal/webhook/trigger.go b/internal/webhook/trigger.go index 20c47ec2d..e15609516 100644 --- a/internal/webhook/trigger.go +++ b/internal/webhook/trigger.go @@ -57,7 +57,7 @@ func (r *TriggerResult) Skipped() bool { } func (s *Server) triggerWebhooksFor(ctx context.Context, parentType enum.WebhookParent, parentID int64, - triggerID string, triggerType enum.WebhookTrigger, body interface{}) ([]TriggerResult, error) { + triggerID string, triggerType enum.WebhookTrigger, body any) ([]TriggerResult, error) { // get all webhooks for the given parent // NOTE: there never should be even close to 1000 webhooks for a repo (that should be blocked in the future). // We just use 1000 as a safe number to get all hooks @@ -71,7 +71,7 @@ func (s *Server) triggerWebhooksFor(ctx context.Context, parentType enum.Webhook //nolint:gocognit // refactor if needed func (s *Server) triggerWebhooks(ctx context.Context, webhooks []*types.Webhook, - triggerID string, triggerType enum.WebhookTrigger, body interface{}) ([]TriggerResult, error) { + triggerID string, triggerType enum.WebhookTrigger, body any) ([]TriggerResult, error) { // return immediately if webhooks are empty if len(webhooks) == 0 { return []TriggerResult{}, nil @@ -168,7 +168,7 @@ func (s *Server) RetriggerWebhookExecution(ctx context.Context, webhookExecution } func (s *Server) executeWebhook(ctx context.Context, webhook *types.Webhook, triggerID string, - triggerType enum.WebhookTrigger, body interface{}, rerunOfID *int64) (*types.WebhookExecution, error) { + triggerType enum.WebhookTrigger, body any, rerunOfID *int64) (*types.WebhookExecution, error) { // build execution entry on the fly (save no matter what) execution := types.WebhookExecution{ RetriggerOf: rerunOfID, @@ -255,7 +255,7 @@ func (s *Server) executeWebhook(ctx context.Context, webhook *types.Webhook, tri // All execution.Request.XXX values are set accordingly // NOTE: if the body is an io.Reader, the value is used as response body as is, otherwise it'll be JSON serialized. func prepareHTTPRequest(ctx context.Context, execution *types.WebhookExecution, - webhook *types.Webhook, body interface{}) (*http.Request, error) { + webhook *types.Webhook, body any) (*http.Request, error) { // set URL as is (already has been validated, any other error will be caught in request creation) execution.Request.URL = webhook.URL diff --git a/internal/webhook/wire.go b/internal/webhook/wire.go index 32336e37b..920fb654c 100644 --- a/internal/webhook/wire.go +++ b/internal/webhook/wire.go @@ -8,6 +8,7 @@ import ( "context" "github.com/harness/gitness/events" + "github.com/harness/gitness/gitrpc" gitevents "github.com/harness/gitness/internal/events/git" "github.com/harness/gitness/internal/store" "github.com/harness/gitness/internal/url" @@ -24,7 +25,7 @@ func ProvideServer(ctx context.Context, config Config, gitReaderFactory *events.ReaderFactory[*gitevents.Reader], webhookStore store.WebhookStore, webhookExecutionStore store.WebhookExecutionStore, repoStore store.RepoStore, urlProvider *url.Provider, - principalStore store.PrincipalStore) (*Server, error) { + principalStore store.PrincipalStore, gitRPCClient gitrpc.Interface) (*Server, error) { return NewServer(ctx, config, gitReaderFactory, webhookStore, webhookExecutionStore, - repoStore, urlProvider, principalStore) + repoStore, urlProvider, principalStore, gitRPCClient) }