[Tags] Improvements towards creation / listing /deletion (#220)

This commit is contained in:
Johannes Batzill 2023-07-25 00:04:47 +00:00 committed by Harness
parent 33cf26683d
commit c7e3620de9
19 changed files with 530 additions and 371 deletions

View File

@ -17,7 +17,7 @@ type Interface interface {
GetSubmodule(ctx context.Context, params *GetSubmoduleParams) (*GetSubmoduleOutput, error) GetSubmodule(ctx context.Context, params *GetSubmoduleParams) (*GetSubmoduleOutput, error)
GetBlob(ctx context.Context, params *GetBlobParams) (*GetBlobOutput, error) GetBlob(ctx context.Context, params *GetBlobParams) (*GetBlobOutput, error)
CreateBranch(ctx context.Context, params *CreateBranchParams) (*CreateBranchOutput, error) CreateBranch(ctx context.Context, params *CreateBranchParams) (*CreateBranchOutput, error)
CreateTag(ctx context.Context, params *CreateTagParams) (*CreateTagOutput, error) CreateCommitTag(ctx context.Context, params *CreateCommitTagParams) (*CreateCommitTagOutput, error)
DeleteTag(ctx context.Context, params *DeleteTagParams) error DeleteTag(ctx context.Context, params *DeleteTagParams) error
GetBranch(ctx context.Context, params *GetBranchParams) (*GetBranchOutput, error) GetBranch(ctx context.Context, params *GetBranchParams) (*GetBranchOutput, error)
DeleteBranch(ctx context.Context, params *DeleteBranchParams) error DeleteBranch(ctx context.Context, params *DeleteBranchParams) error

View File

@ -39,16 +39,38 @@ func (g Adapter) GetAnnotatedTags(ctx context.Context, repoPath string, shas []s
return giteaGetAnnotatedTags(ctx, repoPath, shas) return giteaGetAnnotatedTags(ctx, repoPath, shas)
} }
func (g Adapter) CreateAnnotatedTag( // CreateTag creates the tag pointing at the provided SHA (could be any type, e.g. commit, tag, blob, ...)
func (g Adapter) CreateTag(
ctx context.Context, ctx context.Context,
repoPath string, repoPath string,
request *types.CreateTagRequest, name string,
targetSHA string,
opts *types.CreateTagOptions,
) error { ) error {
cmd := gitea.NewCommand(ctx, "tag", "-a", "-m", request.Message, "--", request.Name, request.TargetSha) args := []string{
env := []string{ "tag",
"GIT_COMMITTER_NAME=" + request.TaggerName,
"GIT_COMMITTER_EMAIL=" + request.TaggerEmail,
} }
env := []string{}
if opts != nil && opts.Message != "" {
args = append(args,
"-m",
opts.Message,
)
env = append(env,
"GIT_COMMITTER_NAME="+opts.Tagger.Identity.Name,
"GIT_COMMITTER_EMAIL="+opts.Tagger.Identity.Email,
"GIT_COMMITTER_DATE="+opts.Tagger.When.Format(time.RFC3339),
)
}
args = append(args,
"--",
name,
targetSHA,
)
cmd := gitea.NewCommand(ctx, args...)
_, _, err := cmd.RunStdString(&gitea.RunOpts{Dir: repoPath, Env: env}) _, _, err := cmd.RunStdString(&gitea.RunOpts{Dir: repoPath, Env: env})
if err != nil { if err != nil {
return processGiteaErrorf(err, "Service failed to create a tag") return processGiteaErrorf(err, "Service failed to create a tag")

View File

@ -62,7 +62,7 @@ func (s ReferenceService) CreateBranch(ctx context.Context,
} }
// get target commit (as target could be branch/tag/commit, and tag can't be pushed using source:destination syntax) // get target commit (as target could be branch/tag/commit, and tag can't be pushed using source:destination syntax)
targetCommit, err := sharedRepo.GetCommit(strings.TrimSpace(request.GetTarget())) targetCommit, err := s.adapter.GetCommit(ctx, sharedRepo.tmpPath, strings.TrimSpace(request.GetTarget()))
if git.IsErrNotExist(err) { if git.IsErrNotExist(err) {
return nil, ErrNotFoundf("target '%s' doesn't exist", request.GetTarget()) return nil, ErrNotFoundf("target '%s' doesn't exist", request.GetTarget())
} }
@ -71,7 +71,7 @@ func (s ReferenceService) CreateBranch(ctx context.Context,
} }
// push to new branch (all changes should go through push flow for hooks and other safety meassures) // push to new branch (all changes should go through push flow for hooks and other safety meassures)
err = sharedRepo.PushCommitToBranch(ctx, base, targetCommit.ID.String(), request.GetBranchName()) err = sharedRepo.PushCommitToBranch(ctx, base, targetCommit.SHA, request.GetBranchName())
if err != nil { if err != nil {
return nil, processGitErrorf(err, "failed to push new branch '%s'", request.GetBranchName()) return nil, processGitErrorf(err, "failed to push new branch '%s'", request.GetBranchName())
} }

View File

@ -41,7 +41,7 @@ type GitAdapter interface {
GetFullCommitID(ctx context.Context, repoPath, shortID string) (string, error) GetFullCommitID(ctx context.Context, repoPath, shortID string) (string, error)
GetAnnotatedTag(ctx context.Context, repoPath string, sha string) (*types.Tag, error) GetAnnotatedTag(ctx context.Context, repoPath string, sha string) (*types.Tag, error)
GetAnnotatedTags(ctx context.Context, repoPath string, shas []string) ([]types.Tag, error) GetAnnotatedTags(ctx context.Context, repoPath string, shas []string) ([]types.Tag, error)
CreateAnnotatedTag(ctx context.Context, repoPath string, request *types.CreateTagRequest) error CreateTag(ctx context.Context, repoPath string, name string, targetSHA string, opts *types.CreateTagOptions) error
GetBranch(ctx context.Context, repoPath string, branchName string) (*types.Branch, error) GetBranch(ctx context.Context, repoPath string, branchName string) (*types.Branch, error)
GetCommitDivergences(ctx context.Context, repoPath string, GetCommitDivergences(ctx context.Context, repoPath string,
requests []types.CommitDivergenceRequest, max int32) ([]types.CommitDivergence, error) requests []types.CommitDivergenceRequest, max int32) ([]types.CommitDivergence, error)

View File

@ -156,10 +156,11 @@ func mapRenameDetails(renameDetails []types.PathRenameDetails) []*rpc.RenameDeta
return renameDetailsList return renameDetailsList
} }
func mapCommitTag(tag *types.Tag) *rpc.CommitTag { func mapAnnotatedTag(tag *types.Tag) *rpc.CommitTag {
return &rpc.CommitTag{ return &rpc.CommitTag{
Name: tag.Name, Name: tag.Name,
Sha: tag.Sha, Sha: tag.Sha,
Title: tag.Title,
Message: tag.Message, Message: tag.Message,
Tagger: mapGitSignature(tag.Tagger), Tagger: mapGitSignature(tag.Tagger),
IsAnnotated: true, IsAnnotated: true,

View File

@ -6,7 +6,10 @@ package service
import ( import (
"context" "context"
"errors"
"fmt" "fmt"
"strings"
"time"
"github.com/harness/gitness/gitrpc/internal/types" "github.com/harness/gitness/gitrpc/internal/types"
"github.com/harness/gitness/gitrpc/rpc" "github.com/harness/gitness/gitrpc/rpc"
@ -46,31 +49,53 @@ func (s ReferenceService) ListCommitTags(request *rpc.ListCommitTagsRequest,
} }
} }
// populate annotation data for all annotated tags
if len(annotatedTagSHAs) > 0 { if len(annotatedTagSHAs) > 0 {
var gitTags []types.Tag var aTags []types.Tag
gitTags, err = s.adapter.GetAnnotatedTags(ctx, repoPath, annotatedTagSHAs) aTags, err = s.adapter.GetAnnotatedTags(ctx, repoPath, annotatedTagSHAs)
if err != nil { if err != nil {
return processGitErrorf(err, "failed to get annotated tag") return processGitErrorf(err, "failed to get annotated tag")
} }
ai := 0 // since only some tags are annotated, we need second index ai := 0 // index for annotated tags
for i := range tags { ri := 0 // read index for all tags
if !tags[i].IsAnnotated { wi := 0 // write index for all tags (as we might remove some non-commit tags)
for ; ri < len(tags); ri++ {
// always copy the current read element to the latest write position (doesn't mean it's kept)
tags[wi] = tags[ri]
commitSHAs[wi] = commitSHAs[ri]
// keep the tag as is if it's not annotated
if !tags[ri].IsAnnotated {
wi++
continue
}
// filter out annotated tags that don't point to commit objects (blobs, trees, nested tags, ...)
// we don't actually wanna write it, so keep write index
// TODO: Support proper pagination: https://harness.atlassian.net/browse/CODE-669
if aTags[ai].TargetType != types.GitObjectTypeCommit {
ai++
continue continue
} }
// correct the commitSHA for the annotated tag (currently it is the tag sha, not the commit sha) // correct the commitSHA for the annotated tag (currently it is the tag sha, not the commit sha)
// NOTE: This is required as otherwise gitea will wrongly set the committer to the tagger signature. // NOTE: This is required as otherwise gitea will wrongly set the committer to the tagger signature.
commitSHAs[i] = gitTags[ai].TargetSha commitSHAs[wi] = aTags[ai].TargetSha
// update tag information with annotation details // update tag information with annotation details
// NOTE: we keep the name from the reference and ignore the annotated name (similar to github) // NOTE: we keep the name from the reference and ignore the annotated name (similar to github)
tags[i].Message = gitTags[ai].Message tags[wi].Message = aTags[ai].Message
tags[i].Title = gitTags[ai].Title tags[wi].Title = aTags[ai].Title
tags[i].Tagger = mapGitSignature(gitTags[ai].Tagger) tags[wi].Tagger = mapGitSignature(aTags[ai].Tagger)
ai++ ai++
wi++
} }
// truncate slices based on what was removed
tags = tags[:wi]
commitSHAs = commitSHAs[:wi]
} }
// get commits if needed (single call for perf savings: 1s-4s vs 5s-20s) // get commits if needed (single call for perf savings: 1s-4s vs 5s-20s)
@ -185,10 +210,10 @@ func listCommitTagsWalkReferencesHandler(tags *[]*rpc.CommitTag) types.WalkRefer
return nil return nil
} }
} }
func (s ReferenceService) CreateTag( func (s ReferenceService) CreateCommitTag(
ctx context.Context, ctx context.Context,
request *rpc.CreateTagRequest, request *rpc.CreateCommitTagRequest,
) (*rpc.CreateTagResponse, error) { ) (*rpc.CreateCommitTagResponse, error) {
base := request.GetBase() base := request.GetBase()
if base == nil { if base == nil {
return nil, types.ErrBaseCannotBeEmpty return nil, types.ErrBaseCannotBeEmpty
@ -208,35 +233,87 @@ func (s ReferenceService) CreateTag(
defer sharedRepo.Close(ctx) defer sharedRepo.Close(ctx)
// clone repo (with HEAD branch - target might be anything)
err = sharedRepo.Clone(ctx, "") err = sharedRepo.Clone(ctx, "")
if err != nil { if err != nil {
return nil, processGitErrorf(err, "failed to clone shared repo with branch '%s'", request.GetSha()) return nil, processGitErrorf(err, "failed to clone shared repo")
} }
actor := request.GetBase().GetActor()
createTagRequest := types.CreateTagRequest{
Name: request.GetTagName(),
TargetSha: request.GetSha(),
Message: request.GetMessage(),
TaggerEmail: actor.GetEmail(),
TaggerName: actor.GetName(),
}
err = s.adapter.CreateAnnotatedTag(ctx, sharedRepo.tmpPath, &createTagRequest)
// get target commit (as target could be branch/tag/commit, and tag can't be pushed using source:destination syntax)
// NOTE: in case the target is an annotated tag, the targetCommit title and message are that of the tag, not the commit
targetCommit, err := s.adapter.GetCommit(ctx, sharedRepo.tmpPath, strings.TrimSpace(request.GetTarget()))
if git.IsErrNotExist(err) {
return nil, ErrNotFoundf("target '%s' doesn't exist", request.GetTarget())
}
if err != nil { if err != nil {
return nil, processGitErrorf(err, "Failed to create tag %s - %s", request.GetTagName(), err.Error()) return nil, fmt.Errorf("failed to get commit id for target '%s': %w", request.GetTarget(), err)
}
tagger := base.GetActor()
if request.GetTagger() != nil {
tagger = request.GetTagger()
}
taggerDate := time.Now().UTC()
if request.GetTaggerDate() != 0 {
taggerDate = time.Unix(request.GetTaggerDate(), 0)
}
createTagRequest := &types.CreateTagOptions{
Message: request.GetMessage(),
Tagger: types.Signature{
Identity: types.Identity{
Name: tagger.Name,
Email: tagger.Email,
},
When: taggerDate,
},
}
err = s.adapter.CreateTag(
ctx,
sharedRepo.tmpPath,
request.GetTagName(),
targetCommit.SHA,
createTagRequest)
if errors.Is(err, types.ErrAlreadyExists) {
return nil, ErrAlreadyExistsf("tag '%s' already exists", request.GetTagName())
}
if err != nil {
return nil, processGitErrorf(err, "Failed to create tag '%s'", request.GetTagName())
} }
if err = sharedRepo.PushTag(ctx, base, request.GetTagName()); err != nil { if err = sharedRepo.PushTag(ctx, base, request.GetTagName()); err != nil {
return nil, processGitErrorf(err, "Failed to push the tag %s to remote", request.GetTagName()) return nil, processGitErrorf(err, "Failed to push the tag to remote")
} }
var commitTag *rpc.CommitTag
if request.GetMessage() != "" {
tag, err := s.adapter.GetAnnotatedTag(ctx, repoPath, request.GetTagName()) tag, err := s.adapter.GetAnnotatedTag(ctx, repoPath, request.GetTagName())
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("failed to read annotated tag after creation: %w", err)
} }
commitTag := mapCommitTag(tag) commitTag = mapAnnotatedTag(tag)
return &rpc.CreateTagResponse{Tag: commitTag}, nil } else {
commitTag = &rpc.CommitTag{
Name: request.GetTagName(),
IsAnnotated: false,
Sha: targetCommit.SHA,
}
}
// gitea overwrites some commit details in case getCommit(ref) was called with ref being a tag
// To avoid this issue, let's get the commit again using the actual id of the commit
// TODO: can we do this nicer?
rawCommit, err := s.adapter.GetCommit(ctx, repoPath, targetCommit.SHA)
if err != nil {
return nil, fmt.Errorf("failed to get the raw commit '%s' after tag creation: %w", targetCommit.SHA, err)
}
commitTag.Commit, err = mapGitCommit(rawCommit)
if err != nil {
return nil, fmt.Errorf("failed to map target commit after tag creation: %w", err)
}
return &rpc.CreateCommitTagResponse{Tag: commitTag}, nil
} }
func (s ReferenceService) DeleteTag( func (s ReferenceService) DeleteTag(
@ -262,7 +339,8 @@ func (s ReferenceService) DeleteTag(
defer sharedRepo.Close(ctx) defer sharedRepo.Close(ctx)
err = sharedRepo.Clone(ctx, request.GetTagName()) // clone repo (with HEAD branch - tag target might be anything)
err = sharedRepo.Clone(ctx, "")
if err != nil { if err != nil {
return nil, processGitErrorf(err, "failed to clone shared repo with tag '%s'", request.GetTagName()) return nil, processGitErrorf(err, "failed to clone shared repo with tag '%s'", request.GetTagName())
} }

View File

@ -150,12 +150,13 @@ type Tag struct {
Tagger Signature Tagger Signature
} }
type CreateTagRequest struct { type CreateTagOptions struct {
Name string // Message is the optional message the tag will be created with - if the message is empty
TargetSha string // the tag will be lightweight, otherwise it'll be annotated.
Message string Message string
TaggerName string
TaggerEmail string // Tagger is the information used in case the tag is annotated (Message is provided).
Tagger Signature
} }
// Signature represents the Author or Committer information. // Signature represents the Author or Committer information.

View File

@ -23,13 +23,17 @@ type MergeParams struct {
Title string Title string
Message string Message string
// Committer overwrites the git committer used for committing the files (optional, default: actor) // Committer overwrites the git committer used for committing the files
// (optional, default: actor)
Committer *Identity Committer *Identity
// CommitterDate overwrites the git committer date used for committing the files (optional, default: current time) // CommitterDate overwrites the git committer date used for committing the files
// (optional, default: current time on server)
CommitterDate *time.Time CommitterDate *time.Time
// Author overwrites the git author used for committing the files (optional, default: committer) // Author overwrites the git author used for committing the files
// (optional, default: committer)
Author *Identity Author *Identity
// AuthorDate overwrites the git author date used for committing the files (optional, default: committer date) // AuthorDate overwrites the git author date used for committing the files
// (optional, default: committer date)
AuthorDate *time.Time AuthorDate *time.Time
RefType enum.RefType RefType enum.RefType

View File

@ -45,13 +45,17 @@ type CommitFilesParams struct {
NewBranch string NewBranch string
Actions []CommitFileAction Actions []CommitFileAction
// Committer overwrites the git committer used for committing the files (optional, default: actor) // Committer overwrites the git committer used for committing the files
// (optional, default: actor)
Committer *Identity Committer *Identity
// CommitterDate overwrites the git committer date used for committing the files (optional, default: current time) // CommitterDate overwrites the git committer date used for committing the files
// (optional, default: current time on server)
CommitterDate *time.Time CommitterDate *time.Time
// Author overwrites the git author used for committing the files (optional, default: committer) // Author overwrites the git author used for committing the files
// (optional, default: committer)
Author *Identity Author *Identity
// AuthorDate overwrites the git author date used for committing the files (optional, default: committer date) // AuthorDate overwrites the git author date used for committing the files
// (optional, default: committer date)
AuthorDate *time.Time AuthorDate *time.Time
} }

View File

@ -11,21 +11,22 @@ service ReferenceService {
rpc DeleteBranch(DeleteBranchRequest) returns (DeleteBranchResponse); rpc DeleteBranch(DeleteBranchRequest) returns (DeleteBranchResponse);
rpc ListBranches(ListBranchesRequest) returns (stream ListBranchesResponse); rpc ListBranches(ListBranchesRequest) returns (stream ListBranchesResponse);
rpc ListCommitTags(ListCommitTagsRequest) returns (stream ListCommitTagsResponse); rpc ListCommitTags(ListCommitTagsRequest) returns (stream ListCommitTagsResponse);
rpc CreateTag(CreateTagRequest) returns (CreateTagResponse); rpc CreateCommitTag(CreateCommitTagRequest) returns (CreateCommitTagResponse);
rpc DeleteTag(DeleteTagRequest) returns (UpdateRefResponse); rpc DeleteTag(DeleteTagRequest) returns (UpdateRefResponse);
rpc GetRef(GetRefRequest) returns (GetRefResponse); rpc GetRef(GetRefRequest) returns (GetRefResponse);
rpc UpdateRef(UpdateRefRequest) returns (UpdateRefResponse); rpc UpdateRef(UpdateRefRequest) returns (UpdateRefResponse);
} }
message CreateTagRequest { message CreateCommitTagRequest {
WriteRequest base = 1; WriteRequest base = 1;
string sha = 2; string tag_name = 2;
string tag_name = 3; string target = 3;
string message = 4; string message = 4;
Identity tagger = 5;
int64 taggerDate = 6;
} }
message CreateTagResponse { message CreateCommitTagResponse {
CommitTag tag = 1; CommitTag tag = 1;
} }

View File

@ -34,13 +34,17 @@ type CreateRepositoryParams struct {
DefaultBranch string DefaultBranch string
Files []File Files []File
// Committer overwrites the git committer used for committing the files (optional, default: actor) // Committer overwrites the git committer used for committing the files
// (optional, default: actor)
Committer *Identity Committer *Identity
// CommitterDate overwrites the git committer date used for committing the files (optional, default: current time) // CommitterDate overwrites the git committer date used for committing the files
// (optional, default: current time on server)
CommitterDate *time.Time CommitterDate *time.Time
// Author overwrites the git author used for committing the files (optional, default: committer) // Author overwrites the git author used for committing the files
// (optional, default: committer)
Author *Identity Author *Identity
// AuthorDate overwrites the git author date used for committing the files (optional, default: committer date) // AuthorDate overwrites the git author date used for committing the files
// (optional, default: committer date)
AuthorDate *time.Time AuthorDate *time.Time
} }

View File

@ -118,19 +118,21 @@ func (ListCommitTagsRequest_SortOption) EnumDescriptor() ([]byte, []int) {
return file_ref_proto_rawDescGZIP(), []int{12, 0} return file_ref_proto_rawDescGZIP(), []int{12, 0}
} }
type CreateTagRequest struct { type CreateCommitTagRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Base *WriteRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` Base *WriteRequest `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
Sha string `protobuf:"bytes,2,opt,name=sha,proto3" json:"sha,omitempty"` TagName string `protobuf:"bytes,2,opt,name=tag_name,json=tagName,proto3" json:"tag_name,omitempty"`
TagName string `protobuf:"bytes,3,opt,name=tag_name,json=tagName,proto3" json:"tag_name,omitempty"` Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"`
Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
Tagger *Identity `protobuf:"bytes,5,opt,name=tagger,proto3" json:"tagger,omitempty"`
TaggerDate int64 `protobuf:"varint,6,opt,name=taggerDate,proto3" json:"taggerDate,omitempty"`
} }
func (x *CreateTagRequest) Reset() { func (x *CreateCommitTagRequest) Reset() {
*x = CreateTagRequest{} *x = CreateCommitTagRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_ref_proto_msgTypes[0] mi := &file_ref_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -138,13 +140,13 @@ func (x *CreateTagRequest) Reset() {
} }
} }
func (x *CreateTagRequest) String() string { func (x *CreateCommitTagRequest) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*CreateTagRequest) ProtoMessage() {} func (*CreateCommitTagRequest) ProtoMessage() {}
func (x *CreateTagRequest) ProtoReflect() protoreflect.Message { func (x *CreateCommitTagRequest) ProtoReflect() protoreflect.Message {
mi := &file_ref_proto_msgTypes[0] mi := &file_ref_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -156,40 +158,54 @@ func (x *CreateTagRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use CreateTagRequest.ProtoReflect.Descriptor instead. // Deprecated: Use CreateCommitTagRequest.ProtoReflect.Descriptor instead.
func (*CreateTagRequest) Descriptor() ([]byte, []int) { func (*CreateCommitTagRequest) Descriptor() ([]byte, []int) {
return file_ref_proto_rawDescGZIP(), []int{0} return file_ref_proto_rawDescGZIP(), []int{0}
} }
func (x *CreateTagRequest) GetBase() *WriteRequest { func (x *CreateCommitTagRequest) GetBase() *WriteRequest {
if x != nil { if x != nil {
return x.Base return x.Base
} }
return nil return nil
} }
func (x *CreateTagRequest) GetSha() string { func (x *CreateCommitTagRequest) GetTagName() string {
if x != nil {
return x.Sha
}
return ""
}
func (x *CreateTagRequest) GetTagName() string {
if x != nil { if x != nil {
return x.TagName return x.TagName
} }
return "" return ""
} }
func (x *CreateTagRequest) GetMessage() string { func (x *CreateCommitTagRequest) GetTarget() string {
if x != nil {
return x.Target
}
return ""
}
func (x *CreateCommitTagRequest) GetMessage() string {
if x != nil { if x != nil {
return x.Message return x.Message
} }
return "" return ""
} }
type CreateTagResponse struct { func (x *CreateCommitTagRequest) GetTagger() *Identity {
if x != nil {
return x.Tagger
}
return nil
}
func (x *CreateCommitTagRequest) GetTaggerDate() int64 {
if x != nil {
return x.TaggerDate
}
return 0
}
type CreateCommitTagResponse struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
@ -197,8 +213,8 @@ type CreateTagResponse struct {
Tag *CommitTag `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` Tag *CommitTag `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
} }
func (x *CreateTagResponse) Reset() { func (x *CreateCommitTagResponse) Reset() {
*x = CreateTagResponse{} *x = CreateCommitTagResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_ref_proto_msgTypes[1] mi := &file_ref_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -206,13 +222,13 @@ func (x *CreateTagResponse) Reset() {
} }
} }
func (x *CreateTagResponse) String() string { func (x *CreateCommitTagResponse) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*CreateTagResponse) ProtoMessage() {} func (*CreateCommitTagResponse) ProtoMessage() {}
func (x *CreateTagResponse) ProtoReflect() protoreflect.Message { func (x *CreateCommitTagResponse) ProtoReflect() protoreflect.Message {
mi := &file_ref_proto_msgTypes[1] mi := &file_ref_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -224,12 +240,12 @@ func (x *CreateTagResponse) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use CreateTagResponse.ProtoReflect.Descriptor instead. // Deprecated: Use CreateCommitTagResponse.ProtoReflect.Descriptor instead.
func (*CreateTagResponse) Descriptor() ([]byte, []int) { func (*CreateCommitTagResponse) Descriptor() ([]byte, []int) {
return file_ref_proto_rawDescGZIP(), []int{1} return file_ref_proto_rawDescGZIP(), []int{1}
} }
func (x *CreateTagResponse) GetTag() *CommitTag { func (x *CreateCommitTagResponse) GetTag() *CommitTag {
if x != nil { if x != nil {
return x.Tag return x.Tag
} }
@ -1286,184 +1302,190 @@ var File_ref_proto protoreflect.FileDescriptor
var file_ref_proto_rawDesc = []byte{ var file_ref_proto_rawDesc = []byte{
0x0a, 0x09, 0x72, 0x65, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x72, 0x70, 0x63, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x72, 0x70, 0x63,
0x1a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x1a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd3,
0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54,
0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x61, 0x73,
0x0b, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x57, 0x72,
0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65,
0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x61, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
0x74, 0x61, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x28, 0x09, 0x52, 0x07, 0x74, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74,
0x74, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72,
0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x67, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04,
0x65, 0x22, 0x35, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x06, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x06, 0x74, 0x61,
0x54, 0x61, 0x67, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x54, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x67, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x44, 0x61,
0x74, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72,
0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x44, 0x61, 0x74, 0x65, 0x22, 0x3b, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f,
0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x61, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x61, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x20, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x72,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x75, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x52, 0x03, 0x74, 0x61,
0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x67, 0x22, 0x54, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08,
0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x74, 0x61, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x09, 0x52, 0x0a, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x74, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x75, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74,
0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74,
0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x3b, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42,
0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a,
0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e,
0x72, 0x70, 0x63, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e,
0x63, 0x68, 0x22, 0x59, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 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, 0x1f, 0x0a, 0x0b,
0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x38, 0x0a,
0x11, 0x47, 0x65, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52,
0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0x73, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25,
0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x70, 0x63, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52,
0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x72, 0x61, 0x6e, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x72, 0x61, 0x6e,
0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x28, 0x0a, 0x14, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x3b,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68,
0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x22, 0xb6, 0x02, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x72, 0x61,
0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x6e, 0x63, 0x68, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0x59, 0x0a, 0x10, 0x47,
0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x65, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04,
0x62, 0x61, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f,
0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x6e,
0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71,
0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72,
0x79, 0x12, 0x37, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x23, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68,
0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x70,
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x53, 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04,
0x70, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,
0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,
0x22, 0x2d, 0x0a, 0x0a, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b,
0x0a, 0x07, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e,
0x61, 0x6d, 0x65, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x65, 0x10, 0x02, 0x22,
0x3b, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63,
0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x72,
0x61, 0x6e, 0x63, 0x68, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0x53, 0x0a, 0x06,
0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68,
0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x23, 0x0a, 0x06,
0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x03, 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, 0xba, 0x02, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
0x54, 0x61, 0x67, 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, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x6d,
0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75,
0x64, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72,
0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x39,
0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x6f, 0x72, 0x64,
0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53,
0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12,
0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70,
0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18,
0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22,
0x2d, 0x0a, 0x0a, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a,
0x07, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x61,
0x6d, 0x65, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x65, 0x10, 0x02, 0x22, 0x3a,
0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d,
0x69, 0x74, 0x54, 0x61, 0x67, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0xd1, 0x01, 0x0a, 0x09, 0x43,
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03,
0x73, 0x68, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x21,
0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03,
0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65,
0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x12, 0x26, 0x0a, 0x06, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72,
0x65, 0x52, 0x06, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x06, 0x63, 0x6f, 0x6d,
0x6d, 0x69, 0x74, 0x18, 0x07, 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, 0x79,
0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 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, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52,
0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x5f, 0x6e, 0x61, 0x6d, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x66, 0x4e, 0x61, 0x6d, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x72, 0x61, 0x6e,
0x12, 0x27, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x38, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x72, 0x61,
0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x62,
0x52, 0x07, 0x72, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x22, 0x22, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70,
0x52, 0x65, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x63, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68,
0x68, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x22, 0xb7, 0x01, 0x22, 0x73, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68,
0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18,
0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x57, 0x72, 0x69, 0x74,
0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1f,
0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x0a, 0x0b, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x66, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12,
0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x28, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42,
0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x72, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a,
0x09, 0x6e, 0x65, 0x77, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x03, 0x73, 0x68, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x22,
0x52, 0x08, 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x6c, 0xb6, 0x02, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73,
0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18,
0x6c, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64,
0x65, 0x52, 0x65, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xd3, 0x04, 0x0a, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x25, 0x0a,
0x10, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18,
0x65, 0x12, 0x43, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, 0x6f,
0x68, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20,
0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x37, 0x0a, 0x04, 0x73, 0x6f,
0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x72, 0x61, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x6e, 0x63, 0x68, 0x12, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x72, 0x61, 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x73,
0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x70, 0x63, 0x6f, 0x72, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01,
0x2e, 0x47, 0x65, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64,
0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67,
0x63, 0x68, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a,
0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52,
0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x2d, 0x0a, 0x0a, 0x53, 0x6f, 0x72,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x65, 0x66, 0x61, 0x75,
0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x6c, 0x74, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x10, 0x01, 0x12, 0x08,
0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x65, 0x10, 0x02, 0x22, 0x3b, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74,
0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x4b, 0x12, 0x23, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x06, 0x62,
0x12, 0x1a, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0x53, 0x0a, 0x06, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12,
0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x72, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x3a, 0x0a, 0x09, 0x43, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x23, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18,
0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x67, 0x12, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d,
0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0xba, 0x02, 0x0a, 0x15, 0x4c,
0x16, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x67, 0x52, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01,
0x65, 0x54, 0x61, 0x67, 0x12, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71,
0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x70, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e,
0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01,
0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x12, 0x12, 0x2e, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69,
0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x74, 0x1a, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x39, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74,
0x52, 0x65, 0x66, 0x12, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x52, 0x65, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x70, 0x63, 0x74, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x73, 0x6f,
0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x72, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28,
0x73, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x0e, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, 0x65,
0x2f, 0x68, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65,
0x2f, 0x67, 0x69, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08,
0x74, 0x6f, 0x33, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x2d, 0x0a, 0x0a, 0x53, 0x6f, 0x72, 0x74,
0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c,
0x74, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x10, 0x01, 0x12, 0x08, 0x0a,
0x04, 0x44, 0x61, 0x74, 0x65, 0x10, 0x02, 0x22, 0x3a, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x43,
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x20, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x52, 0x03,
0x74, 0x61, 0x67, 0x22, 0xd1, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61,
0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x61, 0x6e,
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69,
0x73, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69,
0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x74, 0x61,
0x67, 0x67, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x72, 0x70, 0x63,
0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x06, 0x74, 0x61, 0x67, 0x67,
0x65, 0x72, 0x12, 0x23, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x07, 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, 0x79, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x65,
0x66, 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, 0x19,
0x0a, 0x08, 0x72, 0x65, 0x66, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x72, 0x65, 0x66, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x08, 0x72, 0x65, 0x66,
0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x52, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x72, 0x65, 0x66, 0x54, 0x79,
0x70, 0x65, 0x22, 0x22, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x22, 0xb7, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x52, 0x65, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x62,
0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x62, 0x61,
0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x66, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a,
0x08, 0x72, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x0c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x72,
0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x5f, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x65, 0x77, 0x56, 0x61,
0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x6c, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x6c, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65,
0x22, 0x13, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x66, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xe5, 0x04, 0x0a, 0x10, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65,
0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63,
0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x3a, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x15, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x72, 0x61,
0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x18, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65,
0x74, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x45, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73,
0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63,
0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x4b, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x43,
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x12, 0x1a, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74,
0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x30, 0x01, 0x12, 0x4c, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f,
0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x12, 0x1b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x3a, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x67, 0x12,
0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x67, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x52, 0x65, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31,
0x0a, 0x06, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x12, 0x12, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47,
0x65, 0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x3a, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x66, 0x12, 0x15,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x66, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x52, 0x65, 0x66, 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 ( var (
@ -1483,8 +1505,8 @@ var file_ref_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
var file_ref_proto_goTypes = []interface{}{ var file_ref_proto_goTypes = []interface{}{
(ListBranchesRequest_SortOption)(0), // 0: rpc.ListBranchesRequest.SortOption (ListBranchesRequest_SortOption)(0), // 0: rpc.ListBranchesRequest.SortOption
(ListCommitTagsRequest_SortOption)(0), // 1: rpc.ListCommitTagsRequest.SortOption (ListCommitTagsRequest_SortOption)(0), // 1: rpc.ListCommitTagsRequest.SortOption
(*CreateTagRequest)(nil), // 2: rpc.CreateTagRequest (*CreateCommitTagRequest)(nil), // 2: rpc.CreateCommitTagRequest
(*CreateTagResponse)(nil), // 3: rpc.CreateTagResponse (*CreateCommitTagResponse)(nil), // 3: rpc.CreateCommitTagResponse
(*DeleteTagRequest)(nil), // 4: rpc.DeleteTagRequest (*DeleteTagRequest)(nil), // 4: rpc.DeleteTagRequest
(*CreateBranchRequest)(nil), // 5: rpc.CreateBranchRequest (*CreateBranchRequest)(nil), // 5: rpc.CreateBranchRequest
(*CreateBranchResponse)(nil), // 6: rpc.CreateBranchResponse (*CreateBranchResponse)(nil), // 6: rpc.CreateBranchResponse
@ -1503,59 +1525,61 @@ var file_ref_proto_goTypes = []interface{}{
(*UpdateRefRequest)(nil), // 19: rpc.UpdateRefRequest (*UpdateRefRequest)(nil), // 19: rpc.UpdateRefRequest
(*UpdateRefResponse)(nil), // 20: rpc.UpdateRefResponse (*UpdateRefResponse)(nil), // 20: rpc.UpdateRefResponse
(*WriteRequest)(nil), // 21: rpc.WriteRequest (*WriteRequest)(nil), // 21: rpc.WriteRequest
(*ReadRequest)(nil), // 22: rpc.ReadRequest (*Identity)(nil), // 22: rpc.Identity
(SortOrder)(0), // 23: rpc.SortOrder (*ReadRequest)(nil), // 23: rpc.ReadRequest
(*Commit)(nil), // 24: rpc.Commit (SortOrder)(0), // 24: rpc.SortOrder
(*Signature)(nil), // 25: rpc.Signature (*Commit)(nil), // 25: rpc.Commit
(RefType)(0), // 26: rpc.RefType (*Signature)(nil), // 26: rpc.Signature
(RefType)(0), // 27: rpc.RefType
} }
var file_ref_proto_depIdxs = []int32{ var file_ref_proto_depIdxs = []int32{
21, // 0: rpc.CreateTagRequest.base:type_name -> rpc.WriteRequest 21, // 0: rpc.CreateCommitTagRequest.base:type_name -> rpc.WriteRequest
16, // 1: rpc.CreateTagResponse.tag:type_name -> rpc.CommitTag 22, // 1: rpc.CreateCommitTagRequest.tagger:type_name -> rpc.Identity
21, // 2: rpc.DeleteTagRequest.base:type_name -> rpc.WriteRequest 16, // 2: rpc.CreateCommitTagResponse.tag:type_name -> rpc.CommitTag
21, // 3: rpc.CreateBranchRequest.base:type_name -> rpc.WriteRequest 21, // 3: rpc.DeleteTagRequest.base:type_name -> rpc.WriteRequest
13, // 4: rpc.CreateBranchResponse.branch:type_name -> rpc.Branch 21, // 4: rpc.CreateBranchRequest.base:type_name -> rpc.WriteRequest
22, // 5: rpc.GetBranchRequest.base:type_name -> rpc.ReadRequest 13, // 5: rpc.CreateBranchResponse.branch:type_name -> rpc.Branch
13, // 6: rpc.GetBranchResponse.branch:type_name -> rpc.Branch 23, // 6: rpc.GetBranchRequest.base:type_name -> rpc.ReadRequest
21, // 7: rpc.DeleteBranchRequest.base:type_name -> rpc.WriteRequest 13, // 7: rpc.GetBranchResponse.branch:type_name -> rpc.Branch
22, // 8: rpc.ListBranchesRequest.base:type_name -> rpc.ReadRequest 21, // 8: rpc.DeleteBranchRequest.base:type_name -> rpc.WriteRequest
0, // 9: rpc.ListBranchesRequest.sort:type_name -> rpc.ListBranchesRequest.SortOption 23, // 9: rpc.ListBranchesRequest.base:type_name -> rpc.ReadRequest
23, // 10: rpc.ListBranchesRequest.order:type_name -> rpc.SortOrder 0, // 10: rpc.ListBranchesRequest.sort:type_name -> rpc.ListBranchesRequest.SortOption
13, // 11: rpc.ListBranchesResponse.branch:type_name -> rpc.Branch 24, // 11: rpc.ListBranchesRequest.order:type_name -> rpc.SortOrder
24, // 12: rpc.Branch.commit:type_name -> rpc.Commit 13, // 12: rpc.ListBranchesResponse.branch:type_name -> rpc.Branch
22, // 13: rpc.ListCommitTagsRequest.base:type_name -> rpc.ReadRequest 25, // 13: rpc.Branch.commit:type_name -> rpc.Commit
1, // 14: rpc.ListCommitTagsRequest.sort:type_name -> rpc.ListCommitTagsRequest.SortOption 23, // 14: rpc.ListCommitTagsRequest.base:type_name -> rpc.ReadRequest
23, // 15: rpc.ListCommitTagsRequest.order:type_name -> rpc.SortOrder 1, // 15: rpc.ListCommitTagsRequest.sort:type_name -> rpc.ListCommitTagsRequest.SortOption
16, // 16: rpc.ListCommitTagsResponse.tag:type_name -> rpc.CommitTag 24, // 16: rpc.ListCommitTagsRequest.order:type_name -> rpc.SortOrder
25, // 17: rpc.CommitTag.tagger:type_name -> rpc.Signature 16, // 17: rpc.ListCommitTagsResponse.tag:type_name -> rpc.CommitTag
24, // 18: rpc.CommitTag.commit:type_name -> rpc.Commit 26, // 18: rpc.CommitTag.tagger:type_name -> rpc.Signature
22, // 19: rpc.GetRefRequest.base:type_name -> rpc.ReadRequest 25, // 19: rpc.CommitTag.commit:type_name -> rpc.Commit
26, // 20: rpc.GetRefRequest.ref_type:type_name -> rpc.RefType 23, // 20: rpc.GetRefRequest.base:type_name -> rpc.ReadRequest
21, // 21: rpc.UpdateRefRequest.base:type_name -> rpc.WriteRequest 27, // 21: rpc.GetRefRequest.ref_type:type_name -> rpc.RefType
26, // 22: rpc.UpdateRefRequest.ref_type:type_name -> rpc.RefType 21, // 22: rpc.UpdateRefRequest.base:type_name -> rpc.WriteRequest
5, // 23: rpc.ReferenceService.CreateBranch:input_type -> rpc.CreateBranchRequest 27, // 23: rpc.UpdateRefRequest.ref_type:type_name -> rpc.RefType
7, // 24: rpc.ReferenceService.GetBranch:input_type -> rpc.GetBranchRequest 5, // 24: rpc.ReferenceService.CreateBranch:input_type -> rpc.CreateBranchRequest
9, // 25: rpc.ReferenceService.DeleteBranch:input_type -> rpc.DeleteBranchRequest 7, // 25: rpc.ReferenceService.GetBranch:input_type -> rpc.GetBranchRequest
11, // 26: rpc.ReferenceService.ListBranches:input_type -> rpc.ListBranchesRequest 9, // 26: rpc.ReferenceService.DeleteBranch:input_type -> rpc.DeleteBranchRequest
14, // 27: rpc.ReferenceService.ListCommitTags:input_type -> rpc.ListCommitTagsRequest 11, // 27: rpc.ReferenceService.ListBranches:input_type -> rpc.ListBranchesRequest
2, // 28: rpc.ReferenceService.CreateTag:input_type -> rpc.CreateTagRequest 14, // 28: rpc.ReferenceService.ListCommitTags:input_type -> rpc.ListCommitTagsRequest
4, // 29: rpc.ReferenceService.DeleteTag:input_type -> rpc.DeleteTagRequest 2, // 29: rpc.ReferenceService.CreateCommitTag:input_type -> rpc.CreateCommitTagRequest
17, // 30: rpc.ReferenceService.GetRef:input_type -> rpc.GetRefRequest 4, // 30: rpc.ReferenceService.DeleteTag:input_type -> rpc.DeleteTagRequest
19, // 31: rpc.ReferenceService.UpdateRef:input_type -> rpc.UpdateRefRequest 17, // 31: rpc.ReferenceService.GetRef:input_type -> rpc.GetRefRequest
6, // 32: rpc.ReferenceService.CreateBranch:output_type -> rpc.CreateBranchResponse 19, // 32: rpc.ReferenceService.UpdateRef:input_type -> rpc.UpdateRefRequest
8, // 33: rpc.ReferenceService.GetBranch:output_type -> rpc.GetBranchResponse 6, // 33: rpc.ReferenceService.CreateBranch:output_type -> rpc.CreateBranchResponse
10, // 34: rpc.ReferenceService.DeleteBranch:output_type -> rpc.DeleteBranchResponse 8, // 34: rpc.ReferenceService.GetBranch:output_type -> rpc.GetBranchResponse
12, // 35: rpc.ReferenceService.ListBranches:output_type -> rpc.ListBranchesResponse 10, // 35: rpc.ReferenceService.DeleteBranch:output_type -> rpc.DeleteBranchResponse
15, // 36: rpc.ReferenceService.ListCommitTags:output_type -> rpc.ListCommitTagsResponse 12, // 36: rpc.ReferenceService.ListBranches:output_type -> rpc.ListBranchesResponse
3, // 37: rpc.ReferenceService.CreateTag:output_type -> rpc.CreateTagResponse 15, // 37: rpc.ReferenceService.ListCommitTags:output_type -> rpc.ListCommitTagsResponse
20, // 38: rpc.ReferenceService.DeleteTag:output_type -> rpc.UpdateRefResponse 3, // 38: rpc.ReferenceService.CreateCommitTag:output_type -> rpc.CreateCommitTagResponse
18, // 39: rpc.ReferenceService.GetRef:output_type -> rpc.GetRefResponse 20, // 39: rpc.ReferenceService.DeleteTag:output_type -> rpc.UpdateRefResponse
20, // 40: rpc.ReferenceService.UpdateRef:output_type -> rpc.UpdateRefResponse 18, // 40: rpc.ReferenceService.GetRef:output_type -> rpc.GetRefResponse
32, // [32:41] is the sub-list for method output_type 20, // 41: rpc.ReferenceService.UpdateRef:output_type -> rpc.UpdateRefResponse
23, // [23:32] is the sub-list for method input_type 33, // [33:42] is the sub-list for method output_type
23, // [23:23] is the sub-list for extension type_name 24, // [24:33] is the sub-list for method input_type
23, // [23:23] is the sub-list for extension extendee 24, // [24:24] is the sub-list for extension type_name
0, // [0:23] is the sub-list for field type_name 24, // [24:24] is the sub-list for extension extendee
0, // [0:24] is the sub-list for field type_name
} }
func init() { file_ref_proto_init() } func init() { file_ref_proto_init() }
@ -1566,7 +1590,7 @@ func file_ref_proto_init() {
file_shared_proto_init() file_shared_proto_init()
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_ref_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_ref_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateTagRequest); i { switch v := v.(*CreateCommitTagRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1578,7 +1602,7 @@ func file_ref_proto_init() {
} }
} }
file_ref_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_ref_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateTagResponse); i { switch v := v.(*CreateCommitTagResponse); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:

View File

@ -27,7 +27,7 @@ type ReferenceServiceClient interface {
DeleteBranch(ctx context.Context, in *DeleteBranchRequest, opts ...grpc.CallOption) (*DeleteBranchResponse, error) DeleteBranch(ctx context.Context, in *DeleteBranchRequest, opts ...grpc.CallOption) (*DeleteBranchResponse, error)
ListBranches(ctx context.Context, in *ListBranchesRequest, opts ...grpc.CallOption) (ReferenceService_ListBranchesClient, error) ListBranches(ctx context.Context, in *ListBranchesRequest, opts ...grpc.CallOption) (ReferenceService_ListBranchesClient, error)
ListCommitTags(ctx context.Context, in *ListCommitTagsRequest, opts ...grpc.CallOption) (ReferenceService_ListCommitTagsClient, error) ListCommitTags(ctx context.Context, in *ListCommitTagsRequest, opts ...grpc.CallOption) (ReferenceService_ListCommitTagsClient, error)
CreateTag(ctx context.Context, in *CreateTagRequest, opts ...grpc.CallOption) (*CreateTagResponse, error) CreateCommitTag(ctx context.Context, in *CreateCommitTagRequest, opts ...grpc.CallOption) (*CreateCommitTagResponse, error)
DeleteTag(ctx context.Context, in *DeleteTagRequest, opts ...grpc.CallOption) (*UpdateRefResponse, error) DeleteTag(ctx context.Context, in *DeleteTagRequest, opts ...grpc.CallOption) (*UpdateRefResponse, error)
GetRef(ctx context.Context, in *GetRefRequest, opts ...grpc.CallOption) (*GetRefResponse, error) GetRef(ctx context.Context, in *GetRefRequest, opts ...grpc.CallOption) (*GetRefResponse, error)
UpdateRef(ctx context.Context, in *UpdateRefRequest, opts ...grpc.CallOption) (*UpdateRefResponse, error) UpdateRef(ctx context.Context, in *UpdateRefRequest, opts ...grpc.CallOption) (*UpdateRefResponse, error)
@ -132,9 +132,9 @@ func (x *referenceServiceListCommitTagsClient) Recv() (*ListCommitTagsResponse,
return m, nil return m, nil
} }
func (c *referenceServiceClient) CreateTag(ctx context.Context, in *CreateTagRequest, opts ...grpc.CallOption) (*CreateTagResponse, error) { func (c *referenceServiceClient) CreateCommitTag(ctx context.Context, in *CreateCommitTagRequest, opts ...grpc.CallOption) (*CreateCommitTagResponse, error) {
out := new(CreateTagResponse) out := new(CreateCommitTagResponse)
err := c.cc.Invoke(ctx, "/rpc.ReferenceService/CreateTag", in, out, opts...) err := c.cc.Invoke(ctx, "/rpc.ReferenceService/CreateCommitTag", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -177,7 +177,7 @@ type ReferenceServiceServer interface {
DeleteBranch(context.Context, *DeleteBranchRequest) (*DeleteBranchResponse, error) DeleteBranch(context.Context, *DeleteBranchRequest) (*DeleteBranchResponse, error)
ListBranches(*ListBranchesRequest, ReferenceService_ListBranchesServer) error ListBranches(*ListBranchesRequest, ReferenceService_ListBranchesServer) error
ListCommitTags(*ListCommitTagsRequest, ReferenceService_ListCommitTagsServer) error ListCommitTags(*ListCommitTagsRequest, ReferenceService_ListCommitTagsServer) error
CreateTag(context.Context, *CreateTagRequest) (*CreateTagResponse, error) CreateCommitTag(context.Context, *CreateCommitTagRequest) (*CreateCommitTagResponse, error)
DeleteTag(context.Context, *DeleteTagRequest) (*UpdateRefResponse, error) DeleteTag(context.Context, *DeleteTagRequest) (*UpdateRefResponse, error)
GetRef(context.Context, *GetRefRequest) (*GetRefResponse, error) GetRef(context.Context, *GetRefRequest) (*GetRefResponse, error)
UpdateRef(context.Context, *UpdateRefRequest) (*UpdateRefResponse, error) UpdateRef(context.Context, *UpdateRefRequest) (*UpdateRefResponse, error)
@ -203,8 +203,8 @@ func (UnimplementedReferenceServiceServer) ListBranches(*ListBranchesRequest, Re
func (UnimplementedReferenceServiceServer) ListCommitTags(*ListCommitTagsRequest, ReferenceService_ListCommitTagsServer) error { func (UnimplementedReferenceServiceServer) ListCommitTags(*ListCommitTagsRequest, ReferenceService_ListCommitTagsServer) error {
return status.Errorf(codes.Unimplemented, "method ListCommitTags not implemented") return status.Errorf(codes.Unimplemented, "method ListCommitTags not implemented")
} }
func (UnimplementedReferenceServiceServer) CreateTag(context.Context, *CreateTagRequest) (*CreateTagResponse, error) { func (UnimplementedReferenceServiceServer) CreateCommitTag(context.Context, *CreateCommitTagRequest) (*CreateCommitTagResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateTag not implemented") return nil, status.Errorf(codes.Unimplemented, "method CreateCommitTag not implemented")
} }
func (UnimplementedReferenceServiceServer) DeleteTag(context.Context, *DeleteTagRequest) (*UpdateRefResponse, error) { func (UnimplementedReferenceServiceServer) DeleteTag(context.Context, *DeleteTagRequest) (*UpdateRefResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteTag not implemented") return nil, status.Errorf(codes.Unimplemented, "method DeleteTag not implemented")
@ -324,20 +324,20 @@ func (x *referenceServiceListCommitTagsServer) Send(m *ListCommitTagsResponse) e
return x.ServerStream.SendMsg(m) return x.ServerStream.SendMsg(m)
} }
func _ReferenceService_CreateTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _ReferenceService_CreateCommitTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateTagRequest) in := new(CreateCommitTagRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(ReferenceServiceServer).CreateTag(ctx, in) return srv.(ReferenceServiceServer).CreateCommitTag(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: "/rpc.ReferenceService/CreateTag", FullMethod: "/rpc.ReferenceService/CreateCommitTag",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReferenceServiceServer).CreateTag(ctx, req.(*CreateTagRequest)) return srv.(ReferenceServiceServer).CreateCommitTag(ctx, req.(*CreateCommitTagRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -416,8 +416,8 @@ var ReferenceService_ServiceDesc = grpc.ServiceDesc{
Handler: _ReferenceService_DeleteBranch_Handler, Handler: _ReferenceService_DeleteBranch_Handler,
}, },
{ {
MethodName: "CreateTag", MethodName: "CreateCommitTag",
Handler: _ReferenceService_CreateTag_Handler, Handler: _ReferenceService_CreateCommitTag_Handler,
}, },
{ {
MethodName: "DeleteTag", MethodName: "DeleteTag",

View File

@ -9,6 +9,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"time"
"github.com/harness/gitness/gitrpc/rpc" "github.com/harness/gitness/gitrpc/rpc"
@ -47,14 +48,26 @@ type CommitTag struct {
Commit *Commit Commit *Commit
} }
type CreateTagParams struct { type CreateCommitTagParams struct {
WriteParams WriteParams
Name string Name string
SHA string
// Target is the commit (or points to the commit) the new tag will be pointing to.
Target string
// Message is the optional message the tag will be created with - if the message is empty
// the tag will be lightweight, otherwise it'll be annotated
Message string Message string
// Tagger overwrites the git author used in case the tag is annotated
// (optional, default: actor)
Tagger *Identity
// TaggerDate overwrites the git author date used in case the tag is annotated
// (optional, default: current time on server)
TaggerDate *time.Time
} }
func (p *CreateTagParams) Validate() error { func (p *CreateCommitTagParams) Validate() error {
if p == nil { if p == nil {
return ErrNoParamsProvided return ErrNoParamsProvided
} }
@ -62,16 +75,14 @@ func (p *CreateTagParams) Validate() error {
if p.Name == "" { if p.Name == "" {
return errors.New("tag name cannot be empty") return errors.New("tag name cannot be empty")
} }
if p.SHA == "" { if p.Target == "" {
return errors.New("target cannot be empty") return errors.New("target cannot be empty")
} }
if p.Message == "" {
return errors.New("message cannot be empty")
}
return nil return nil
} }
type CreateTagOutput struct { type CreateCommitTagOutput struct {
CommitTag CommitTag
} }
@ -139,18 +150,20 @@ func (c *Client) ListCommitTags(ctx context.Context, params *ListCommitTagsParam
return output, nil return output, nil
} }
func (c *Client) CreateTag(ctx context.Context, params *CreateTagParams) (*CreateTagOutput, error) { func (c *Client) CreateCommitTag(ctx context.Context, params *CreateCommitTagParams) (*CreateCommitTagOutput, error) {
err := params.Validate() err := params.Validate()
if err != nil { if err != nil {
return nil, err return nil, err
} }
resp, err := c.refService.CreateTag(ctx, &rpc.CreateTagRequest{ resp, err := c.refService.CreateCommitTag(ctx, &rpc.CreateCommitTagRequest{
Base: mapToRPCWriteRequest(params.WriteParams), Base: mapToRPCWriteRequest(params.WriteParams),
Sha: params.SHA, Target: params.Target,
TagName: params.Name, TagName: params.Name,
Message: params.Message, Message: params.Message,
Tagger: mapToRPCIdentityOptional(params.Tagger),
TaggerDate: mapToRPCTimeOptional(params.TaggerDate),
}) })
if err != nil { if err != nil {
@ -163,7 +176,7 @@ func (c *Client) CreateTag(ctx context.Context, params *CreateTagParams) (*Creat
return nil, fmt.Errorf("failed to map rpc tag: %w", err) return nil, fmt.Errorf("failed to map rpc tag: %w", err)
} }
return &CreateTagOutput{ return &CreateCommitTagOutput{
CommitTag: *commitTag, CommitTag: *commitTag,
}, nil }, nil
} }

View File

@ -22,7 +22,7 @@ type CreateBranchInput struct {
// Target is the commit (or points to the commit) the new branch will be pointing to. // Target is the commit (or points to the commit) the new branch will be pointing to.
// If no target is provided, the branch points to the same commit as the default branch of the repo. // If no target is provided, the branch points to the same commit as the default branch of the repo.
Target *string `json:"target"` Target string `json:"target"`
} }
// CreateBranch creates a new branch for a repo. // CreateBranch creates a new branch for a repo.
@ -38,8 +38,8 @@ func (c *Controller) CreateBranch(ctx context.Context, session *auth.Session,
} }
// set target to default branch in case no target was provided // set target to default branch in case no target was provided
if in.Target == nil || *in.Target == "" { if in.Target == "" {
in.Target = &repo.DefaultBranch in.Target = repo.DefaultBranch
} }
err = checkBranchName(in.Name) err = checkBranchName(in.Name)
@ -55,7 +55,7 @@ func (c *Controller) CreateBranch(ctx context.Context, session *auth.Session,
rpcOut, err := c.gitRPCClient.CreateBranch(ctx, &gitrpc.CreateBranchParams{ rpcOut, err := c.gitRPCClient.CreateBranch(ctx, &gitrpc.CreateBranchParams{
WriteParams: writeParams, WriteParams: writeParams,
BranchName: in.Name, BranchName: in.Name,
Target: *in.Target, Target: in.Target,
}) })
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -7,6 +7,7 @@ package repo
import ( import (
"context" "context"
"fmt" "fmt"
"time"
"github.com/harness/gitness/gitrpc" "github.com/harness/gitness/gitrpc"
apiauth "github.com/harness/gitness/internal/api/auth" apiauth "github.com/harness/gitness/internal/api/auth"
@ -14,18 +15,21 @@ import (
"github.com/harness/gitness/types/enum" "github.com/harness/gitness/types/enum"
) )
// CreateBranchInput used for branch creation apis. // CreateCommitTagInput used for tag creation apis.
type CreateTagInput struct { type CreateCommitTagInput struct {
Name string `json:"name"` Name string `json:"name"`
// Target is the commit (or points to the commit) the new branch will be pointing to. // Target is the commit (or points to the commit) the new tag will be pointing to.
// If no target is provided, the branch points to the same commit as the default branch of the repo. // If no target is provided, the tag points to the same commit as the default branch of the repo.
Target *string `json:"target"` Target string `json:"target"`
Message *string `json:"message"`
// Message is the optional message the tag will be created with - if the message is empty
// the tag will be lightweight, otherwise it'll be annotated.
Message string `json:"message"`
} }
// CreateTag creates a new tag for a repo. // CreateCommitTag creates a new tag for a repo.
func (c *Controller) CreateTag(ctx context.Context, session *auth.Session, func (c *Controller) CreateCommitTag(ctx context.Context, session *auth.Session,
repoRef string, in *CreateTagInput) (*CommitTag, error) { repoRef string, in *CreateCommitTagInput) (*CommitTag, error) {
repo, err := c.repoStore.FindByRef(ctx, repoRef) repo, err := c.repoStore.FindByRef(ctx, repoRef)
if err != nil { if err != nil {
return nil, err return nil, err
@ -36,8 +40,8 @@ func (c *Controller) CreateTag(ctx context.Context, session *auth.Session,
} }
// set target to default branch in case no branch or commit was provided // set target to default branch in case no branch or commit was provided
if in.Target == nil || *in.Target == "" { if in.Target == "" {
in.Target = &repo.DefaultBranch in.Target = repo.DefaultBranch
} }
writeParams, err := CreateRPCWriteParams(ctx, c.urlProvider, session, repo) writeParams, err := CreateRPCWriteParams(ctx, c.urlProvider, session, repo)
@ -45,11 +49,14 @@ func (c *Controller) CreateTag(ctx context.Context, session *auth.Session,
return nil, fmt.Errorf("failed to create RPC write params: %w", err) return nil, fmt.Errorf("failed to create RPC write params: %w", err)
} }
rpcOut, err := c.gitRPCClient.CreateTag(ctx, &gitrpc.CreateTagParams{ now := time.Now()
rpcOut, err := c.gitRPCClient.CreateCommitTag(ctx, &gitrpc.CreateCommitTagParams{
WriteParams: writeParams, WriteParams: writeParams,
Name: in.Name, Name: in.Name,
SHA: *in.Target, Target: in.Target,
Message: *in.Message, Message: in.Message,
Tagger: rpcIdentityFromPrincipal(session.Principal),
TaggerDate: &now,
}) })
if err != nil { if err != nil {

View File

@ -23,14 +23,14 @@ func HandleCreateCommitTag(repoCtrl *repo.Controller) http.HandlerFunc {
return return
} }
in := new(repo.CreateTagInput) in := new(repo.CreateCommitTagInput)
err = json.NewDecoder(r.Body).Decode(in) err = json.NewDecoder(r.Body).Decode(in)
if err != nil { if err != nil {
render.BadRequestf(w, "Invalid request body: %s.", err) render.BadRequestf(w, "Invalid request body: %s.", err)
return return
} }
tag, err := repoCtrl.CreateTag(ctx, session, repoRef, in) tag, err := repoCtrl.CreateCommitTag(ctx, session, repoRef, in)
if err != nil { if err != nil {
render.TranslatedUserError(w, err) render.TranslatedUserError(w, err)
return return

View File

@ -134,7 +134,7 @@ type deleteBranchRequest struct {
type createTagRequest struct { type createTagRequest struct {
repoRequest repoRequest
repo.CreateTagInput repo.CreateCommitTagInput
} }
type listTagsRequest struct { type listTagsRequest struct {

View File

@ -14,10 +14,10 @@ import (
"github.com/harness/gitness/store/database/dbtx" "github.com/harness/gitness/store/database/dbtx"
"github.com/harness/gitness/types" "github.com/harness/gitness/types"
"github.com/harness/gitness/types/enum" "github.com/harness/gitness/types/enum"
"github.com/rs/zerolog/log"
"github.com/jmoiron/sqlx" "github.com/jmoiron/sqlx"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/rs/zerolog/log"
) )
var _ store.MembershipStore = (*MembershipStore)(nil) var _ store.MembershipStore = (*MembershipStore)(nil)