From bfdc872decff62b2eb2131fad543eb6da429d4ee Mon Sep 17 00:00:00 2001 From: andream16 Date: Sat, 12 Oct 2024 19:23:14 +0100 Subject: [PATCH] Bumping buf to v2 to build correctly and removing out of date or unused configuration. Bumping proto plugins to latest. --- api/proto/v1/engine.pb.go | 77 ++++++++------------------------------- api/proto/v1/issue.pb.go | 57 +++++++---------------------- buf.lock | 11 +----- buf.yaml | 10 +---- 4 files changed, 31 insertions(+), 124 deletions(-) diff --git a/api/proto/v1/engine.pb.go b/api/proto/v1/engine.pb.go index b93fd46be..7d7cd230d 100644 --- a/api/proto/v1/engine.pb.go +++ b/api/proto/v1/engine.pb.go @@ -1,18 +1,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.35.1 // protoc (unknown) // source: api/proto/v1/engine.proto package v1 import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( @@ -40,11 +39,9 @@ type ScanInfo struct { func (x *ScanInfo) Reset() { *x = ScanInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_v1_engine_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_api_proto_v1_engine_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ScanInfo) String() string { @@ -55,7 +52,7 @@ func (*ScanInfo) ProtoMessage() {} func (x *ScanInfo) ProtoReflect() protoreflect.Message { mi := &file_api_proto_v1_engine_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -110,11 +107,9 @@ type LaunchToolResponse struct { func (x *LaunchToolResponse) Reset() { *x = LaunchToolResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_v1_engine_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_api_proto_v1_engine_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LaunchToolResponse) String() string { @@ -125,7 +120,7 @@ func (*LaunchToolResponse) ProtoMessage() {} func (x *LaunchToolResponse) ProtoReflect() protoreflect.Message { mi := &file_api_proto_v1_engine_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -183,11 +178,9 @@ type EnrichedLaunchToolResponse struct { func (x *EnrichedLaunchToolResponse) Reset() { *x = EnrichedLaunchToolResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_v1_engine_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_api_proto_v1_engine_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *EnrichedLaunchToolResponse) String() string { @@ -198,7 +191,7 @@ func (*EnrichedLaunchToolResponse) ProtoMessage() {} func (x *EnrichedLaunchToolResponse) ProtoReflect() protoreflect.Message { mi := &file_api_proto_v1_engine_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -293,7 +286,7 @@ func file_api_proto_v1_engine_proto_rawDescGZIP() []byte { } var file_api_proto_v1_engine_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_api_proto_v1_engine_proto_goTypes = []interface{}{ +var file_api_proto_v1_engine_proto_goTypes = []any{ (*ScanInfo)(nil), // 0: ocurity.dracon.v1.ScanInfo (*LaunchToolResponse)(nil), // 1: ocurity.dracon.v1.LaunchToolResponse (*EnrichedLaunchToolResponse)(nil), // 2: ocurity.dracon.v1.EnrichedLaunchToolResponse @@ -322,44 +315,6 @@ func file_api_proto_v1_engine_proto_init() { return } file_api_proto_v1_issue_proto_init() - if !protoimpl.UnsafeEnabled { - file_api_proto_v1_engine_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ScanInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_v1_engine_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LaunchToolResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_v1_engine_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnrichedLaunchToolResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/api/proto/v1/issue.pb.go b/api/proto/v1/issue.pb.go index d0d2ec3fa..415d6154a 100644 --- a/api/proto/v1/issue.pb.go +++ b/api/proto/v1/issue.pb.go @@ -1,18 +1,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.35.1 // protoc (unknown) // source: api/proto/v1/issue.proto package v1 import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( @@ -188,11 +187,9 @@ type Issue struct { func (x *Issue) Reset() { *x = Issue{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_v1_issue_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_api_proto_v1_issue_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Issue) String() string { @@ -203,7 +200,7 @@ func (*Issue) ProtoMessage() {} func (x *Issue) ProtoReflect() protoreflect.Message { mi := &file_api_proto_v1_issue_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -333,11 +330,9 @@ type EnrichedIssue struct { func (x *EnrichedIssue) Reset() { *x = EnrichedIssue{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_v1_issue_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_api_proto_v1_issue_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *EnrichedIssue) String() string { @@ -348,7 +343,7 @@ func (*EnrichedIssue) ProtoMessage() {} func (x *EnrichedIssue) ProtoReflect() protoreflect.Message { mi := &file_api_proto_v1_issue_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -513,7 +508,7 @@ func file_api_proto_v1_issue_proto_rawDescGZIP() []byte { var file_api_proto_v1_issue_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_api_proto_v1_issue_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_api_proto_v1_issue_proto_goTypes = []interface{}{ +var file_api_proto_v1_issue_proto_goTypes = []any{ (Confidence)(0), // 0: ocurity.dracon.v1.Confidence (Severity)(0), // 1: ocurity.dracon.v1.Severity (*Issue)(nil), // 2: ocurity.dracon.v1.Issue @@ -540,33 +535,7 @@ func file_api_proto_v1_issue_proto_init() { if File_api_proto_v1_issue_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_api_proto_v1_issue_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Issue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_v1_issue_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnrichedIssue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_api_proto_v1_issue_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_api_proto_v1_issue_proto_msgTypes[0].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/buf.lock b/buf.lock index d8efa9a96..4f98143f5 100644 --- a/buf.lock +++ b/buf.lock @@ -1,11 +1,2 @@ # Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: googleapis - repository: googleapis - commit: 75b4300737fb4efca0831636be94e517 - - remote: buf.build - owner: grpc-ecosystem - repository: grpc-gateway - commit: a1ecdc58eccd49aa8bea2a7a9022dc27 +version: v2 diff --git a/buf.yaml b/buf.yaml index b6059998b..b816b2001 100644 --- a/buf.yaml +++ b/buf.yaml @@ -1,5 +1,5 @@ --- -version: v1 +version: v2 lint: use: - DEFAULT @@ -10,11 +10,3 @@ lint: # we use Please to run protoc where we only need the last part of the # package name to match the directory name. - PACKAGE_DIRECTORY_MATCH - -deps: - # buf requires us to add the third party protos here as deps. - # Run: - # $ ./pleasew run "//third_party/binary/bufbuild/buf:buf|buf" -- mod update - # when you update this to update the lock file. - - buf.build/googleapis/googleapis - - buf.build/grpc-ecosystem/grpc-gateway