1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-11-24 08:02:18 +02:00

Update grpc generated code (#2339)

missed in #2173

---------
This commit is contained in:
Anbraten 2023-08-28 18:00:52 +02:00 committed by GitHub
parent 6f1f0e37ce
commit 25225d4902
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 33 deletions

View File

@ -111,15 +111,15 @@ func (c *client) Next(ctx context.Context, f rpc.Filter) (*rpc.Workflow, error)
}
}
if res.GetPipeline() == nil {
if res.GetWorkflow() == nil {
return nil, nil
}
w := new(rpc.Workflow)
w.ID = res.GetPipeline().GetId()
w.Timeout = res.GetPipeline().GetTimeout()
w.ID = res.GetWorkflow().GetId()
w.Timeout = res.GetWorkflow().GetTimeout()
w.Config = new(backend.Config)
if err := json.Unmarshal(res.GetPipeline().GetPayload(), w.Config); err != nil {
if err := json.Unmarshal(res.GetWorkflow().GetPayload(), w.Config); err != nil {
log.Error().Err(err).Msgf("could not unmarshal workflow config of '%s'", w.ID)
}
return w, nil

View File

@ -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 = 3
const Version int32 = 4

View File

@ -16,7 +16,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.23.4
// protoc v3.21.12
// source: woodpecker.proto
package proto
@ -248,7 +248,7 @@ func (x *Filter) GetLabels() map[string]string {
return nil
}
type Pipeline struct {
type Workflow struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -258,8 +258,8 @@ type Pipeline struct {
Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
}
func (x *Pipeline) Reset() {
*x = Pipeline{}
func (x *Workflow) Reset() {
*x = Workflow{}
if protoimpl.UnsafeEnabled {
mi := &file_woodpecker_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -267,13 +267,13 @@ func (x *Pipeline) Reset() {
}
}
func (x *Pipeline) String() string {
func (x *Workflow) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Pipeline) ProtoMessage() {}
func (*Workflow) ProtoMessage() {}
func (x *Pipeline) ProtoReflect() protoreflect.Message {
func (x *Workflow) ProtoReflect() protoreflect.Message {
mi := &file_woodpecker_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -285,26 +285,26 @@ func (x *Pipeline) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use Pipeline.ProtoReflect.Descriptor instead.
func (*Pipeline) Descriptor() ([]byte, []int) {
// Deprecated: Use Workflow.ProtoReflect.Descriptor instead.
func (*Workflow) Descriptor() ([]byte, []int) {
return file_woodpecker_proto_rawDescGZIP(), []int{3}
}
func (x *Pipeline) GetId() string {
func (x *Workflow) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *Pipeline) GetTimeout() int64 {
func (x *Workflow) GetTimeout() int64 {
if x != nil {
return x.Timeout
}
return 0
}
func (x *Pipeline) GetPayload() []byte {
func (x *Workflow) GetPayload() []byte {
if x != nil {
return x.Payload
}
@ -880,7 +880,7 @@ type NextResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Pipeline *Pipeline `protobuf:"bytes,1,opt,name=pipeline,proto3" json:"pipeline,omitempty"`
Workflow *Workflow `protobuf:"bytes,1,opt,name=workflow,proto3" json:"workflow,omitempty"`
}
func (x *NextResponse) Reset() {
@ -915,9 +915,9 @@ func (*NextResponse) Descriptor() ([]byte, []int) {
return file_woodpecker_proto_rawDescGZIP(), []int{15}
}
func (x *NextResponse) GetPipeline() *Pipeline {
func (x *NextResponse) GetWorkflow() *Workflow {
if x != nil {
return x.Pipeline
return x.Workflow
}
return nil
}
@ -1116,8 +1116,8 @@ var file_woodpecker_proto_rawDesc = []byte{
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,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4e, 0x0a, 0x08, 0x57, 0x6f, 0x72,
0x6b, 0x66, 0x6c, 0x6f, 0x77, 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,
@ -1164,9 +1164,9 @@ var file_woodpecker_proto_rawDesc = []byte{
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,
0x2b, 0x0a, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c,
0x6f, 0x77, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 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,
@ -1242,7 +1242,7 @@ var file_woodpecker_proto_goTypes = []interface{}{
(*State)(nil), // 0: proto.State
(*LogEntry)(nil), // 1: proto.LogEntry
(*Filter)(nil), // 2: proto.Filter
(*Pipeline)(nil), // 3: proto.Pipeline
(*Workflow)(nil), // 3: proto.Workflow
(*NextRequest)(nil), // 4: proto.NextRequest
(*InitRequest)(nil), // 5: proto.InitRequest
(*WaitRequest)(nil), // 6: proto.WaitRequest
@ -1267,7 +1267,7 @@ var file_woodpecker_proto_depIdxs = []int32{
0, // 3: proto.DoneRequest.state:type_name -> proto.State
0, // 4: proto.UpdateRequest.state:type_name -> proto.State
1, // 5: proto.LogRequest.logEntry:type_name -> proto.LogEntry
3, // 6: proto.NextResponse.pipeline:type_name -> proto.Pipeline
3, // 6: proto.NextResponse.workflow:type_name -> proto.Workflow
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
@ -1340,7 +1340,7 @@ func file_woodpecker_proto_init() {
}
}
file_woodpecker_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Pipeline); i {
switch v := v.(*Workflow); i {
case 0:
return &v.state
case 1:

View File

@ -16,7 +16,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.23.4
// - protoc v3.21.12
// source: woodpecker.proto
package proto

View File

@ -82,10 +82,10 @@ func (s *WoodpeckerServer) Next(c context.Context, req *proto.NextRequest) (*pro
return res, err
}
res.Pipeline = new(proto.Pipeline)
res.Pipeline.Id = pipeline.ID
res.Pipeline.Timeout = pipeline.Timeout
res.Pipeline.Payload, _ = json.Marshal(pipeline.Config)
res.Workflow = new(proto.Workflow)
res.Workflow.Id = pipeline.ID
res.Workflow.Timeout = pipeline.Timeout
res.Workflow.Payload, _ = json.Marshal(pipeline.Config)
return res, err
}