From c464f857ae7e166ed24566d95fcf8b77aee7be70 Mon Sep 17 00:00:00 2001 From: Anbraten Date: Wed, 31 May 2023 18:03:03 +0200 Subject: [PATCH] Remove unused file system api (#1791) Co-authored-by: 6543 <6543@obermui.de> --- agent/logger.go | 66 +- agent/rpc/client_grpc.go | 36 - cmd/server/server.go | 3 - pipeline/rpc/peer.go | 14 - pipeline/rpc/proto/version.go | 2 +- pipeline/rpc/proto/woodpecker.pb.go | 722 +++++++----------- pipeline/rpc/proto/woodpecker.proto | 16 - pipeline/rpc/proto/woodpecker_grpc.pb.go | 37 - server/api/file.go | 118 --- server/api/pipeline.go | 2 - server/config.go | 1 - server/forge/mocks/forge.go | 2 +- server/grpc/rpc.go | 75 -- server/grpc/server.go | 16 - server/model/file.go | 47 -- server/model/pipeline.go | 1 - server/router/api.go | 3 - server/store/datastore/file.go | 56 -- server/store/datastore/file_test.go | 192 ----- .../migration/016_remove_files_table.go | 26 + server/store/datastore/migration/migration.go | 2 +- server/store/datastore/repo_test.go | 1 - server/store/datastore/step.go | 7 - server/store/mocks/store.go | 94 +-- server/store/store.go | 6 - web/src/lib/api/index.ts | 8 - 26 files changed, 291 insertions(+), 1262 deletions(-) delete mode 100644 server/api/file.go delete mode 100644 server/model/file.go delete mode 100644 server/store/datastore/file.go delete mode 100644 server/store/datastore/file_test.go create mode 100644 server/store/datastore/migration/016_remove_files_table.go diff --git a/agent/logger.go b/agent/logger.go index 7ed688370..8a2745dbb 100644 --- a/agent/logger.go +++ b/agent/logger.go @@ -16,10 +16,8 @@ package agent import ( "context" - "encoding/json" "io" "sync" - "time" "github.com/rs/zerolog" "github.com/rs/zerolog/log" @@ -30,7 +28,7 @@ import ( "github.com/woodpecker-ci/woodpecker/pipeline/rpc" ) -func (r *Runner) createLogger(ctxmeta context.Context, logger zerolog.Logger, uploads *sync.WaitGroup, work *rpc.Pipeline) pipeline.LogFunc { +func (r *Runner) createLogger(_ context.Context, logger zerolog.Logger, uploads *sync.WaitGroup, work *rpc.Pipeline) pipeline.LogFunc { return func(step *backend.Step, rc multipart.Reader) error { loglogger := logger.With(). Str("image", step.Image). @@ -60,73 +58,11 @@ func (r *Runner) createLogger(ctxmeta context.Context, logger zerolog.Logger, up loglogger.Debug().Msg("log stream copied") - data, err := json.Marshal(logStream.Lines()) - if err != nil { - loglogger.Err(err).Msg("could not marshal logstream") - } - - file := &rpc.File{ - Mime: "application/json+logs", - Step: step.Alias, - Name: "logs.json", - Data: data, - Size: len(data), - Time: time.Now().Unix(), - } - - loglogger.Debug().Msg("log stream uploading") - if serr := r.client.Upload(ctxmeta, work.ID, file); serr != nil { - loglogger.Error().Err(serr).Msg("log stream upload error") - } else { - loglogger.Debug().Msg("log stream upload complete") - } - defer func() { loglogger.Debug().Msg("log stream closed") uploads.Done() }() - part, rerr = rc.NextPart() - if rerr != nil { - return nil - } - // TODO should be configurable - limitedPart = io.LimitReader(part, maxFileUpload) - data, err = io.ReadAll(limitedPart) - if err != nil { - loglogger.Err(err).Msg("could not read limited part") - } - - file = &rpc.File{ - Mime: part.Header().Get("Content-Type"), - Step: step.Alias, - Name: part.FileName(), - Data: data, - Size: len(data), - Time: time.Now().Unix(), - Meta: make(map[string]string), - } - for key, value := range part.Header() { - file.Meta[key] = value[0] - } - - loglogger.Debug(). - Str("file", file.Name). - Str("mime", file.Mime). - Msg("file stream uploading") - - if serr := r.client.Upload(ctxmeta, work.ID, file); serr != nil { - loglogger.Error(). - Err(serr). - Str("file", file.Name). - Str("mime", file.Mime). - Msg("file stream upload error") - } - - loglogger.Debug(). - Str("file", file.Name). - Str("mime", file.Mime). - Msg("file stream upload complete") return nil } } diff --git a/agent/rpc/client_grpc.go b/agent/rpc/client_grpc.go index 81189cd42..8c4251804 100644 --- a/agent/rpc/client_grpc.go +++ b/agent/rpc/client_grpc.go @@ -277,42 +277,6 @@ func (c *client) Update(ctx context.Context, id string, state rpc.State) (err er return nil } -// Upload uploads the pipeline artifact. -func (c *client) Upload(ctx context.Context, id string, file *rpc.File) (err error) { - req := new(proto.UploadRequest) - req.Id = id - req.File = new(proto.File) - req.File.Name = file.Name - req.File.Mime = file.Mime - req.File.Step = file.Step - req.File.Size = int32(file.Size) - req.File.Time = file.Time - req.File.Data = file.Data - req.File.Meta = file.Meta - for { - _, err = c.client.Upload(ctx, req) - if err == nil { - break - } - - log.Err(err).Msgf("grpc error: upload(): code: %v: %s", status.Code(err), err) - - switch status.Code(err) { - case - codes.Aborted, - codes.DataLoss, - codes.DeadlineExceeded, - codes.Internal, - codes.Unavailable: - // non-fatal errors - default: - return err - } - <-time.After(backoff) - } - return nil -} - // Log writes the pipeline log entry. func (c *client) Log(ctx context.Context, id string, line *rpc.Line) (err error) { req := new(proto.LogRequest) diff --git a/cmd/server/server.go b/cmd/server/server.go index 46d79058a..c657b93ae 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -279,9 +279,6 @@ func run(c *cli.Context) error { } func setupEvilGlobals(c *cli.Context, v store.Store, f forge.Forge) { - // storage - server.Config.Storage.Files = v - // forge server.Config.Services.Forge = f server.Config.Services.Timeout = c.Duration("forge-timeout") diff --git a/pipeline/rpc/peer.go b/pipeline/rpc/peer.go index 4681c7702..7c37d9565 100644 --- a/pipeline/rpc/peer.go +++ b/pipeline/rpc/peer.go @@ -44,17 +44,6 @@ type ( Timeout int64 `json:"timeout"` } - // File defines a pipeline artifact. - File struct { - Name string `json:"name"` - Step string `json:"step"` - Mime string `json:"mime"` - Time int64 `json:"time"` - Size int `json:"size"` - Data []byte `json:"data"` - Meta map[string]string `json:"meta"` - } - Version struct { GrpcVersion int32 `json:"grpc_version,omitempty"` ServerVersion string `json:"server_version,omitempty"` @@ -84,9 +73,6 @@ type Peer interface { // Update updates the pipeline state. Update(c context.Context, id string, state State) error - // Upload uploads the pipeline artifact. - Upload(c context.Context, id string, file *File) error - // Log writes the pipeline log entry. Log(c context.Context, id string, line *Line) error diff --git a/pipeline/rpc/proto/version.go b/pipeline/rpc/proto/version.go index 0d85ffdea..70e92d80e 100644 --- a/pipeline/rpc/proto/version.go +++ b/pipeline/rpc/proto/version.go @@ -16,4 +16,4 @@ package proto // Version is the version of the woodpecker.proto file, // !IMPORTANT! increased by 1 each time it get changed !IMPORTANT! -const Version int32 = 1 +const Version int32 = 2 diff --git a/pipeline/rpc/proto/woodpecker.pb.go b/pipeline/rpc/proto/woodpecker.pb.go index afe4891bc..3af0d8658 100644 --- a/pipeline/rpc/proto/woodpecker.pb.go +++ b/pipeline/rpc/proto/woodpecker.pb.go @@ -35,101 +35,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type File struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Step string `protobuf:"bytes,2,opt,name=step,proto3" json:"step,omitempty"` - Mime string `protobuf:"bytes,3,opt,name=mime,proto3" json:"mime,omitempty"` - Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` - Size int32 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"` - Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` - Meta map[string]string `protobuf:"bytes,7,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *File) Reset() { - *x = File{} - if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *File) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*File) ProtoMessage() {} - -func (x *File) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[0] - 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 File.ProtoReflect.Descriptor instead. -func (*File) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{0} -} - -func (x *File) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *File) GetStep() string { - if x != nil { - return x.Step - } - return "" -} - -func (x *File) GetMime() string { - if x != nil { - return x.Mime - } - return "" -} - -func (x *File) GetTime() int64 { - if x != nil { - return x.Time - } - return 0 -} - -func (x *File) GetSize() int32 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *File) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *File) GetMeta() map[string]string { - if x != nil { - return x.Meta - } - return nil -} - type State struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -146,7 +51,7 @@ type State struct { func (x *State) Reset() { *x = State{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[1] + mi := &file_woodpecker_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -159,7 +64,7 @@ func (x *State) String() string { func (*State) ProtoMessage() {} func (x *State) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[1] + mi := &file_woodpecker_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -172,7 +77,7 @@ func (x *State) ProtoReflect() protoreflect.Message { // Deprecated: Use State.ProtoReflect.Descriptor instead. func (*State) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{1} + return file_woodpecker_proto_rawDescGZIP(), []int{0} } func (x *State) GetName() string { @@ -231,7 +136,7 @@ type Line struct { func (x *Line) Reset() { *x = Line{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[2] + mi := &file_woodpecker_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -244,7 +149,7 @@ func (x *Line) String() string { func (*Line) ProtoMessage() {} func (x *Line) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[2] + mi := &file_woodpecker_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -257,7 +162,7 @@ func (x *Line) ProtoReflect() protoreflect.Message { // Deprecated: Use Line.ProtoReflect.Descriptor instead. func (*Line) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{2} + return file_woodpecker_proto_rawDescGZIP(), []int{1} } func (x *Line) GetStep() string { @@ -299,7 +204,7 @@ type Filter struct { func (x *Filter) Reset() { *x = Filter{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[3] + mi := &file_woodpecker_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -312,7 +217,7 @@ func (x *Filter) String() string { func (*Filter) ProtoMessage() {} func (x *Filter) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[3] + mi := &file_woodpecker_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -325,7 +230,7 @@ func (x *Filter) ProtoReflect() protoreflect.Message { // Deprecated: Use Filter.ProtoReflect.Descriptor instead. func (*Filter) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{3} + return file_woodpecker_proto_rawDescGZIP(), []int{2} } func (x *Filter) GetLabels() map[string]string { @@ -348,7 +253,7 @@ type Pipeline struct { func (x *Pipeline) Reset() { *x = Pipeline{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[4] + mi := &file_woodpecker_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -361,7 +266,7 @@ func (x *Pipeline) String() string { func (*Pipeline) ProtoMessage() {} func (x *Pipeline) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[4] + mi := &file_woodpecker_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -374,7 +279,7 @@ func (x *Pipeline) ProtoReflect() protoreflect.Message { // Deprecated: Use Pipeline.ProtoReflect.Descriptor instead. func (*Pipeline) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{4} + return file_woodpecker_proto_rawDescGZIP(), []int{3} } func (x *Pipeline) GetId() string { @@ -409,7 +314,7 @@ type NextRequest struct { func (x *NextRequest) Reset() { *x = NextRequest{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[5] + mi := &file_woodpecker_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -422,7 +327,7 @@ func (x *NextRequest) String() string { func (*NextRequest) ProtoMessage() {} func (x *NextRequest) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[5] + mi := &file_woodpecker_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -435,7 +340,7 @@ func (x *NextRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use NextRequest.ProtoReflect.Descriptor instead. func (*NextRequest) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{5} + return file_woodpecker_proto_rawDescGZIP(), []int{4} } func (x *NextRequest) GetFilter() *Filter { @@ -457,7 +362,7 @@ type InitRequest struct { func (x *InitRequest) Reset() { *x = InitRequest{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[6] + mi := &file_woodpecker_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -470,7 +375,7 @@ func (x *InitRequest) String() string { func (*InitRequest) ProtoMessage() {} func (x *InitRequest) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[6] + mi := &file_woodpecker_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -483,7 +388,7 @@ func (x *InitRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use InitRequest.ProtoReflect.Descriptor instead. func (*InitRequest) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{6} + return file_woodpecker_proto_rawDescGZIP(), []int{5} } func (x *InitRequest) GetId() string { @@ -511,7 +416,7 @@ type WaitRequest struct { func (x *WaitRequest) Reset() { *x = WaitRequest{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[7] + mi := &file_woodpecker_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -524,7 +429,7 @@ func (x *WaitRequest) String() string { func (*WaitRequest) ProtoMessage() {} func (x *WaitRequest) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[7] + mi := &file_woodpecker_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -537,7 +442,7 @@ func (x *WaitRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WaitRequest.ProtoReflect.Descriptor instead. func (*WaitRequest) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{7} + return file_woodpecker_proto_rawDescGZIP(), []int{6} } func (x *WaitRequest) GetId() string { @@ -559,7 +464,7 @@ type DoneRequest struct { func (x *DoneRequest) Reset() { *x = DoneRequest{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[8] + mi := &file_woodpecker_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -572,7 +477,7 @@ func (x *DoneRequest) String() string { func (*DoneRequest) ProtoMessage() {} func (x *DoneRequest) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[8] + mi := &file_woodpecker_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -585,7 +490,7 @@ func (x *DoneRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DoneRequest.ProtoReflect.Descriptor instead. func (*DoneRequest) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{8} + return file_woodpecker_proto_rawDescGZIP(), []int{7} } func (x *DoneRequest) GetId() string { @@ -613,7 +518,7 @@ type ExtendRequest struct { func (x *ExtendRequest) Reset() { *x = ExtendRequest{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[9] + mi := &file_woodpecker_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -626,7 +531,7 @@ func (x *ExtendRequest) String() string { func (*ExtendRequest) ProtoMessage() {} func (x *ExtendRequest) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[9] + mi := &file_woodpecker_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -639,7 +544,7 @@ func (x *ExtendRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExtendRequest.ProtoReflect.Descriptor instead. func (*ExtendRequest) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{9} + return file_woodpecker_proto_rawDescGZIP(), []int{8} } func (x *ExtendRequest) GetId() string { @@ -649,61 +554,6 @@ func (x *ExtendRequest) GetId() string { return "" } -type UploadRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - File *File `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"` -} - -func (x *UploadRequest) Reset() { - *x = UploadRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UploadRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadRequest) ProtoMessage() {} - -func (x *UploadRequest) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead. -func (*UploadRequest) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{10} -} - -func (x *UploadRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *UploadRequest) GetFile() *File { - if x != nil { - return x.File - } - return nil -} - type UpdateRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -716,7 +566,7 @@ type UpdateRequest struct { func (x *UpdateRequest) Reset() { *x = UpdateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[11] + mi := &file_woodpecker_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -729,7 +579,7 @@ func (x *UpdateRequest) String() string { func (*UpdateRequest) ProtoMessage() {} func (x *UpdateRequest) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[11] + mi := &file_woodpecker_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -742,7 +592,7 @@ func (x *UpdateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead. func (*UpdateRequest) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{11} + return file_woodpecker_proto_rawDescGZIP(), []int{9} } func (x *UpdateRequest) GetId() string { @@ -771,7 +621,7 @@ type LogRequest struct { func (x *LogRequest) Reset() { *x = LogRequest{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[12] + mi := &file_woodpecker_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -784,7 +634,7 @@ func (x *LogRequest) String() string { func (*LogRequest) ProtoMessage() {} func (x *LogRequest) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[12] + mi := &file_woodpecker_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -797,7 +647,7 @@ func (x *LogRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LogRequest.ProtoReflect.Descriptor instead. func (*LogRequest) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{12} + return file_woodpecker_proto_rawDescGZIP(), []int{10} } func (x *LogRequest) GetId() string { @@ -823,7 +673,7 @@ type Empty struct { func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[13] + mi := &file_woodpecker_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -836,7 +686,7 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[13] + mi := &file_woodpecker_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -849,7 +699,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{13} + return file_woodpecker_proto_rawDescGZIP(), []int{11} } type ReportHealthRequest struct { @@ -863,7 +713,7 @@ type ReportHealthRequest struct { func (x *ReportHealthRequest) Reset() { *x = ReportHealthRequest{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[14] + mi := &file_woodpecker_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -876,7 +726,7 @@ func (x *ReportHealthRequest) String() string { func (*ReportHealthRequest) ProtoMessage() {} func (x *ReportHealthRequest) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[14] + mi := &file_woodpecker_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -889,7 +739,7 @@ func (x *ReportHealthRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportHealthRequest.ProtoReflect.Descriptor instead. func (*ReportHealthRequest) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{14} + return file_woodpecker_proto_rawDescGZIP(), []int{12} } func (x *ReportHealthRequest) GetStatus() string { @@ -913,7 +763,7 @@ type RegisterAgentRequest struct { func (x *RegisterAgentRequest) Reset() { *x = RegisterAgentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[15] + mi := &file_woodpecker_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -926,7 +776,7 @@ func (x *RegisterAgentRequest) String() string { func (*RegisterAgentRequest) ProtoMessage() {} func (x *RegisterAgentRequest) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[15] + mi := &file_woodpecker_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -939,7 +789,7 @@ func (x *RegisterAgentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterAgentRequest.ProtoReflect.Descriptor instead. func (*RegisterAgentRequest) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{15} + return file_woodpecker_proto_rawDescGZIP(), []int{13} } func (x *RegisterAgentRequest) GetPlatform() string { @@ -982,7 +832,7 @@ type VersionResponse struct { func (x *VersionResponse) Reset() { *x = VersionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[16] + mi := &file_woodpecker_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -995,7 +845,7 @@ func (x *VersionResponse) String() string { func (*VersionResponse) ProtoMessage() {} func (x *VersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[16] + mi := &file_woodpecker_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1008,7 +858,7 @@ func (x *VersionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VersionResponse.ProtoReflect.Descriptor instead. func (*VersionResponse) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{16} + return file_woodpecker_proto_rawDescGZIP(), []int{14} } func (x *VersionResponse) GetGrpcVersion() int32 { @@ -1036,7 +886,7 @@ type NextResponse struct { func (x *NextResponse) Reset() { *x = NextResponse{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[17] + mi := &file_woodpecker_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1049,7 +899,7 @@ func (x *NextResponse) String() string { func (*NextResponse) ProtoMessage() {} func (x *NextResponse) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[17] + mi := &file_woodpecker_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1062,7 +912,7 @@ func (x *NextResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use NextResponse.ProtoReflect.Descriptor instead. func (*NextResponse) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{17} + return file_woodpecker_proto_rawDescGZIP(), []int{15} } func (x *NextResponse) GetPipeline() *Pipeline { @@ -1083,7 +933,7 @@ type RegisterAgentResponse struct { func (x *RegisterAgentResponse) Reset() { *x = RegisterAgentResponse{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[18] + mi := &file_woodpecker_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1096,7 +946,7 @@ func (x *RegisterAgentResponse) String() string { func (*RegisterAgentResponse) ProtoMessage() {} func (x *RegisterAgentResponse) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[18] + mi := &file_woodpecker_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1109,7 +959,7 @@ func (x *RegisterAgentResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterAgentResponse.ProtoReflect.Descriptor instead. func (*RegisterAgentResponse) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{18} + return file_woodpecker_proto_rawDescGZIP(), []int{16} } func (x *RegisterAgentResponse) GetAgentId() int64 { @@ -1131,7 +981,7 @@ type AuthRequest struct { func (x *AuthRequest) Reset() { *x = AuthRequest{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[19] + mi := &file_woodpecker_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1144,7 +994,7 @@ func (x *AuthRequest) String() string { func (*AuthRequest) ProtoMessage() {} func (x *AuthRequest) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[19] + mi := &file_woodpecker_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1157,7 +1007,7 @@ func (x *AuthRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AuthRequest.ProtoReflect.Descriptor instead. func (*AuthRequest) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{19} + return file_woodpecker_proto_rawDescGZIP(), []int{17} } func (x *AuthRequest) GetAgentToken() string { @@ -1187,7 +1037,7 @@ type AuthResponse struct { func (x *AuthResponse) Reset() { *x = AuthResponse{} if protoimpl.UnsafeEnabled { - mi := &file_woodpecker_proto_msgTypes[20] + mi := &file_woodpecker_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1200,7 +1050,7 @@ func (x *AuthResponse) String() string { func (*AuthResponse) ProtoMessage() {} func (x *AuthResponse) ProtoReflect() protoreflect.Message { - mi := &file_woodpecker_proto_msgTypes[20] + mi := &file_woodpecker_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1213,7 +1063,7 @@ func (x *AuthResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AuthResponse.ProtoReflect.Descriptor instead. func (*AuthResponse) Descriptor() ([]byte, []int) { - return file_woodpecker_proto_rawDescGZIP(), []int{20} + return file_woodpecker_proto_rawDescGZIP(), []int{18} } func (x *AuthResponse) GetStatus() string { @@ -1241,157 +1091,136 @@ var File_woodpecker_proto protoreflect.FileDescriptor var file_woodpecker_proto_rawDesc = []byte{ 0x0a, 0x10, 0x77, 0x6f, 0x6f, 0x64, 0x70, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x01, 0x0a, 0x04, 0x46, 0x69, - 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x69, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x69, 0x6d, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, - 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x04, 0x6d, 0x65, - 0x74, 0x61, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x04, 0x6d, 0x65, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x9c, - 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, - 0x69, 0x74, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, - 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x66, - 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x52, 0x0a, - 0x04, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x12, - 0x10, 0x0a, 0x03, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, - 0x74, 0x22, 0x76, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x06, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, - 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4e, 0x0a, 0x08, 0x50, 0x69, 0x70, - 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x34, 0x0a, 0x0b, 0x4e, 0x65, 0x78, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, - 0x41, 0x0a, 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, - 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x22, 0x1d, 0x0a, 0x0b, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x22, 0x41, 0x0a, 0x0b, 0x44, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x01, 0x0a, 0x05, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x74, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x12, + 0x1b, 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, + 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, + 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x52, 0x0a, 0x04, 0x4c, 0x69, 0x6e, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x73, 0x74, 0x65, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x75, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x22, 0x76, 0x0a, 0x06, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4e, 0x0a, 0x08, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x22, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x22, 0x1f, 0x0a, 0x0d, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x40, 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x43, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x3d, 0x0a, 0x0a, - 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x04, 0x6c, 0x69, - 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x07, 0x0a, 0x05, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2d, 0x0a, 0x13, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x65, - 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x70, 0x61, - 0x63, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x61, 0x70, 0x61, - 0x63, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, 0x18, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5b, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x67, - 0x72, 0x70, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0b, 0x67, 0x72, 0x70, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, - 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3b, 0x0a, 0x0c, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x08, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, - 0x6e, 0x65, 0x22, 0x32, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x67, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x49, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, - 0x64, 0x22, 0x64, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, - 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x67, 0x65, - 0x6e, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xba, 0x04, 0x0a, 0x0a, 0x57, 0x6f, 0x6f, 0x64, - 0x70, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, - 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x04, 0x4e, 0x65, 0x78, - 0x74, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x65, - 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2a, 0x0a, 0x04, - 0x49, 0x6e, 0x69, 0x74, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x69, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x2a, 0x0a, 0x04, 0x57, 0x61, 0x69, 0x74, - 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x00, 0x12, 0x2a, 0x0a, 0x04, 0x44, 0x6f, 0x6e, 0x65, 0x12, 0x12, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, - 0x12, 0x2e, 0x0a, 0x06, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, - 0x12, 0x2e, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, - 0x12, 0x2e, 0x0a, 0x06, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, - 0x12, 0x28, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0d, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x00, 0x32, 0x43, 0x0a, 0x0e, 0x57, 0x6f, 0x6f, 0x64, 0x70, 0x65, 0x63, 0x6b, - 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, 0x31, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x12, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x6f, 0x6f, 0x64, 0x70, 0x65, 0x63, 0x6b, - 0x65, 0x72, 0x2d, 0x63, 0x69, 0x2f, 0x77, 0x6f, 0x6f, 0x64, 0x70, 0x65, 0x63, 0x6b, 0x65, 0x72, - 0x2f, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x34, 0x0a, 0x0b, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x41, 0x0a, 0x0b, 0x49, 0x6e, + 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x1d, 0x0a, + 0x0b, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x41, 0x0a, 0x0b, + 0x44, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, + 0x1f, 0x0a, 0x0d, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x43, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x22, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x3d, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x52, 0x04, + 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2d, 0x0a, + 0x13, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x82, 0x01, 0x0a, + 0x14, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, + 0x07, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x22, 0x5b, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x67, 0x72, 0x70, 0x63, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3b, + 0x0a, 0x0c, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, + 0x0a, 0x08, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x52, 0x08, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x32, 0x0a, 0x15, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, + 0x49, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, + 0x0a, 0x0b, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x64, 0x0a, 0x0c, 0x41, 0x75, + 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, + 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x32, 0x8a, 0x04, 0x0a, 0x0a, 0x57, 0x6f, 0x6f, 0x64, 0x70, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x12, + 0x31, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0c, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x31, 0x0a, 0x04, 0x4e, 0x65, 0x78, 0x74, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2a, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x12, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x00, 0x12, 0x2a, 0x0a, 0x04, 0x57, 0x61, 0x69, 0x74, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x2a, 0x0a, + 0x04, 0x44, 0x6f, 0x6e, 0x65, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x6f, + 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x2e, 0x0a, 0x06, 0x45, 0x78, 0x74, + 0x65, 0x6e, 0x64, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x65, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x2e, 0x0a, 0x06, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x28, 0x0a, 0x03, 0x4c, 0x6f, 0x67, + 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x3a, 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x32, 0x43, 0x0a, + 0x0e, 0x57, 0x6f, 0x6f, 0x64, 0x70, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x12, + 0x31, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x77, 0x6f, 0x6f, 0x64, 0x70, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x2d, 0x63, 0x69, 0x2f, 0x77, + 0x6f, 0x6f, 0x64, 0x70, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x2f, 0x70, 0x69, 0x70, 0x65, 0x6c, 0x69, + 0x6e, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1406,71 +1235,64 @@ func file_woodpecker_proto_rawDescGZIP() []byte { return file_woodpecker_proto_rawDescData } -var file_woodpecker_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_woodpecker_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_woodpecker_proto_goTypes = []interface{}{ - (*File)(nil), // 0: proto.File - (*State)(nil), // 1: proto.State - (*Line)(nil), // 2: proto.Line - (*Filter)(nil), // 3: proto.Filter - (*Pipeline)(nil), // 4: proto.Pipeline - (*NextRequest)(nil), // 5: proto.NextRequest - (*InitRequest)(nil), // 6: proto.InitRequest - (*WaitRequest)(nil), // 7: proto.WaitRequest - (*DoneRequest)(nil), // 8: proto.DoneRequest - (*ExtendRequest)(nil), // 9: proto.ExtendRequest - (*UploadRequest)(nil), // 10: proto.UploadRequest - (*UpdateRequest)(nil), // 11: proto.UpdateRequest - (*LogRequest)(nil), // 12: proto.LogRequest - (*Empty)(nil), // 13: proto.Empty - (*ReportHealthRequest)(nil), // 14: proto.ReportHealthRequest - (*RegisterAgentRequest)(nil), // 15: proto.RegisterAgentRequest - (*VersionResponse)(nil), // 16: proto.VersionResponse - (*NextResponse)(nil), // 17: proto.NextResponse - (*RegisterAgentResponse)(nil), // 18: proto.RegisterAgentResponse - (*AuthRequest)(nil), // 19: proto.AuthRequest - (*AuthResponse)(nil), // 20: proto.AuthResponse - nil, // 21: proto.File.MetaEntry - nil, // 22: proto.Filter.LabelsEntry + (*State)(nil), // 0: proto.State + (*Line)(nil), // 1: proto.Line + (*Filter)(nil), // 2: proto.Filter + (*Pipeline)(nil), // 3: proto.Pipeline + (*NextRequest)(nil), // 4: proto.NextRequest + (*InitRequest)(nil), // 5: proto.InitRequest + (*WaitRequest)(nil), // 6: proto.WaitRequest + (*DoneRequest)(nil), // 7: proto.DoneRequest + (*ExtendRequest)(nil), // 8: proto.ExtendRequest + (*UpdateRequest)(nil), // 9: proto.UpdateRequest + (*LogRequest)(nil), // 10: proto.LogRequest + (*Empty)(nil), // 11: proto.Empty + (*ReportHealthRequest)(nil), // 12: proto.ReportHealthRequest + (*RegisterAgentRequest)(nil), // 13: proto.RegisterAgentRequest + (*VersionResponse)(nil), // 14: proto.VersionResponse + (*NextResponse)(nil), // 15: proto.NextResponse + (*RegisterAgentResponse)(nil), // 16: proto.RegisterAgentResponse + (*AuthRequest)(nil), // 17: proto.AuthRequest + (*AuthResponse)(nil), // 18: proto.AuthResponse + nil, // 19: proto.Filter.LabelsEntry } var file_woodpecker_proto_depIdxs = []int32{ - 21, // 0: proto.File.meta:type_name -> proto.File.MetaEntry - 22, // 1: proto.Filter.labels:type_name -> proto.Filter.LabelsEntry - 3, // 2: proto.NextRequest.filter:type_name -> proto.Filter - 1, // 3: proto.InitRequest.state:type_name -> proto.State - 1, // 4: proto.DoneRequest.state:type_name -> proto.State - 0, // 5: proto.UploadRequest.file:type_name -> proto.File - 1, // 6: proto.UpdateRequest.state:type_name -> proto.State - 2, // 7: proto.LogRequest.line:type_name -> proto.Line - 4, // 8: proto.NextResponse.pipeline:type_name -> proto.Pipeline - 13, // 9: proto.Woodpecker.Version:input_type -> proto.Empty - 5, // 10: proto.Woodpecker.Next:input_type -> proto.NextRequest - 6, // 11: proto.Woodpecker.Init:input_type -> proto.InitRequest - 7, // 12: proto.Woodpecker.Wait:input_type -> proto.WaitRequest - 8, // 13: proto.Woodpecker.Done:input_type -> proto.DoneRequest - 9, // 14: proto.Woodpecker.Extend:input_type -> proto.ExtendRequest - 11, // 15: proto.Woodpecker.Update:input_type -> proto.UpdateRequest - 10, // 16: proto.Woodpecker.Upload:input_type -> proto.UploadRequest - 12, // 17: proto.Woodpecker.Log:input_type -> proto.LogRequest - 15, // 18: proto.Woodpecker.RegisterAgent:input_type -> proto.RegisterAgentRequest - 14, // 19: proto.Woodpecker.ReportHealth:input_type -> proto.ReportHealthRequest - 19, // 20: proto.WoodpeckerAuth.Auth:input_type -> proto.AuthRequest - 16, // 21: proto.Woodpecker.Version:output_type -> proto.VersionResponse - 17, // 22: proto.Woodpecker.Next:output_type -> proto.NextResponse - 13, // 23: proto.Woodpecker.Init:output_type -> proto.Empty - 13, // 24: proto.Woodpecker.Wait:output_type -> proto.Empty - 13, // 25: proto.Woodpecker.Done:output_type -> proto.Empty - 13, // 26: proto.Woodpecker.Extend:output_type -> proto.Empty - 13, // 27: proto.Woodpecker.Update:output_type -> proto.Empty - 13, // 28: proto.Woodpecker.Upload:output_type -> proto.Empty - 13, // 29: proto.Woodpecker.Log:output_type -> proto.Empty - 18, // 30: proto.Woodpecker.RegisterAgent:output_type -> proto.RegisterAgentResponse - 13, // 31: proto.Woodpecker.ReportHealth:output_type -> proto.Empty - 20, // 32: proto.WoodpeckerAuth.Auth:output_type -> proto.AuthResponse - 21, // [21:33] is the sub-list for method output_type - 9, // [9:21] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 19, // 0: proto.Filter.labels:type_name -> proto.Filter.LabelsEntry + 2, // 1: proto.NextRequest.filter:type_name -> proto.Filter + 0, // 2: proto.InitRequest.state:type_name -> proto.State + 0, // 3: proto.DoneRequest.state:type_name -> proto.State + 0, // 4: proto.UpdateRequest.state:type_name -> proto.State + 1, // 5: proto.LogRequest.line:type_name -> proto.Line + 3, // 6: proto.NextResponse.pipeline:type_name -> proto.Pipeline + 11, // 7: proto.Woodpecker.Version:input_type -> proto.Empty + 4, // 8: proto.Woodpecker.Next:input_type -> proto.NextRequest + 5, // 9: proto.Woodpecker.Init:input_type -> proto.InitRequest + 6, // 10: proto.Woodpecker.Wait:input_type -> proto.WaitRequest + 7, // 11: proto.Woodpecker.Done:input_type -> proto.DoneRequest + 8, // 12: proto.Woodpecker.Extend:input_type -> proto.ExtendRequest + 9, // 13: proto.Woodpecker.Update:input_type -> proto.UpdateRequest + 10, // 14: proto.Woodpecker.Log:input_type -> proto.LogRequest + 13, // 15: proto.Woodpecker.RegisterAgent:input_type -> proto.RegisterAgentRequest + 12, // 16: proto.Woodpecker.ReportHealth:input_type -> proto.ReportHealthRequest + 17, // 17: proto.WoodpeckerAuth.Auth:input_type -> proto.AuthRequest + 14, // 18: proto.Woodpecker.Version:output_type -> proto.VersionResponse + 15, // 19: proto.Woodpecker.Next:output_type -> proto.NextResponse + 11, // 20: proto.Woodpecker.Init:output_type -> proto.Empty + 11, // 21: proto.Woodpecker.Wait:output_type -> proto.Empty + 11, // 22: proto.Woodpecker.Done:output_type -> proto.Empty + 11, // 23: proto.Woodpecker.Extend:output_type -> proto.Empty + 11, // 24: proto.Woodpecker.Update:output_type -> proto.Empty + 11, // 25: proto.Woodpecker.Log:output_type -> proto.Empty + 16, // 26: proto.Woodpecker.RegisterAgent:output_type -> proto.RegisterAgentResponse + 11, // 27: proto.Woodpecker.ReportHealth:output_type -> proto.Empty + 18, // 28: proto.WoodpeckerAuth.Auth:output_type -> proto.AuthResponse + 18, // [18:29] is the sub-list for method output_type + 7, // [7:18] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_woodpecker_proto_init() } @@ -1480,18 +1302,6 @@ func file_woodpecker_proto_init() { } if !protoimpl.UnsafeEnabled { file_woodpecker_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*File); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_woodpecker_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*State); i { case 0: return &v.state @@ -1503,7 +1313,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Line); i { case 0: return &v.state @@ -1515,7 +1325,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Filter); i { case 0: return &v.state @@ -1527,7 +1337,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Pipeline); i { case 0: return &v.state @@ -1539,7 +1349,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NextRequest); i { case 0: return &v.state @@ -1551,7 +1361,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InitRequest); i { case 0: return &v.state @@ -1563,7 +1373,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WaitRequest); i { case 0: return &v.state @@ -1575,7 +1385,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DoneRequest); i { case 0: return &v.state @@ -1587,7 +1397,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExtendRequest); i { case 0: return &v.state @@ -1599,19 +1409,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UploadRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_woodpecker_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateRequest); i { case 0: return &v.state @@ -1623,7 +1421,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LogRequest); i { case 0: return &v.state @@ -1635,7 +1433,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Empty); i { case 0: return &v.state @@ -1647,7 +1445,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReportHealthRequest); i { case 0: return &v.state @@ -1659,7 +1457,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RegisterAgentRequest); i { case 0: return &v.state @@ -1671,7 +1469,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*VersionResponse); i { case 0: return &v.state @@ -1683,7 +1481,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NextResponse); i { case 0: return &v.state @@ -1695,7 +1493,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RegisterAgentResponse); i { case 0: return &v.state @@ -1707,7 +1505,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthRequest); i { case 0: return &v.state @@ -1719,7 +1517,7 @@ func file_woodpecker_proto_init() { return nil } } - file_woodpecker_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_woodpecker_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthResponse); i { case 0: return &v.state @@ -1738,7 +1536,7 @@ func file_woodpecker_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_woodpecker_proto_rawDesc, NumEnums: 0, - NumMessages: 23, + NumMessages: 20, NumExtensions: 0, NumServices: 2, }, diff --git a/pipeline/rpc/proto/woodpecker.proto b/pipeline/rpc/proto/woodpecker.proto index 0927e9fc2..0a14918df 100644 --- a/pipeline/rpc/proto/woodpecker.proto +++ b/pipeline/rpc/proto/woodpecker.proto @@ -31,7 +31,6 @@ service Woodpecker { rpc Done (DoneRequest) returns (Empty) {} rpc Extend (ExtendRequest) returns (Empty) {} rpc Update (UpdateRequest) returns (Empty) {} - rpc Upload (UploadRequest) returns (Empty) {} rpc Log (LogRequest) returns (Empty) {} rpc RegisterAgent (RegisterAgentRequest) returns (RegisterAgentResponse) {} rpc ReportHealth (ReportHealthRequest) returns (Empty) {} @@ -41,16 +40,6 @@ service Woodpecker { // Basic Types // -message File { - string name = 1; - string step = 2; - string mime = 3; - int64 time = 4; - int32 size = 5; - bytes data = 6; - map meta = 7; -} - message State { string name = 1; bool exited = 2; @@ -103,11 +92,6 @@ message ExtendRequest { string id = 1; } -message UploadRequest { - string id = 1; - File file = 2; -} - message UpdateRequest { string id = 1; State state = 2; diff --git a/pipeline/rpc/proto/woodpecker_grpc.pb.go b/pipeline/rpc/proto/woodpecker_grpc.pb.go index 3945ed2f4..44c2814fa 100644 --- a/pipeline/rpc/proto/woodpecker_grpc.pb.go +++ b/pipeline/rpc/proto/woodpecker_grpc.pb.go @@ -41,7 +41,6 @@ const ( Woodpecker_Done_FullMethodName = "/proto.Woodpecker/Done" Woodpecker_Extend_FullMethodName = "/proto.Woodpecker/Extend" Woodpecker_Update_FullMethodName = "/proto.Woodpecker/Update" - Woodpecker_Upload_FullMethodName = "/proto.Woodpecker/Upload" Woodpecker_Log_FullMethodName = "/proto.Woodpecker/Log" Woodpecker_RegisterAgent_FullMethodName = "/proto.Woodpecker/RegisterAgent" Woodpecker_ReportHealth_FullMethodName = "/proto.Woodpecker/ReportHealth" @@ -58,7 +57,6 @@ type WoodpeckerClient interface { Done(ctx context.Context, in *DoneRequest, opts ...grpc.CallOption) (*Empty, error) Extend(ctx context.Context, in *ExtendRequest, opts ...grpc.CallOption) (*Empty, error) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Empty, error) - Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*Empty, error) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*Empty, error) RegisterAgent(ctx context.Context, in *RegisterAgentRequest, opts ...grpc.CallOption) (*RegisterAgentResponse, error) ReportHealth(ctx context.Context, in *ReportHealthRequest, opts ...grpc.CallOption) (*Empty, error) @@ -135,15 +133,6 @@ func (c *woodpeckerClient) Update(ctx context.Context, in *UpdateRequest, opts . return out, nil } -func (c *woodpeckerClient) Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, Woodpecker_Upload_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *woodpeckerClient) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*Empty, error) { out := new(Empty) err := c.cc.Invoke(ctx, Woodpecker_Log_FullMethodName, in, out, opts...) @@ -182,7 +171,6 @@ type WoodpeckerServer interface { Done(context.Context, *DoneRequest) (*Empty, error) Extend(context.Context, *ExtendRequest) (*Empty, error) Update(context.Context, *UpdateRequest) (*Empty, error) - Upload(context.Context, *UploadRequest) (*Empty, error) Log(context.Context, *LogRequest) (*Empty, error) RegisterAgent(context.Context, *RegisterAgentRequest) (*RegisterAgentResponse, error) ReportHealth(context.Context, *ReportHealthRequest) (*Empty, error) @@ -214,9 +202,6 @@ func (UnimplementedWoodpeckerServer) Extend(context.Context, *ExtendRequest) (*E func (UnimplementedWoodpeckerServer) Update(context.Context, *UpdateRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") } -func (UnimplementedWoodpeckerServer) Upload(context.Context, *UploadRequest) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented") -} func (UnimplementedWoodpeckerServer) Log(context.Context, *LogRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Log not implemented") } @@ -365,24 +350,6 @@ func _Woodpecker_Update_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _Woodpecker_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UploadRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WoodpeckerServer).Upload(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Woodpecker_Upload_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WoodpeckerServer).Upload(ctx, req.(*UploadRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Woodpecker_Log_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LogRequest) if err := dec(in); err != nil { @@ -472,10 +439,6 @@ var Woodpecker_ServiceDesc = grpc.ServiceDesc{ MethodName: "Update", Handler: _Woodpecker_Update_Handler, }, - { - MethodName: "Upload", - Handler: _Woodpecker_Upload_Handler, - }, { MethodName: "Log", Handler: _Woodpecker_Log_Handler, diff --git a/server/api/file.go b/server/api/file.go deleted file mode 100644 index 19bf157e7..000000000 --- a/server/api/file.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2022 Woodpecker Authors -// Copyright 2018 Drone.IO Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package api - -import ( - "io" - "net/http" - "strconv" - "strings" - - "github.com/gin-gonic/gin" - "github.com/rs/zerolog/log" - - "github.com/woodpecker-ci/woodpecker/server/router/middleware/session" - "github.com/woodpecker-ci/woodpecker/server/store" -) - -// FileList gets a list file by pipeline. -func FileList(c *gin.Context) { - _store := store.FromContext(c) - num, err := strconv.ParseInt(c.Param("number"), 10, 64) - if err != nil { - _ = c.AbortWithError(http.StatusBadRequest, err) - return - } - - repo := session.Repo(c) - pipeline, err := _store.GetPipelineNumber(repo, num) - if err != nil { - handleDbGetError(c, err) - return - } - - files, err := _store.FileList(pipeline, session.Pagination(c)) - if err != nil { - _ = c.AbortWithError(http.StatusInternalServerError, err) - return - } - - c.JSON(200, files) -} - -// FileGet gets a file by process and name -func FileGet(c *gin.Context) { - var ( - _store = store.FromContext(c) - - repo = session.Repo(c) - name = strings.TrimPrefix(c.Param("file"), "/") - raw = func() bool { - return c.DefaultQuery("raw", "false") == "true" - }() - ) - - num, err := strconv.ParseInt(c.Param("number"), 10, 64) - if err != nil { - _ = c.AbortWithError(http.StatusBadRequest, err) - return - } - - pid, err := strconv.Atoi(c.Param("step")) - if err != nil { - _ = c.AbortWithError(http.StatusBadRequest, err) - return - } - - pipeline, err := _store.GetPipelineNumber(repo, num) - if err != nil { - handleDbGetError(c, err) - return - } - - step, err := _store.StepFind(pipeline, pid) - if err != nil { - _ = c.AbortWithError(http.StatusInternalServerError, err) - return - } - - file, err := _store.FileFind(step, name) - if err != nil { - c.String(http.StatusNotFound, "Error getting file %q. %s", name, err) - return - } - - if !raw { - c.JSON(http.StatusOK, file) - return - } - - rc, err := _store.FileRead(step, file.Name) - if err != nil { - c.String(http.StatusNotFound, "Error getting file stream %q. %s", name, err) - return - } - defer rc.Close() - - switch file.Mime { - case "application/vnd.test+json": - c.Header("Content-Type", "application/json") - } - - if _, err := io.Copy(c.Writer, rc); err != nil { - log.Error().Err(err).Msg("could not copy file to http response") - } -} diff --git a/server/api/pipeline.go b/server/api/pipeline.go index 59906298c..bd39af597 100644 --- a/server/api/pipeline.go +++ b/server/api/pipeline.go @@ -124,13 +124,11 @@ func GetPipeline(c *gin.Context) { _ = c.AbortWithError(http.StatusInternalServerError, err) return } - files, _ := _store.FileList(pl, &model.ListOptions{All: true}) steps, _ := _store.StepList(pl) if pl.Steps, err = model.Tree(steps); err != nil { _ = c.AbortWithError(http.StatusInternalServerError, err) return } - pl.Files = files c.JSON(http.StatusOK, pl) } diff --git a/server/config.go b/server/config.go index d1cd93a93..97fa85e2d 100644 --- a/server/config.go +++ b/server/config.go @@ -50,7 +50,6 @@ var Config = struct { // Repos model.RepoStore // Builds model.BuildStore // Logs model.LogStore - Files model.FileStore Steps model.StepStore // Registries model.RegistryStore // Secrets model.SecretStore diff --git a/server/forge/mocks/forge.go b/server/forge/mocks/forge.go index 58d82a2a4..6b0268fc4 100644 --- a/server/forge/mocks/forge.go +++ b/server/forge/mocks/forge.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.26.1. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks diff --git a/server/grpc/rpc.go b/server/grpc/rpc.go index ae4878c5e..e7c0bd082 100644 --- a/server/grpc/rpc.go +++ b/server/grpc/rpc.go @@ -19,7 +19,6 @@ package grpc import ( - "bytes" "context" "encoding/json" "errors" @@ -33,7 +32,6 @@ import ( grpcMetadata "google.golang.org/grpc/metadata" "github.com/woodpecker-ci/woodpecker/pipeline/rpc" - "github.com/woodpecker-ci/woodpecker/server" "github.com/woodpecker-ci/woodpecker/server/forge" "github.com/woodpecker-ci/woodpecker/server/logging" "github.com/woodpecker-ci/woodpecker/server/model" @@ -167,79 +165,6 @@ func (s *RPC) Update(c context.Context, id string, state rpc.State) error { return nil } -// Upload implements the rpc.Upload function -func (s *RPC) Upload(_ context.Context, id string, file *rpc.File) error { - stepID, err := strconv.ParseInt(id, 10, 64) - if err != nil { - return err - } - - pstep, err := s.store.StepLoad(stepID) - if err != nil { - log.Error().Msgf("error: cannot find parent step with id %d: %s", stepID, err) - return err - } - - pipeline, err := s.store.GetPipeline(pstep.PipelineID) - if err != nil { - log.Error().Msgf("error: cannot find pipeline with id %d: %s", pstep.PipelineID, err) - return err - } - - step, err := s.store.StepChild(pipeline, pstep.PID, file.Step) - if err != nil { - log.Error().Msgf("error: cannot find child step with name %s: %s", file.Step, err) - return err - } - - if file.Mime == "application/json+logs" { - return s.store.LogSave( - step, - bytes.NewBuffer(file.Data), - ) - } - - report := &model.File{ - PipelineID: step.PipelineID, - StepID: step.ID, - PID: step.PID, - Mime: file.Mime, - Name: file.Name, - Size: file.Size, - Time: file.Time, - } - if d, ok := file.Meta["X-Tests-Passed"]; ok { - report.Passed, _ = strconv.Atoi(d) - } - if d, ok := file.Meta["X-Tests-Failed"]; ok { - report.Failed, _ = strconv.Atoi(d) - } - if d, ok := file.Meta["X-Tests-Skipped"]; ok { - report.Skipped, _ = strconv.Atoi(d) - } - - if d, ok := file.Meta["X-Checks-Passed"]; ok { - report.Passed, _ = strconv.Atoi(d) - } - if d, ok := file.Meta["X-Checks-Failed"]; ok { - report.Failed, _ = strconv.Atoi(d) - } - - if d, ok := file.Meta["X-Coverage-Lines"]; ok { - report.Passed, _ = strconv.Atoi(d) - } - if d, ok := file.Meta["X-Coverage-Total"]; ok { - if total, _ := strconv.Atoi(d); total != 0 { - report.Failed = total - report.Passed - } - } - - return server.Config.Storage.Files.FileCreate( - report, - bytes.NewBuffer(file.Data), - ) -} - // Init implements the rpc.Init function func (s *RPC) Init(c context.Context, id string, state rpc.State) error { stepID, err := strconv.ParseInt(id, 10, 64) diff --git a/server/grpc/server.go b/server/grpc/server.go index 538d20f95..f6f57fef2 100644 --- a/server/grpc/server.go +++ b/server/grpc/server.go @@ -118,22 +118,6 @@ func (s *WoodpeckerServer) Update(c context.Context, req *proto.UpdateRequest) ( return res, err } -func (s *WoodpeckerServer) Upload(c context.Context, req *proto.UploadRequest) (*proto.Empty, error) { - file := &rpc.File{ - Data: req.GetFile().GetData(), - Mime: req.GetFile().GetMime(), - Name: req.GetFile().GetName(), - Step: req.GetFile().GetStep(), - Size: int(req.GetFile().GetSize()), - Time: req.GetFile().GetTime(), - Meta: req.GetFile().GetMeta(), - } - - res := new(proto.Empty) - err := s.peer.Upload(c, req.GetId(), file) - return res, err -} - func (s *WoodpeckerServer) Done(c context.Context, req *proto.DoneRequest) (*proto.Empty, error) { state := rpc.State{ Error: req.GetState().GetError(), diff --git a/server/model/file.go b/server/model/file.go deleted file mode 100644 index 9ab876878..000000000 --- a/server/model/file.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2021 Woodpecker Authors -// Copyright 2018 Drone.IO Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package model - -import "io" - -// FileStore persists pipeline artifacts to storage. -type FileStore interface { - FileList(*Pipeline, *ListOptions) ([]*File, error) - FileFind(*Step, string) (*File, error) - FileRead(*Step, string) (io.ReadCloser, error) - FileCreate(*File, io.Reader) error -} - -// File represents a pipeline artifact. -type File struct { - ID int64 `json:"id" xorm:"pk autoincr 'file_id'"` - PipelineID int64 `json:"-" xorm:"INDEX 'file_pipeline_id'"` - StepID int64 `json:"step_id" xorm:"UNIQUE(s) INDEX 'file_step_id'"` - PID int `json:"pid" xorm:"file_pid"` - Name string `json:"name" xorm:"UNIQUE(s) file_name"` - Size int `json:"size" xorm:"file_size"` - Mime string `json:"mime" xorm:"file_mime"` - Time int64 `json:"time" xorm:"file_time"` - Passed int `json:"passed" xorm:"file_meta_passed"` - Failed int `json:"failed" xorm:"file_meta_failed"` - Skipped int `json:"skipped" xorm:"file_meta_skipped"` - Data []byte `json:"-" xorm:"file_data"` // TODO: don't store in db but object storage? -} - -// TableName return database table name for xorm -func (File) TableName() string { - return "files" -} diff --git a/server/model/pipeline.go b/server/model/pipeline.go index 6ea9b368a..857bfc7e3 100644 --- a/server/model/pipeline.go +++ b/server/model/pipeline.go @@ -49,7 +49,6 @@ type Pipeline struct { Reviewer string `json:"reviewed_by" xorm:"pipeline_reviewer"` Reviewed int64 `json:"reviewed_at" xorm:"pipeline_reviewed"` Steps []*Step `json:"steps,omitempty" xorm:"-"` - Files []*File `json:"files,omitempty" xorm:"-"` ChangedFiles []string `json:"changed_files,omitempty" xorm:"json 'changed_files'"` AdditionalVariables map[string]string `json:"variables,omitempty" xorm:"json 'additional_variables'"` PullRequestLabels []string `json:"pr_labels,omitempty" xorm:"json 'pr_labels'"` diff --git a/server/router/api.go b/server/router/api.go index bb263f026..150de3ffb 100644 --- a/server/router/api.go +++ b/server/router/api.go @@ -95,9 +95,6 @@ func apiRoutes(e *gin.Engine) { // requires push permissions repo.DELETE("/logs/:number", session.MustPush, api.DeletePipelineLogs) - repo.GET("/files/:number", api.FileList) - repo.GET("/files/:number/:step/*file", api.FileGet) - // requires push permissions repo.GET("/secrets", session.MustPush, api.GetSecretList) repo.POST("/secrets", session.MustPush, api.PostSecret) diff --git a/server/store/datastore/file.go b/server/store/datastore/file.go deleted file mode 100644 index 66288d45b..000000000 --- a/server/store/datastore/file.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2021 Woodpecker Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package datastore - -import ( - "bytes" - "io" - - "github.com/woodpecker-ci/woodpecker/server/model" -) - -func (s storage) FileList(pipeline *model.Pipeline, p *model.ListOptions) ([]*model.File, error) { - var files []*model.File - return files, s.paginate(p).Where("file_pipeline_id = ?", pipeline.ID). - Find(&files) -} - -func (s storage) FileFind(step *model.Step, name string) (*model.File, error) { - file := &model.File{ - StepID: step.ID, - Name: name, - } - return file, wrapGet(s.engine.Get(file)) -} - -func (s storage) FileRead(step *model.Step, name string) (io.ReadCloser, error) { - file, err := s.FileFind(step, name) - if err != nil { - return nil, err - } - buf := bytes.NewBuffer(file.Data) - return io.NopCloser(buf), err -} - -func (s storage) FileCreate(file *model.File, reader io.Reader) error { - data, err := io.ReadAll(reader) - if err != nil { - return err - } - file.Data = data - // only Insert set auto created ID back to object - _, err = s.engine.Insert(file) - return err -} diff --git a/server/store/datastore/file_test.go b/server/store/datastore/file_test.go deleted file mode 100644 index ce5bbdba0..000000000 --- a/server/store/datastore/file_test.go +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright 2018 Drone.IO Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package datastore - -import ( - "bytes" - "io" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/woodpecker-ci/woodpecker/server/model" -) - -func TestFileFind(t *testing.T) { - store, closer := newTestStore(t, new(model.File), new(model.Step)) - defer closer() - - if err := store.FileCreate( - &model.File{ - PipelineID: 2, - StepID: 1, - Name: "hello.txt", - Mime: "text/plain", - Size: 11, - }, - bytes.NewBufferString("hello world"), - ); err != nil { - t.Errorf("Unexpected error: insert file: %s", err) - return - } - - file, err := store.FileFind(&model.Step{ID: 1}, "hello.txt") - if err != nil { - t.Error(err) - return - } - if got, want := file.ID, int64(1); got != want { - t.Errorf("Want file id %d, got %d", want, got) - } - if got, want := file.PipelineID, int64(2); got != want { - t.Errorf("Want file pipeline id %d, got %d", want, got) - } - if got, want := file.StepID, int64(1); got != want { - t.Errorf("Want file step id %d, got %d", want, got) - } - if got, want := file.Name, "hello.txt"; got != want { - t.Errorf("Want file name %s, got %s", want, got) - } - if got, want := file.Mime, "text/plain"; got != want { - t.Errorf("Want file mime %s, got %s", want, got) - } - if got, want := file.Size, 11; got != want { - t.Errorf("Want file size %d, got %d", want, got) - } - - rc, err := store.FileRead(&model.Step{ID: 1}, "hello.txt") - if err != nil { - t.Error(err) - return - } - out, _ := io.ReadAll(rc) - if got, want := string(out), "hello world"; got != want { - t.Errorf("Want file data %s, got %s", want, got) - } -} - -func TestFileList(t *testing.T) { - store, closer := newTestStore(t, new(model.File), new(model.Pipeline)) - defer closer() - - assert.NoError(t, store.FileCreate( - &model.File{ - PipelineID: 1, - StepID: 1, - Name: "hello.txt", - Mime: "text/plain", - Size: 11, - }, - bytes.NewBufferString("hello world"), - )) - assert.NoError(t, store.FileCreate( - &model.File{ - PipelineID: 1, - StepID: 1, - Name: "hola.txt", - Mime: "text/plain", - Size: 11, - }, - bytes.NewBufferString("hola mundo"), - )) - - files, err := store.FileList(&model.Pipeline{ID: 1}, &model.ListOptions{Page: 1, PerPage: 50}) - if err != nil { - t.Errorf("Unexpected error: select files: %s", err) - return - } - - if got, want := len(files), 2; got != want { - t.Errorf("Wanted %d files, got %d", want, got) - } -} - -func TestFileIndexes(t *testing.T) { - store, closer := newTestStore(t, new(model.File), new(model.Pipeline)) - defer closer() - - if err := store.FileCreate( - &model.File{ - PipelineID: 1, - StepID: 1, - Name: "hello.txt", - Size: 11, - Mime: "text/plain", - }, - bytes.NewBufferString("hello world"), - ); err != nil { - t.Errorf("Unexpected error: insert file: %s", err) - return - } - - // fail due to duplicate file name - if err := store.FileCreate( - &model.File{ - PipelineID: 1, - StepID: 1, - Name: "hello.txt", - Mime: "text/plain", - Size: 11, - }, - bytes.NewBufferString("hello world"), - ); err == nil { - t.Errorf("Unexpected error: duplicate pid") - } -} - -func TestFileCascade(t *testing.T) { - store, closer := newTestStore(t, new(model.File), new(model.Step), new(model.Pipeline)) - defer closer() - - stepOne := &model.Step{ - PipelineID: 1, - PID: 1, - PGID: 1, - Name: "build", - State: "success", - } - err1 := store.StepCreate([]*model.Step{stepOne}) - assert.EqualValues(t, int64(1), stepOne.ID) - - err2 := store.FileCreate( - &model.File{ - PipelineID: 1, - StepID: 1, - Name: "hello.txt", - Mime: "text/plain", - Size: 11, - }, - bytes.NewBufferString("hello world"), - ) - - if err1 != nil { - t.Errorf("Unexpected error: cannot insert step: %s", err1) - } else if err2 != nil { - t.Errorf("Unexpected error: cannot insert file: %s", err2) - } - - if _, err3 := store.StepFind(&model.Pipeline{ID: 1}, 1); err3 != nil { - t.Errorf("Unexpected error: cannot get inserted step: %s", err3) - } - - err := store.StepClear(&model.Pipeline{ID: 1, Steps: []*model.Step{stepOne}}) - assert.NoError(t, err) - - file, err4 := store.FileFind(&model.Step{ID: 1}, "hello.txt") - if err4 == nil { - t.Errorf("Expected no rows in result set error") - t.Log(file) - } -} diff --git a/server/store/datastore/migration/016_remove_files_table.go b/server/store/datastore/migration/016_remove_files_table.go new file mode 100644 index 000000000..9396ba030 --- /dev/null +++ b/server/store/datastore/migration/016_remove_files_table.go @@ -0,0 +1,26 @@ +// Copyright 2022 Woodpecker Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package migration + +import ( + "xorm.io/xorm" +) + +var dropFiles = task{ + name: "drop-files", + fn: func(sess *xorm.Session) error { + return sess.DropTable("files") + }, +} diff --git a/server/store/datastore/migration/migration.go b/server/store/datastore/migration/migration.go index 5c084b902..f2676811a 100644 --- a/server/store/datastore/migration/migration.go +++ b/server/store/datastore/migration/migration.go @@ -44,6 +44,7 @@ var migrationTasks = []*task{ &renameForgeIDToForgeRemoteID, &removeActiveFromUsers, &removeInactiveRepos, + &dropFiles, } var allBeans = []interface{}{ @@ -51,7 +52,6 @@ var allBeans = []interface{}{ new(model.Pipeline), new(model.PipelineConfig), new(model.Config), - new(model.File), new(model.Logs), new(model.Perm), new(model.Step), diff --git a/server/store/datastore/repo_test.go b/server/store/datastore/repo_test.go index 44f2f908a..813382e54 100644 --- a/server/store/datastore/repo_test.go +++ b/server/store/datastore/repo_test.go @@ -301,7 +301,6 @@ func TestRepoCrud(t *testing.T) { new(model.PipelineConfig), new(model.Logs), new(model.Step), - new(model.File), new(model.Secret), new(model.Registry), new(model.Config), diff --git a/server/store/datastore/step.go b/server/store/datastore/step.go index 7258ef870..6e948d501 100644 --- a/server/store/datastore/step.go +++ b/server/store/datastore/step.go @@ -79,10 +79,6 @@ func (s storage) StepClear(pipeline *model.Pipeline) error { return err } - if _, err := sess.Where("file_pipeline_id = ?", pipeline.ID).Delete(new(model.File)); err != nil { - return err - } - if _, err := sess.Where("step_pipeline_id = ?", pipeline.ID).Delete(new(model.Step)); err != nil { return err } @@ -94,9 +90,6 @@ func deleteStep(sess *xorm.Session, stepID int64) error { if _, err := sess.Where("log_step_id = ?", stepID).Delete(new(model.Logs)); err != nil { return err } - if _, err := sess.Where("file_step_id = ?", stepID).Delete(new(model.File)); err != nil { - return err - } _, err := sess.ID(stepID).Delete(new(model.Step)) return err } diff --git a/server/store/mocks/store.go b/server/store/mocks/store.go index 078014c32..effaea107 100644 --- a/server/store/mocks/store.go +++ b/server/store/mocks/store.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.26.1. DO NOT EDIT. +// Code generated by mockery v2.28.1. DO NOT EDIT. package mocks @@ -473,98 +473,6 @@ func (_m *Store) DeleteUser(_a0 *model.User) error { return r0 } -// FileCreate provides a mock function with given fields: _a0, _a1 -func (_m *Store) FileCreate(_a0 *model.File, _a1 io.Reader) error { - ret := _m.Called(_a0, _a1) - - var r0 error - if rf, ok := ret.Get(0).(func(*model.File, io.Reader) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// FileFind provides a mock function with given fields: _a0, _a1 -func (_m *Store) FileFind(_a0 *model.Step, _a1 string) (*model.File, error) { - ret := _m.Called(_a0, _a1) - - var r0 *model.File - var r1 error - if rf, ok := ret.Get(0).(func(*model.Step, string) (*model.File, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Step, string) *model.File); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.File) - } - } - - if rf, ok := ret.Get(1).(func(*model.Step, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// FileList provides a mock function with given fields: _a0, _a1 -func (_m *Store) FileList(_a0 *model.Pipeline, _a1 *model.ListOptions) ([]*model.File, error) { - ret := _m.Called(_a0, _a1) - - var r0 []*model.File - var r1 error - if rf, ok := ret.Get(0).(func(*model.Pipeline, *model.ListOptions) ([]*model.File, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Pipeline, *model.ListOptions) []*model.File); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.File) - } - } - - if rf, ok := ret.Get(1).(func(*model.Pipeline, *model.ListOptions) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// FileRead provides a mock function with given fields: _a0, _a1 -func (_m *Store) FileRead(_a0 *model.Step, _a1 string) (io.ReadCloser, error) { - ret := _m.Called(_a0, _a1) - - var r0 io.ReadCloser - var r1 error - if rf, ok := ret.Get(0).(func(*model.Step, string) (io.ReadCloser, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Step, string) io.ReadCloser); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(io.ReadCloser) - } - } - - if rf, ok := ret.Get(1).(func(*model.Step, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - // GetActivePipelineList provides a mock function with given fields: repo func (_m *Store) GetActivePipelineList(repo *model.Repo) ([]*model.Pipeline, error) { ret := _m.Called(repo) diff --git a/server/store/store.go b/server/store/store.go index 358da35f9..9b646bdcc 100644 --- a/server/store/store.go +++ b/server/store/store.go @@ -150,12 +150,6 @@ type Store interface { // so either find a way to write log in chunks by xorm ... LogSave(*model.Step, io.Reader) error - // Files - FileList(*model.Pipeline, *model.ListOptions) ([]*model.File, error) - FileFind(*model.Step, string) (*model.File, error) - FileRead(*model.Step, string) (io.ReadCloser, error) - FileCreate(*model.File, io.Reader) error - // Tasks // TaskList TODO: paginate & opt filter TaskList() ([]*model.Task, error) diff --git a/web/src/lib/api/index.ts b/web/src/lib/api/index.ts index 547c013ea..88c2da845 100644 --- a/web/src/lib/api/index.ts +++ b/web/src/lib/api/index.ts @@ -133,14 +133,6 @@ export default class WoodpeckerClient extends ApiClient { return this._get(`/api/repos/${owner}/${repo}/logs/${pipeline}/${step}`) as Promise; } - getArtifact(owner: string, repo: string, pipeline: string, step: string, file: string): Promise { - return this._get(`/api/repos/${owner}/${repo}/files/${pipeline}/${step}/${file}?raw=true`); - } - - getArtifactList(owner: string, repo: string, pipeline: string): Promise { - return this._get(`/api/repos/${owner}/${repo}/files/${pipeline}`); - } - getSecretList(owner: string, repo: string, page: number): Promise { return this._get(`/api/repos/${owner}/${repo}/secrets?page=${page}`) as Promise; }