From 8e8f72e7351d1b583ccce12cad5b34815a5fef7b Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Thu, 26 Dec 2024 20:11:10 -0400 Subject: [PATCH] Make api_v3 proto accessible from other packages (#6421) ## Which problem is this PR solving? - Part of #6422 - We cannot use api_v3 proto types outside of query service (namely from e2e v2 integration tests) because they are in the `internal` package ## Description of the changes - Move api_v3 to `internal/proto/api_v3` to be accessible from all of the code base ## How was this change tested? - CI Signed-off-by: Yuri Shkuro --- Makefile.Protobuf.mk | 2 +- cmd/query/app/apiv3/gateway_test.go | 2 +- cmd/query/app/apiv3/grpc_handler.go | 2 +- cmd/query/app/apiv3/grpc_handler_test.go | 2 +- cmd/query/app/apiv3/http_gateway.go | 2 +- cmd/query/app/server.go | 2 +- .../app/internal => internal/proto}/api_v3/query_service.pb.go | 0 {cmd/query/app/internal => internal/proto}/api_v3/traces.go | 0 .../query/app/internal => internal/proto}/api_v3/traces_test.go | 0 9 files changed, 6 insertions(+), 6 deletions(-) rename {cmd/query/app/internal => internal/proto}/api_v3/query_service.pb.go (100%) rename {cmd/query/app/internal => internal/proto}/api_v3/traces.go (100%) rename {cmd/query/app/internal => internal/proto}/api_v3/traces_test.go (100%) diff --git a/Makefile.Protobuf.mk b/Makefile.Protobuf.mk index bb10b7d8ad0..843e3889b95 100644 --- a/Makefile.Protobuf.mk +++ b/Makefile.Protobuf.mk @@ -126,7 +126,7 @@ proto-zipkin: # only to fields in a struct, so we use regex search/replace to swap it. # Note that the .pb.go types must be generated into the same internal package $(API_V3_PATH) # where a manually defined traces.go file is located. -API_V3_PATH=cmd/query/app/internal/api_v3 +API_V3_PATH=internal/proto/api_v3 API_V3_PATCHED_DIR=proto-gen/.patched/api_v3 API_V3_PATCHED=$(API_V3_PATCHED_DIR)/query_service.proto .PHONY: patch-api-v3 diff --git a/cmd/query/app/apiv3/gateway_test.go b/cmd/query/app/apiv3/gateway_test.go index 64d71fa73cf..1258d457eed 100644 --- a/cmd/query/app/apiv3/gateway_test.go +++ b/cmd/query/app/apiv3/gateway_test.go @@ -19,7 +19,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/jaegertracing/jaeger/cmd/query/app/internal/api_v3" + "github.com/jaegertracing/jaeger/internal/proto/api_v3" "github.com/jaegertracing/jaeger/model" _ "github.com/jaegertracing/jaeger/pkg/gogocodec" // force gogo codec registration "github.com/jaegertracing/jaeger/storage/spanstore" diff --git a/cmd/query/app/apiv3/grpc_handler.go b/cmd/query/app/apiv3/grpc_handler.go index b12342214c8..48af72bad4c 100644 --- a/cmd/query/app/apiv3/grpc_handler.go +++ b/cmd/query/app/apiv3/grpc_handler.go @@ -11,8 +11,8 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/jaegertracing/jaeger/cmd/query/app/internal/api_v3" "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" + "github.com/jaegertracing/jaeger/internal/proto/api_v3" "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/storage/spanstore" ) diff --git a/cmd/query/app/apiv3/grpc_handler_test.go b/cmd/query/app/apiv3/grpc_handler_test.go index b40ec48e3c2..bdf80e64646 100644 --- a/cmd/query/app/apiv3/grpc_handler_test.go +++ b/cmd/query/app/apiv3/grpc_handler_test.go @@ -16,8 +16,8 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - "github.com/jaegertracing/jaeger/cmd/query/app/internal/api_v3" "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" + "github.com/jaegertracing/jaeger/internal/proto/api_v3" "github.com/jaegertracing/jaeger/model" _ "github.com/jaegertracing/jaeger/pkg/gogocodec" // force gogo codec registration "github.com/jaegertracing/jaeger/storage/spanstore" diff --git a/cmd/query/app/apiv3/http_gateway.go b/cmd/query/app/apiv3/http_gateway.go index 0c577183e9a..57f03b6ebc5 100644 --- a/cmd/query/app/apiv3/http_gateway.go +++ b/cmd/query/app/apiv3/http_gateway.go @@ -20,8 +20,8 @@ import ( "go.opentelemetry.io/otel/trace" "go.uber.org/zap" - "github.com/jaegertracing/jaeger/cmd/query/app/internal/api_v3" "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" + "github.com/jaegertracing/jaeger/internal/proto/api_v3" "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/storage/spanstore" ) diff --git a/cmd/query/app/server.go b/cmd/query/app/server.go index 5880dd83596..ab2e89aee6c 100644 --- a/cmd/query/app/server.go +++ b/cmd/query/app/server.go @@ -27,8 +27,8 @@ import ( "google.golang.org/grpc/reflection" "github.com/jaegertracing/jaeger/cmd/query/app/apiv3" - "github.com/jaegertracing/jaeger/cmd/query/app/internal/api_v3" "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" + "github.com/jaegertracing/jaeger/internal/proto/api_v3" "github.com/jaegertracing/jaeger/pkg/bearertoken" "github.com/jaegertracing/jaeger/pkg/netutils" "github.com/jaegertracing/jaeger/pkg/recoveryhandler" diff --git a/cmd/query/app/internal/api_v3/query_service.pb.go b/internal/proto/api_v3/query_service.pb.go similarity index 100% rename from cmd/query/app/internal/api_v3/query_service.pb.go rename to internal/proto/api_v3/query_service.pb.go diff --git a/cmd/query/app/internal/api_v3/traces.go b/internal/proto/api_v3/traces.go similarity index 100% rename from cmd/query/app/internal/api_v3/traces.go rename to internal/proto/api_v3/traces.go diff --git a/cmd/query/app/internal/api_v3/traces_test.go b/internal/proto/api_v3/traces_test.go similarity index 100% rename from cmd/query/app/internal/api_v3/traces_test.go rename to internal/proto/api_v3/traces_test.go