From d12476f9c7e5c1c757760abbcbc521e9c97a416f Mon Sep 17 00:00:00 2001 From: Harshvir Potpose <122517264+akagami-harsh@users.noreply.github.com> Date: Wed, 8 Nov 2023 21:39:56 +0530 Subject: [PATCH] Remove google.golang.org/protobuf dependency from model & storage APIs (#4917) ## Which problem is this PR solving? - Part of #4911 ## Description of the changes - using `google.golang.org/protobuf` in place of `github.com/golang/protobuf` - `github.com/golang/protobuf` is not completely removed it is still being used as an indirect dependency ## How was this change tested? - `make test` ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [ ] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Harshvir Potpose Co-authored-by: Yuri Shkuro --- Makefile | 6 +++--- model/proto/model_test.proto | 2 ++ model/prototest/model_test.pb.go | 12 ++++-------- plugin/storage/grpc/proto/storage_test.proto | 2 ++ .../grpc/proto/storageprototest/storage_test.pb.go | 11 ++++------- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 0adcebb77a1..5f1faf3ef81 100644 --- a/Makefile +++ b/Makefile @@ -86,7 +86,7 @@ SWAGGER_IMAGE=quay.io/goswagger/swagger:v$(SWAGGER_VER) SWAGGER=docker run --rm -it -u ${shell id -u} -v "${PWD}:/go/src/" -w /go/src/ $(SWAGGER_IMAGE) SWAGGER_GEN_DIR=swagger-gen -JAEGER_DOCKER_PROTOBUF=jaegertracing/protobuf:0.3.0 +JAEGER_DOCKER_PROTOBUF=jaegertracing/protobuf:0.4.0 COLOR_PASS=$(shell printf "\033[32mPASS\033[0m") COLOR_FAIL=$(shell printf "\033[31mFAIL\033[0m") @@ -642,12 +642,12 @@ proto: proto-prepare-otel $(PROTOC) \ -Imodel/proto \ - --go_out=$(PWD)/model/prototest/ \ + --go_out=$(PWD)/model/ \ model/proto/model_test.proto $(PROTOC) \ -Iplugin/storage/grpc/proto \ - --go_out=$(PWD)/plugin/storage/grpc/proto/storageprototest/ \ + --go_out=$(PWD)/plugin/storage/grpc/proto/ \ plugin/storage/grpc/proto/storage_test.proto $(PROTOC) \ diff --git a/model/proto/model_test.proto b/model/proto/model_test.proto index 9122d25c6e0..fdbaa7e638b 100644 --- a/model/proto/model_test.proto +++ b/model/proto/model_test.proto @@ -16,6 +16,8 @@ syntax="proto3"; package prototest; +option go_package = "./prototest"; + enum SpanRefType { CHILD_OF = 0; FOLLOWS_FROM = 1; diff --git a/model/prototest/model_test.pb.go b/model/prototest/model_test.pb.go index 4171214d495..dd5aa163506 100644 --- a/model/prototest/model_test.pb.go +++ b/model/prototest/model_test.pb.go @@ -14,14 +14,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.31.0 // protoc v3.14.0 // source: model_test.proto package prototest import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -35,10 +34,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type SpanRefType int32 const ( @@ -162,8 +157,9 @@ var file_model_test_proto_rawDesc = []byte{ 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x72, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x2a, 0x2d, 0x0a, 0x0b, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x4f, 0x46, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, - 0x46, 0x4f, 0x4c, 0x4c, 0x4f, 0x57, 0x53, 0x5f, 0x46, 0x52, 0x4f, 0x4d, 0x10, 0x01, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x46, 0x4f, 0x4c, 0x4c, 0x4f, 0x57, 0x53, 0x5f, 0x46, 0x52, 0x4f, 0x4d, 0x10, 0x01, 0x42, 0x0d, + 0x5a, 0x0b, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/plugin/storage/grpc/proto/storage_test.proto b/plugin/storage/grpc/proto/storage_test.proto index 972fc1e08ce..b279e05dbab 100644 --- a/plugin/storage/grpc/proto/storage_test.proto +++ b/plugin/storage/grpc/proto/storage_test.proto @@ -16,6 +16,8 @@ syntax="proto3"; package storageprototest; +option go_package = "./storageprototest"; + message GetTraceRequest { bytes trace_id = 1; } diff --git a/plugin/storage/grpc/proto/storageprototest/storage_test.pb.go b/plugin/storage/grpc/proto/storageprototest/storage_test.pb.go index 96b907a5f23..369e573cf8f 100644 --- a/plugin/storage/grpc/proto/storageprototest/storage_test.pb.go +++ b/plugin/storage/grpc/proto/storageprototest/storage_test.pb.go @@ -14,14 +14,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 +// protoc-gen-go v1.31.0 // protoc v3.14.0 // source: storage_test.proto package storageprototest import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -35,10 +34,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type GetTraceRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -94,7 +89,9 @@ var file_storage_test_proto_rawDesc = []byte{ 0x74, 0x6f, 0x74, 0x65, 0x73, 0x74, 0x22, 0x2c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, - 0x63, 0x65, 0x49, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x65, 0x49, 0x64, 0x42, 0x14, 0x5a, 0x12, 0x2e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var (