From d066196297e69317e3782ab7daea25ed7cf9b5bf Mon Sep 17 00:00:00 2001 From: "kevin.new" Date: Wed, 10 Jun 2026 08:50:02 +0000 Subject: [PATCH 1/3] feat(pushqueue): add proto definition and domain scaffold MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce the pushqueue domain with its gateway proto (Land, CheckMergeability, Ping RPCs), generated protobuf code, and the core/ package placeholder — mirroring the existing domain layout. Co-Authored-By: Claude Opus 4.6 (1M context) --- pushqueue/core/BUILD.bazel | 8 + pushqueue/core/core.go | 20 + pushqueue/gateway/proto/BUILD.bazel | 24 + pushqueue/gateway/proto/gateway.proto | 94 ++ pushqueue/gateway/protopb/BUILD.bazel | 27 + pushqueue/gateway/protopb/gateway.pb.go | 809 ++++++++++++++++++ pushqueue/gateway/protopb/gateway.pb.yarpc.go | 392 +++++++++ pushqueue/gateway/protopb/gateway_grpc.pb.go | 211 +++++ 8 files changed, 1585 insertions(+) create mode 100644 pushqueue/core/BUILD.bazel create mode 100644 pushqueue/core/core.go create mode 100644 pushqueue/gateway/proto/BUILD.bazel create mode 100644 pushqueue/gateway/proto/gateway.proto create mode 100644 pushqueue/gateway/protopb/BUILD.bazel create mode 100644 pushqueue/gateway/protopb/gateway.pb.go create mode 100644 pushqueue/gateway/protopb/gateway.pb.yarpc.go create mode 100644 pushqueue/gateway/protopb/gateway_grpc.pb.go diff --git a/pushqueue/core/BUILD.bazel b/pushqueue/core/BUILD.bazel new file mode 100644 index 00000000..834109ff --- /dev/null +++ b/pushqueue/core/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "core", + srcs = ["core.go"], + importpath = "github.com/uber/submitqueue/pushqueue/core", + visibility = ["//visibility:public"], +) diff --git a/pushqueue/core/core.go b/pushqueue/core/core.go new file mode 100644 index 00000000..7296d6ad --- /dev/null +++ b/pushqueue/core/core.go @@ -0,0 +1,20 @@ +// Copyright (c) 2025 Uber Technologies, 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 core groups infrastructure shared across PushQueue's own services +// (gateway and orchestrator) — the PushQueue-scoped analogue of the repo-level +// core/. Cross-domain infrastructure lives in the top-level core/; this package +// is for plumbing private to PushQueue. Subpackages are added here as shared +// needs emerge, mirroring submitqueue/core. +package core diff --git a/pushqueue/gateway/proto/BUILD.bazel b/pushqueue/gateway/proto/BUILD.bazel new file mode 100644 index 00000000..a04b92f1 --- /dev/null +++ b/pushqueue/gateway/proto/BUILD.bazel @@ -0,0 +1,24 @@ +load("@rules_go//go:def.bzl", "go_library") +load("@rules_go//proto:def.bzl", "go_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") + +proto_library( + name = "protopb_proto", + srcs = ["gateway.proto"], + visibility = ["//visibility:public"], +) + +go_proto_library( + name = "protopb_go_proto", + compilers = ["@io_bazel_rules_go//proto:go_grpc_v2"], + importpath = "github.com/uber/submitqueue/pushqueue/gateway/protopb", + proto = ":protopb_proto", + visibility = ["//visibility:public"], +) + +go_library( + name = "protopb", + embed = [":protopb_go_proto"], + importpath = "github.com/uber/submitqueue/pushqueue/gateway/protopb", + visibility = ["//visibility:public"], +) diff --git a/pushqueue/gateway/proto/gateway.proto b/pushqueue/gateway/proto/gateway.proto new file mode 100644 index 00000000..f570fa84 --- /dev/null +++ b/pushqueue/gateway/proto/gateway.proto @@ -0,0 +1,94 @@ +// Copyright (c) 2025 Uber Technologies, 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. + +syntax = "proto3"; + +package uber.submitqueue.pushqueue; + +option go_package = "github.com/uber/submitqueue/pushqueue/gateway/protopb"; +option java_multiple_files = true; +option java_outer_classname = "GatewayProto"; +option java_package = "com.uber.submitqueue.pushqueue"; + +enum Strategy { + STRATEGY_UNSPECIFIED = 0; + STRATEGY_REBASE = 1; + STRATEGY_SQUASH_REBASE = 2; + STRATEGY_MERGE = 3; +} + +message Queue { + string name = 1; + string address = 2; + string target = 3; +} + +message LandItem { + repeated string uris = 1; + Strategy strategy = 2; +} + +enum OutcomeStatus { + OUTCOME_STATUS_UNSPECIFIED = 0; + OUTCOME_STATUS_COMMITTED = 1; + OUTCOME_STATUS_ALREADY_EXISTED = 2; +} + +message ItemOutcome { + OutcomeStatus status = 1; + repeated string revision_ids = 2; +} + +message LandRequest { + Queue queue = 1; + repeated LandItem items = 2; +} + +message LandResponse { + bool success = 1; + repeated ItemOutcome outcomes = 2; + string finalize_error = 3; +} + +message CheckMergeabilityRequest { + Queue queue = 1; + repeated LandItem items = 2; +} + +message MergeabilityItemResult { + bool mergeable = 1; + string reason = 2; +} + +message CheckMergeabilityResponse { + bool mergeable = 1; + repeated MergeabilityItemResult results = 2; +} + +message PingRequest { + string message = 1; +} + +message PingResponse { + string message = 1; + string service_name = 2; + int64 timestamp = 3; + string hostname = 4; +} + +service PushQueueGateway { + rpc Ping(PingRequest) returns (PingResponse) {} + rpc Land(LandRequest) returns (LandResponse) {} + rpc CheckMergeability(CheckMergeabilityRequest) returns (CheckMergeabilityResponse) {} +} diff --git a/pushqueue/gateway/protopb/BUILD.bazel b/pushqueue/gateway/protopb/BUILD.bazel new file mode 100644 index 00000000..0d442123 --- /dev/null +++ b/pushqueue/gateway/protopb/BUILD.bazel @@ -0,0 +1,27 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "protopb", + srcs = [ + "gateway.pb.go", + "gateway.pb.yarpc.go", + "gateway_grpc.pb.go", + ], + importpath = "github.com/uber/submitqueue/pushqueue/gateway/protopb", + visibility = ["//visibility:public"], + deps = [ + "@com_github_gogo_protobuf//jsonpb", + "@com_github_gogo_protobuf//proto", + "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", + "@org_golang_google_protobuf//reflect/protoreflect", + "@org_golang_google_protobuf//runtime/protoimpl", + "@org_uber_go_fx//:fx", + "@org_uber_go_yarpc//:yarpc", + "@org_uber_go_yarpc//api/transport", + "@org_uber_go_yarpc//api/x/restriction", + "@org_uber_go_yarpc//encoding/protobuf", + "@org_uber_go_yarpc//encoding/protobuf/reflection", + ], +) diff --git a/pushqueue/gateway/protopb/gateway.pb.go b/pushqueue/gateway/protopb/gateway.pb.go new file mode 100644 index 00000000..f999a7aa --- /dev/null +++ b/pushqueue/gateway/protopb/gateway.pb.go @@ -0,0 +1,809 @@ +// Copyright (c) 2025 Uber Technologies, 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. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v3.21.12 +// source: gateway.proto + +package protopb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Strategy int32 + +const ( + Strategy_STRATEGY_UNSPECIFIED Strategy = 0 + Strategy_STRATEGY_REBASE Strategy = 1 + Strategy_STRATEGY_SQUASH_REBASE Strategy = 2 + Strategy_STRATEGY_MERGE Strategy = 3 +) + +// Enum value maps for Strategy. +var ( + Strategy_name = map[int32]string{ + 0: "STRATEGY_UNSPECIFIED", + 1: "STRATEGY_REBASE", + 2: "STRATEGY_SQUASH_REBASE", + 3: "STRATEGY_MERGE", + } + Strategy_value = map[string]int32{ + "STRATEGY_UNSPECIFIED": 0, + "STRATEGY_REBASE": 1, + "STRATEGY_SQUASH_REBASE": 2, + "STRATEGY_MERGE": 3, + } +) + +func (x Strategy) Enum() *Strategy { + p := new(Strategy) + *p = x + return p +} + +func (x Strategy) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Strategy) Descriptor() protoreflect.EnumDescriptor { + return file_gateway_proto_enumTypes[0].Descriptor() +} + +func (Strategy) Type() protoreflect.EnumType { + return &file_gateway_proto_enumTypes[0] +} + +func (x Strategy) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Strategy.Descriptor instead. +func (Strategy) EnumDescriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{0} +} + +type OutcomeStatus int32 + +const ( + OutcomeStatus_OUTCOME_STATUS_UNSPECIFIED OutcomeStatus = 0 + OutcomeStatus_OUTCOME_STATUS_COMMITTED OutcomeStatus = 1 + OutcomeStatus_OUTCOME_STATUS_ALREADY_EXISTED OutcomeStatus = 2 +) + +// Enum value maps for OutcomeStatus. +var ( + OutcomeStatus_name = map[int32]string{ + 0: "OUTCOME_STATUS_UNSPECIFIED", + 1: "OUTCOME_STATUS_COMMITTED", + 2: "OUTCOME_STATUS_ALREADY_EXISTED", + } + OutcomeStatus_value = map[string]int32{ + "OUTCOME_STATUS_UNSPECIFIED": 0, + "OUTCOME_STATUS_COMMITTED": 1, + "OUTCOME_STATUS_ALREADY_EXISTED": 2, + } +) + +func (x OutcomeStatus) Enum() *OutcomeStatus { + p := new(OutcomeStatus) + *p = x + return p +} + +func (x OutcomeStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OutcomeStatus) Descriptor() protoreflect.EnumDescriptor { + return file_gateway_proto_enumTypes[1].Descriptor() +} + +func (OutcomeStatus) Type() protoreflect.EnumType { + return &file_gateway_proto_enumTypes[1] +} + +func (x OutcomeStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OutcomeStatus.Descriptor instead. +func (OutcomeStatus) EnumDescriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{1} +} + +type Queue struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Queue) Reset() { + *x = Queue{} + mi := &file_gateway_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Queue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Queue) ProtoMessage() {} + +func (x *Queue) ProtoReflect() protoreflect.Message { + mi := &file_gateway_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Queue.ProtoReflect.Descriptor instead. +func (*Queue) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{0} +} + +func (x *Queue) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Queue) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Queue) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +type LandItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + Uris []string `protobuf:"bytes,1,rep,name=uris,proto3" json:"uris,omitempty"` + Strategy Strategy `protobuf:"varint,2,opt,name=strategy,proto3,enum=uber.submitqueue.pushqueue.Strategy" json:"strategy,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LandItem) Reset() { + *x = LandItem{} + mi := &file_gateway_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LandItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LandItem) ProtoMessage() {} + +func (x *LandItem) ProtoReflect() protoreflect.Message { + mi := &file_gateway_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LandItem.ProtoReflect.Descriptor instead. +func (*LandItem) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{1} +} + +func (x *LandItem) GetUris() []string { + if x != nil { + return x.Uris + } + return nil +} + +func (x *LandItem) GetStrategy() Strategy { + if x != nil { + return x.Strategy + } + return Strategy_STRATEGY_UNSPECIFIED +} + +type ItemOutcome struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status OutcomeStatus `protobuf:"varint,1,opt,name=status,proto3,enum=uber.submitqueue.pushqueue.OutcomeStatus" json:"status,omitempty"` + RevisionIds []string `protobuf:"bytes,2,rep,name=revision_ids,json=revisionIds,proto3" json:"revision_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ItemOutcome) Reset() { + *x = ItemOutcome{} + mi := &file_gateway_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ItemOutcome) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemOutcome) ProtoMessage() {} + +func (x *ItemOutcome) ProtoReflect() protoreflect.Message { + mi := &file_gateway_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ItemOutcome.ProtoReflect.Descriptor instead. +func (*ItemOutcome) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{2} +} + +func (x *ItemOutcome) GetStatus() OutcomeStatus { + if x != nil { + return x.Status + } + return OutcomeStatus_OUTCOME_STATUS_UNSPECIFIED +} + +func (x *ItemOutcome) GetRevisionIds() []string { + if x != nil { + return x.RevisionIds + } + return nil +} + +type LandRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Queue *Queue `protobuf:"bytes,1,opt,name=queue,proto3" json:"queue,omitempty"` + Items []*LandItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LandRequest) Reset() { + *x = LandRequest{} + mi := &file_gateway_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LandRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LandRequest) ProtoMessage() {} + +func (x *LandRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LandRequest.ProtoReflect.Descriptor instead. +func (*LandRequest) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{3} +} + +func (x *LandRequest) GetQueue() *Queue { + if x != nil { + return x.Queue + } + return nil +} + +func (x *LandRequest) GetItems() []*LandItem { + if x != nil { + return x.Items + } + return nil +} + +type LandResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Outcomes []*ItemOutcome `protobuf:"bytes,2,rep,name=outcomes,proto3" json:"outcomes,omitempty"` + FinalizeError string `protobuf:"bytes,3,opt,name=finalize_error,json=finalizeError,proto3" json:"finalize_error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LandResponse) Reset() { + *x = LandResponse{} + mi := &file_gateway_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LandResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LandResponse) ProtoMessage() {} + +func (x *LandResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LandResponse.ProtoReflect.Descriptor instead. +func (*LandResponse) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{4} +} + +func (x *LandResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *LandResponse) GetOutcomes() []*ItemOutcome { + if x != nil { + return x.Outcomes + } + return nil +} + +func (x *LandResponse) GetFinalizeError() string { + if x != nil { + return x.FinalizeError + } + return "" +} + +type CheckMergeabilityRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Queue *Queue `protobuf:"bytes,1,opt,name=queue,proto3" json:"queue,omitempty"` + Items []*LandItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckMergeabilityRequest) Reset() { + *x = CheckMergeabilityRequest{} + mi := &file_gateway_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckMergeabilityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckMergeabilityRequest) ProtoMessage() {} + +func (x *CheckMergeabilityRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckMergeabilityRequest.ProtoReflect.Descriptor instead. +func (*CheckMergeabilityRequest) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{5} +} + +func (x *CheckMergeabilityRequest) GetQueue() *Queue { + if x != nil { + return x.Queue + } + return nil +} + +func (x *CheckMergeabilityRequest) GetItems() []*LandItem { + if x != nil { + return x.Items + } + return nil +} + +type MergeabilityItemResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + Mergeable bool `protobuf:"varint,1,opt,name=mergeable,proto3" json:"mergeable,omitempty"` + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MergeabilityItemResult) Reset() { + *x = MergeabilityItemResult{} + mi := &file_gateway_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MergeabilityItemResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MergeabilityItemResult) ProtoMessage() {} + +func (x *MergeabilityItemResult) ProtoReflect() protoreflect.Message { + mi := &file_gateway_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MergeabilityItemResult.ProtoReflect.Descriptor instead. +func (*MergeabilityItemResult) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{6} +} + +func (x *MergeabilityItemResult) GetMergeable() bool { + if x != nil { + return x.Mergeable + } + return false +} + +func (x *MergeabilityItemResult) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +type CheckMergeabilityResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Mergeable bool `protobuf:"varint,1,opt,name=mergeable,proto3" json:"mergeable,omitempty"` + Results []*MergeabilityItemResult `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckMergeabilityResponse) Reset() { + *x = CheckMergeabilityResponse{} + mi := &file_gateway_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckMergeabilityResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckMergeabilityResponse) ProtoMessage() {} + +func (x *CheckMergeabilityResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckMergeabilityResponse.ProtoReflect.Descriptor instead. +func (*CheckMergeabilityResponse) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{7} +} + +func (x *CheckMergeabilityResponse) GetMergeable() bool { + if x != nil { + return x.Mergeable + } + return false +} + +func (x *CheckMergeabilityResponse) GetResults() []*MergeabilityItemResult { + if x != nil { + return x.Results + } + return nil +} + +type PingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PingRequest) Reset() { + *x = PingRequest{} + mi := &file_gateway_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PingRequest) ProtoMessage() {} + +func (x *PingRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PingRequest.ProtoReflect.Descriptor instead. +func (*PingRequest) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{8} +} + +func (x *PingRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type PingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Hostname string `protobuf:"bytes,4,opt,name=hostname,proto3" json:"hostname,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PingResponse) Reset() { + *x = PingResponse{} + mi := &file_gateway_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PingResponse) ProtoMessage() {} + +func (x *PingResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PingResponse.ProtoReflect.Descriptor instead. +func (*PingResponse) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{9} +} + +func (x *PingResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *PingResponse) GetServiceName() string { + if x != nil { + return x.ServiceName + } + return "" +} + +func (x *PingResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *PingResponse) GetHostname() string { + if x != nil { + return x.Hostname + } + return "" +} + +var File_gateway_proto protoreflect.FileDescriptor + +const file_gateway_proto_rawDesc = "" + + "\n" + + "\rgateway.proto\x12\x1auber.submitqueue.pushqueue\"M\n" + + "\x05Queue\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + + "\aaddress\x18\x02 \x01(\tR\aaddress\x12\x16\n" + + "\x06target\x18\x03 \x01(\tR\x06target\"`\n" + + "\bLandItem\x12\x12\n" + + "\x04uris\x18\x01 \x03(\tR\x04uris\x12@\n" + + "\bstrategy\x18\x02 \x01(\x0e2$.uber.submitqueue.pushqueue.StrategyR\bstrategy\"s\n" + + "\vItemOutcome\x12A\n" + + "\x06status\x18\x01 \x01(\x0e2).uber.submitqueue.pushqueue.OutcomeStatusR\x06status\x12!\n" + + "\frevision_ids\x18\x02 \x03(\tR\vrevisionIds\"\x82\x01\n" + + "\vLandRequest\x127\n" + + "\x05queue\x18\x01 \x01(\v2!.uber.submitqueue.pushqueue.QueueR\x05queue\x12:\n" + + "\x05items\x18\x02 \x03(\v2$.uber.submitqueue.pushqueue.LandItemR\x05items\"\x94\x01\n" + + "\fLandResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12C\n" + + "\boutcomes\x18\x02 \x03(\v2'.uber.submitqueue.pushqueue.ItemOutcomeR\boutcomes\x12%\n" + + "\x0efinalize_error\x18\x03 \x01(\tR\rfinalizeError\"\x8f\x01\n" + + "\x18CheckMergeabilityRequest\x127\n" + + "\x05queue\x18\x01 \x01(\v2!.uber.submitqueue.pushqueue.QueueR\x05queue\x12:\n" + + "\x05items\x18\x02 \x03(\v2$.uber.submitqueue.pushqueue.LandItemR\x05items\"N\n" + + "\x16MergeabilityItemResult\x12\x1c\n" + + "\tmergeable\x18\x01 \x01(\bR\tmergeable\x12\x16\n" + + "\x06reason\x18\x02 \x01(\tR\x06reason\"\x87\x01\n" + + "\x19CheckMergeabilityResponse\x12\x1c\n" + + "\tmergeable\x18\x01 \x01(\bR\tmergeable\x12L\n" + + "\aresults\x18\x02 \x03(\v22.uber.submitqueue.pushqueue.MergeabilityItemResultR\aresults\"'\n" + + "\vPingRequest\x12\x18\n" + + "\amessage\x18\x01 \x01(\tR\amessage\"\x85\x01\n" + + "\fPingResponse\x12\x18\n" + + "\amessage\x18\x01 \x01(\tR\amessage\x12!\n" + + "\fservice_name\x18\x02 \x01(\tR\vserviceName\x12\x1c\n" + + "\ttimestamp\x18\x03 \x01(\x03R\ttimestamp\x12\x1a\n" + + "\bhostname\x18\x04 \x01(\tR\bhostname*i\n" + + "\bStrategy\x12\x18\n" + + "\x14STRATEGY_UNSPECIFIED\x10\x00\x12\x13\n" + + "\x0fSTRATEGY_REBASE\x10\x01\x12\x1a\n" + + "\x16STRATEGY_SQUASH_REBASE\x10\x02\x12\x12\n" + + "\x0eSTRATEGY_MERGE\x10\x03*q\n" + + "\rOutcomeStatus\x12\x1e\n" + + "\x1aOUTCOME_STATUS_UNSPECIFIED\x10\x00\x12\x1c\n" + + "\x18OUTCOME_STATUS_COMMITTED\x10\x01\x12\"\n" + + "\x1eOUTCOME_STATUS_ALREADY_EXISTED\x10\x022\xd1\x02\n" + + "\x10PushQueueGateway\x12[\n" + + "\x04Ping\x12'.uber.submitqueue.pushqueue.PingRequest\x1a(.uber.submitqueue.pushqueue.PingResponse\"\x00\x12[\n" + + "\x04Land\x12'.uber.submitqueue.pushqueue.LandRequest\x1a(.uber.submitqueue.pushqueue.LandResponse\"\x00\x12\x82\x01\n" + + "\x11CheckMergeability\x124.uber.submitqueue.pushqueue.CheckMergeabilityRequest\x1a5.uber.submitqueue.pushqueue.CheckMergeabilityResponse\"\x00Bg\n" + + "\x1ecom.uber.submitqueue.pushqueueB\fGatewayProtoP\x01Z5github.com/uber/submitqueue/pushqueue/gateway/protopbb\x06proto3" + +var ( + file_gateway_proto_rawDescOnce sync.Once + file_gateway_proto_rawDescData []byte +) + +func file_gateway_proto_rawDescGZIP() []byte { + file_gateway_proto_rawDescOnce.Do(func() { + file_gateway_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_gateway_proto_rawDesc), len(file_gateway_proto_rawDesc))) + }) + return file_gateway_proto_rawDescData +} + +var file_gateway_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_gateway_proto_goTypes = []any{ + (Strategy)(0), // 0: uber.submitqueue.pushqueue.Strategy + (OutcomeStatus)(0), // 1: uber.submitqueue.pushqueue.OutcomeStatus + (*Queue)(nil), // 2: uber.submitqueue.pushqueue.Queue + (*LandItem)(nil), // 3: uber.submitqueue.pushqueue.LandItem + (*ItemOutcome)(nil), // 4: uber.submitqueue.pushqueue.ItemOutcome + (*LandRequest)(nil), // 5: uber.submitqueue.pushqueue.LandRequest + (*LandResponse)(nil), // 6: uber.submitqueue.pushqueue.LandResponse + (*CheckMergeabilityRequest)(nil), // 7: uber.submitqueue.pushqueue.CheckMergeabilityRequest + (*MergeabilityItemResult)(nil), // 8: uber.submitqueue.pushqueue.MergeabilityItemResult + (*CheckMergeabilityResponse)(nil), // 9: uber.submitqueue.pushqueue.CheckMergeabilityResponse + (*PingRequest)(nil), // 10: uber.submitqueue.pushqueue.PingRequest + (*PingResponse)(nil), // 11: uber.submitqueue.pushqueue.PingResponse +} +var file_gateway_proto_depIdxs = []int32{ + 0, // 0: uber.submitqueue.pushqueue.LandItem.strategy:type_name -> uber.submitqueue.pushqueue.Strategy + 1, // 1: uber.submitqueue.pushqueue.ItemOutcome.status:type_name -> uber.submitqueue.pushqueue.OutcomeStatus + 2, // 2: uber.submitqueue.pushqueue.LandRequest.queue:type_name -> uber.submitqueue.pushqueue.Queue + 3, // 3: uber.submitqueue.pushqueue.LandRequest.items:type_name -> uber.submitqueue.pushqueue.LandItem + 4, // 4: uber.submitqueue.pushqueue.LandResponse.outcomes:type_name -> uber.submitqueue.pushqueue.ItemOutcome + 2, // 5: uber.submitqueue.pushqueue.CheckMergeabilityRequest.queue:type_name -> uber.submitqueue.pushqueue.Queue + 3, // 6: uber.submitqueue.pushqueue.CheckMergeabilityRequest.items:type_name -> uber.submitqueue.pushqueue.LandItem + 8, // 7: uber.submitqueue.pushqueue.CheckMergeabilityResponse.results:type_name -> uber.submitqueue.pushqueue.MergeabilityItemResult + 10, // 8: uber.submitqueue.pushqueue.PushQueueGateway.Ping:input_type -> uber.submitqueue.pushqueue.PingRequest + 5, // 9: uber.submitqueue.pushqueue.PushQueueGateway.Land:input_type -> uber.submitqueue.pushqueue.LandRequest + 7, // 10: uber.submitqueue.pushqueue.PushQueueGateway.CheckMergeability:input_type -> uber.submitqueue.pushqueue.CheckMergeabilityRequest + 11, // 11: uber.submitqueue.pushqueue.PushQueueGateway.Ping:output_type -> uber.submitqueue.pushqueue.PingResponse + 6, // 12: uber.submitqueue.pushqueue.PushQueueGateway.Land:output_type -> uber.submitqueue.pushqueue.LandResponse + 9, // 13: uber.submitqueue.pushqueue.PushQueueGateway.CheckMergeability:output_type -> uber.submitqueue.pushqueue.CheckMergeabilityResponse + 11, // [11:14] is the sub-list for method output_type + 8, // [8:11] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_gateway_proto_init() } +func file_gateway_proto_init() { + if File_gateway_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_gateway_proto_rawDesc), len(file_gateway_proto_rawDesc)), + NumEnums: 2, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_gateway_proto_goTypes, + DependencyIndexes: file_gateway_proto_depIdxs, + EnumInfos: file_gateway_proto_enumTypes, + MessageInfos: file_gateway_proto_msgTypes, + }.Build() + File_gateway_proto = out.File + file_gateway_proto_goTypes = nil + file_gateway_proto_depIdxs = nil +} diff --git a/pushqueue/gateway/protopb/gateway.pb.yarpc.go b/pushqueue/gateway/protopb/gateway.pb.yarpc.go new file mode 100644 index 00000000..8f016139 --- /dev/null +++ b/pushqueue/gateway/protopb/gateway.pb.yarpc.go @@ -0,0 +1,392 @@ +// Code generated by protoc-gen-yarpc-go. DO NOT EDIT. +// source: gateway.proto + +package protopb + +import ( + "context" + "io/ioutil" + "reflect" + + "github.com/gogo/protobuf/jsonpb" + "github.com/gogo/protobuf/proto" + "go.uber.org/fx" + "go.uber.org/yarpc" + "go.uber.org/yarpc/api/transport" + "go.uber.org/yarpc/api/x/restriction" + "go.uber.org/yarpc/encoding/protobuf" + "go.uber.org/yarpc/encoding/protobuf/reflection" +) + +var _ = ioutil.NopCloser + +// PushQueueGatewayYARPCClient is the YARPC client-side interface for the PushQueueGateway service. +type PushQueueGatewayYARPCClient interface { + Ping(context.Context, *PingRequest, ...yarpc.CallOption) (*PingResponse, error) + Land(context.Context, *LandRequest, ...yarpc.CallOption) (*LandResponse, error) + CheckMergeability(context.Context, *CheckMergeabilityRequest, ...yarpc.CallOption) (*CheckMergeabilityResponse, error) +} + +func newPushQueueGatewayYARPCClient(clientConfig transport.ClientConfig, anyResolver jsonpb.AnyResolver, options ...protobuf.ClientOption) PushQueueGatewayYARPCClient { + return &_PushQueueGatewayYARPCCaller{protobuf.NewStreamClient( + protobuf.ClientParams{ + ServiceName: "uber.submitqueue.pushqueue.PushQueueGateway", + ClientConfig: clientConfig, + AnyResolver: anyResolver, + Options: options, + }, + )} +} + +// NewPushQueueGatewayYARPCClient builds a new YARPC client for the PushQueueGateway service. +func NewPushQueueGatewayYARPCClient(clientConfig transport.ClientConfig, options ...protobuf.ClientOption) PushQueueGatewayYARPCClient { + return newPushQueueGatewayYARPCClient(clientConfig, nil, options...) +} + +// PushQueueGatewayYARPCServer is the YARPC server-side interface for the PushQueueGateway service. +type PushQueueGatewayYARPCServer interface { + Ping(context.Context, *PingRequest) (*PingResponse, error) + Land(context.Context, *LandRequest) (*LandResponse, error) + CheckMergeability(context.Context, *CheckMergeabilityRequest) (*CheckMergeabilityResponse, error) +} + +type buildPushQueueGatewayYARPCProceduresParams struct { + Server PushQueueGatewayYARPCServer + AnyResolver jsonpb.AnyResolver +} + +func buildPushQueueGatewayYARPCProcedures(params buildPushQueueGatewayYARPCProceduresParams) []transport.Procedure { + handler := &_PushQueueGatewayYARPCHandler{params.Server} + return protobuf.BuildProcedures( + protobuf.BuildProceduresParams{ + ServiceName: "uber.submitqueue.pushqueue.PushQueueGateway", + UnaryHandlerParams: []protobuf.BuildProceduresUnaryHandlerParams{ + { + MethodName: "Ping", + Handler: protobuf.NewUnaryHandler( + protobuf.UnaryHandlerParams{ + Handle: handler.Ping, + NewRequest: newPushQueueGatewayServicePingYARPCRequest, + AnyResolver: params.AnyResolver, + }, + ), + }, + { + MethodName: "Land", + Handler: protobuf.NewUnaryHandler( + protobuf.UnaryHandlerParams{ + Handle: handler.Land, + NewRequest: newPushQueueGatewayServiceLandYARPCRequest, + AnyResolver: params.AnyResolver, + }, + ), + }, + { + MethodName: "CheckMergeability", + Handler: protobuf.NewUnaryHandler( + protobuf.UnaryHandlerParams{ + Handle: handler.CheckMergeability, + NewRequest: newPushQueueGatewayServiceCheckMergeabilityYARPCRequest, + AnyResolver: params.AnyResolver, + }, + ), + }, + }, + OnewayHandlerParams: []protobuf.BuildProceduresOnewayHandlerParams{}, + StreamHandlerParams: []protobuf.BuildProceduresStreamHandlerParams{}, + }, + ) +} + +// BuildPushQueueGatewayYARPCProcedures prepares an implementation of the PushQueueGateway service for YARPC registration. +func BuildPushQueueGatewayYARPCProcedures(server PushQueueGatewayYARPCServer) []transport.Procedure { + return buildPushQueueGatewayYARPCProcedures(buildPushQueueGatewayYARPCProceduresParams{Server: server}) +} + +// FxPushQueueGatewayYARPCClientParams defines the input +// for NewFxPushQueueGatewayYARPCClient. It provides the +// paramaters to get a PushQueueGatewayYARPCClient in an +// Fx application. +type FxPushQueueGatewayYARPCClientParams struct { + fx.In + + Provider yarpc.ClientConfig + AnyResolver jsonpb.AnyResolver `name:"yarpcfx" optional:"true"` + Restriction restriction.Checker `optional:"true"` +} + +// FxPushQueueGatewayYARPCClientResult defines the output +// of NewFxPushQueueGatewayYARPCClient. It provides a +// PushQueueGatewayYARPCClient to an Fx application. +type FxPushQueueGatewayYARPCClientResult struct { + fx.Out + + Client PushQueueGatewayYARPCClient + + // We are using an fx.Out struct here instead of just returning a client + // so that we can add more values or add named versions of the client in + // the future without breaking any existing code. +} + +// NewFxPushQueueGatewayYARPCClient provides a PushQueueGatewayYARPCClient +// to an Fx application using the given name for routing. +// +// fx.Provide( +// protopb.NewFxPushQueueGatewayYARPCClient("service-name"), +// ... +// ) +func NewFxPushQueueGatewayYARPCClient(name string, options ...protobuf.ClientOption) interface{} { + return func(params FxPushQueueGatewayYARPCClientParams) FxPushQueueGatewayYARPCClientResult { + cc := params.Provider.ClientConfig(name) + + if params.Restriction != nil { + if namer, ok := cc.GetUnaryOutbound().(transport.Namer); ok { + if err := params.Restriction.Check(protobuf.Encoding, namer.TransportName()); err != nil { + panic(err.Error()) + } + } + } + + return FxPushQueueGatewayYARPCClientResult{ + Client: newPushQueueGatewayYARPCClient(cc, params.AnyResolver, options...), + } + } +} + +// FxPushQueueGatewayYARPCProceduresParams defines the input +// for NewFxPushQueueGatewayYARPCProcedures. It provides the +// paramaters to get PushQueueGatewayYARPCServer procedures in an +// Fx application. +type FxPushQueueGatewayYARPCProceduresParams struct { + fx.In + + Server PushQueueGatewayYARPCServer + AnyResolver jsonpb.AnyResolver `name:"yarpcfx" optional:"true"` +} + +// FxPushQueueGatewayYARPCProceduresResult defines the output +// of NewFxPushQueueGatewayYARPCProcedures. It provides +// PushQueueGatewayYARPCServer procedures to an Fx application. +// +// The procedures are provided to the "yarpcfx" value group. +// Dig 1.2 or newer must be used for this feature to work. +type FxPushQueueGatewayYARPCProceduresResult struct { + fx.Out + + Procedures []transport.Procedure `group:"yarpcfx"` + ReflectionMeta reflection.ServerMeta `group:"yarpcfx"` +} + +// NewFxPushQueueGatewayYARPCProcedures provides PushQueueGatewayYARPCServer procedures to an Fx application. +// It expects a PushQueueGatewayYARPCServer to be present in the container. +// +// fx.Provide( +// protopb.NewFxPushQueueGatewayYARPCProcedures(), +// ... +// ) +func NewFxPushQueueGatewayYARPCProcedures() interface{} { + return func(params FxPushQueueGatewayYARPCProceduresParams) FxPushQueueGatewayYARPCProceduresResult { + return FxPushQueueGatewayYARPCProceduresResult{ + Procedures: buildPushQueueGatewayYARPCProcedures(buildPushQueueGatewayYARPCProceduresParams{ + Server: params.Server, + AnyResolver: params.AnyResolver, + }), + ReflectionMeta: PushQueueGatewayReflectionMeta, + } + } +} + +// PushQueueGatewayReflectionMeta is the reflection server metadata +// required for using the gRPC reflection protocol with YARPC. +// +// See https://github.com/grpc/grpc/blob/master/doc/server-reflection.md. +var PushQueueGatewayReflectionMeta = reflection.ServerMeta{ + ServiceName: "uber.submitqueue.pushqueue.PushQueueGateway", + FileDescriptors: yarpcFileDescriptorClosuref1a937782ebbded5, +} + +type _PushQueueGatewayYARPCCaller struct { + streamClient protobuf.StreamClient +} + +func (c *_PushQueueGatewayYARPCCaller) Ping(ctx context.Context, request *PingRequest, options ...yarpc.CallOption) (*PingResponse, error) { + responseMessage, err := c.streamClient.Call(ctx, "Ping", request, newPushQueueGatewayServicePingYARPCResponse, options...) + if responseMessage == nil { + return nil, err + } + response, ok := responseMessage.(*PingResponse) + if !ok { + return nil, protobuf.CastError(emptyPushQueueGatewayServicePingYARPCResponse, responseMessage) + } + return response, err +} + +func (c *_PushQueueGatewayYARPCCaller) Land(ctx context.Context, request *LandRequest, options ...yarpc.CallOption) (*LandResponse, error) { + responseMessage, err := c.streamClient.Call(ctx, "Land", request, newPushQueueGatewayServiceLandYARPCResponse, options...) + if responseMessage == nil { + return nil, err + } + response, ok := responseMessage.(*LandResponse) + if !ok { + return nil, protobuf.CastError(emptyPushQueueGatewayServiceLandYARPCResponse, responseMessage) + } + return response, err +} + +func (c *_PushQueueGatewayYARPCCaller) CheckMergeability(ctx context.Context, request *CheckMergeabilityRequest, options ...yarpc.CallOption) (*CheckMergeabilityResponse, error) { + responseMessage, err := c.streamClient.Call(ctx, "CheckMergeability", request, newPushQueueGatewayServiceCheckMergeabilityYARPCResponse, options...) + if responseMessage == nil { + return nil, err + } + response, ok := responseMessage.(*CheckMergeabilityResponse) + if !ok { + return nil, protobuf.CastError(emptyPushQueueGatewayServiceCheckMergeabilityYARPCResponse, responseMessage) + } + return response, err +} + +type _PushQueueGatewayYARPCHandler struct { + server PushQueueGatewayYARPCServer +} + +func (h *_PushQueueGatewayYARPCHandler) Ping(ctx context.Context, requestMessage proto.Message) (proto.Message, error) { + var request *PingRequest + var ok bool + if requestMessage != nil { + request, ok = requestMessage.(*PingRequest) + if !ok { + return nil, protobuf.CastError(emptyPushQueueGatewayServicePingYARPCRequest, requestMessage) + } + } + response, err := h.server.Ping(ctx, request) + if response == nil { + return nil, err + } + return response, err +} + +func (h *_PushQueueGatewayYARPCHandler) Land(ctx context.Context, requestMessage proto.Message) (proto.Message, error) { + var request *LandRequest + var ok bool + if requestMessage != nil { + request, ok = requestMessage.(*LandRequest) + if !ok { + return nil, protobuf.CastError(emptyPushQueueGatewayServiceLandYARPCRequest, requestMessage) + } + } + response, err := h.server.Land(ctx, request) + if response == nil { + return nil, err + } + return response, err +} + +func (h *_PushQueueGatewayYARPCHandler) CheckMergeability(ctx context.Context, requestMessage proto.Message) (proto.Message, error) { + var request *CheckMergeabilityRequest + var ok bool + if requestMessage != nil { + request, ok = requestMessage.(*CheckMergeabilityRequest) + if !ok { + return nil, protobuf.CastError(emptyPushQueueGatewayServiceCheckMergeabilityYARPCRequest, requestMessage) + } + } + response, err := h.server.CheckMergeability(ctx, request) + if response == nil { + return nil, err + } + return response, err +} + +func newPushQueueGatewayServicePingYARPCRequest() proto.Message { + return &PingRequest{} +} + +func newPushQueueGatewayServicePingYARPCResponse() proto.Message { + return &PingResponse{} +} + +func newPushQueueGatewayServiceLandYARPCRequest() proto.Message { + return &LandRequest{} +} + +func newPushQueueGatewayServiceLandYARPCResponse() proto.Message { + return &LandResponse{} +} + +func newPushQueueGatewayServiceCheckMergeabilityYARPCRequest() proto.Message { + return &CheckMergeabilityRequest{} +} + +func newPushQueueGatewayServiceCheckMergeabilityYARPCResponse() proto.Message { + return &CheckMergeabilityResponse{} +} + +var ( + emptyPushQueueGatewayServicePingYARPCRequest = &PingRequest{} + emptyPushQueueGatewayServicePingYARPCResponse = &PingResponse{} + emptyPushQueueGatewayServiceLandYARPCRequest = &LandRequest{} + emptyPushQueueGatewayServiceLandYARPCResponse = &LandResponse{} + emptyPushQueueGatewayServiceCheckMergeabilityYARPCRequest = &CheckMergeabilityRequest{} + emptyPushQueueGatewayServiceCheckMergeabilityYARPCResponse = &CheckMergeabilityResponse{} +) + +var yarpcFileDescriptorClosuref1a937782ebbded5 = [][]byte{ + // gateway.proto + []byte{ + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x4d, 0x4f, 0x13, 0x41, + 0x18, 0x66, 0x5b, 0x3e, 0xca, 0xdb, 0x52, 0xeb, 0x68, 0xc8, 0xda, 0x10, 0x02, 0x1b, 0x0d, 0xc8, + 0xa1, 0x4d, 0xaa, 0xc4, 0xc4, 0x93, 0xa5, 0xac, 0xd8, 0x84, 0xd2, 0x32, 0xdb, 0x26, 0xa2, 0x87, + 0xba, 0x6d, 0xc7, 0xed, 0xc4, 0x6e, 0xb7, 0xcc, 0xcc, 0x62, 0xf0, 0x48, 0x62, 0x3c, 0x7a, 0xf1, + 0x8f, 0xf9, 0x8f, 0xcc, 0xcc, 0xee, 0x2c, 0x15, 0x61, 0x8d, 0x27, 0x6f, 0xf3, 0x7e, 0x3c, 0xcf, + 0xfb, 0x39, 0x33, 0xb0, 0xe6, 0xb9, 0x82, 0x7c, 0x76, 0x2f, 0x2b, 0x33, 0x16, 0x88, 0x00, 0x95, + 0xc3, 0x01, 0x61, 0x15, 0x1e, 0x0e, 0x7c, 0x2a, 0xce, 0x43, 0x12, 0x92, 0xca, 0x2c, 0xe4, 0x63, + 0x75, 0xb2, 0x5a, 0xb0, 0x74, 0x2a, 0x0f, 0x08, 0xc1, 0xe2, 0xd4, 0xf5, 0x89, 0x69, 0x6c, 0x19, + 0xbb, 0xab, 0x58, 0x9d, 0x91, 0x09, 0x2b, 0xee, 0x68, 0xc4, 0x08, 0xe7, 0x66, 0x46, 0xa9, 0xb5, + 0x88, 0xd6, 0x61, 0x59, 0xb8, 0xcc, 0x23, 0xc2, 0xcc, 0x2a, 0x43, 0x2c, 0x59, 0x1f, 0x20, 0x77, + 0xec, 0x4e, 0x47, 0x4d, 0x41, 0x7c, 0xc9, 0x18, 0x32, 0xca, 0x4d, 0x63, 0x2b, 0x2b, 0x19, 0xe5, + 0x19, 0xbd, 0x82, 0x1c, 0x17, 0xcc, 0x15, 0xc4, 0xbb, 0x54, 0x94, 0xc5, 0xda, 0xe3, 0xca, 0xdd, + 0xd9, 0x55, 0x9c, 0xd8, 0x17, 0x27, 0x28, 0x8b, 0x43, 0x5e, 0xb2, 0xb7, 0x43, 0x31, 0x0c, 0x7c, + 0x82, 0xea, 0xb0, 0xcc, 0x85, 0x2b, 0x42, 0xae, 0x12, 0x2f, 0xd6, 0x9e, 0xa6, 0xd1, 0xc5, 0x20, + 0x47, 0x01, 0x70, 0x0c, 0x44, 0xdb, 0x50, 0x60, 0xe4, 0x82, 0x72, 0x1a, 0x4c, 0xfb, 0x74, 0x24, + 0x4b, 0x95, 0xf9, 0xe6, 0xb5, 0xae, 0x39, 0xe2, 0xd6, 0x95, 0x01, 0x79, 0x59, 0x17, 0x26, 0xe7, + 0x21, 0xe1, 0x02, 0xbd, 0x80, 0x25, 0xc5, 0xa8, 0x82, 0xe6, 0x6b, 0xdb, 0x69, 0x41, 0x55, 0x7b, + 0x71, 0xe4, 0x8f, 0x5e, 0xc2, 0x12, 0x15, 0xc4, 0x8f, 0x82, 0xe4, 0xd3, 0x8b, 0xd7, 0x8d, 0xc4, + 0x11, 0xc4, 0xfa, 0x61, 0x40, 0x21, 0x4a, 0x82, 0xcf, 0x82, 0x29, 0x57, 0xe3, 0xe1, 0xe1, 0x70, + 0x28, 0xc7, 0x23, 0xf3, 0xc8, 0x61, 0x2d, 0xa2, 0x06, 0xe4, 0x82, 0xa8, 0x56, 0x1d, 0x69, 0x27, + 0x2d, 0xd2, 0x5c, 0x43, 0x71, 0x02, 0x44, 0x4f, 0xa0, 0xf8, 0x91, 0x4e, 0xdd, 0x09, 0xfd, 0x42, + 0xfa, 0x84, 0xb1, 0x80, 0xc5, 0xb3, 0x5e, 0xd3, 0x5a, 0x5b, 0x2a, 0xad, 0xef, 0x06, 0x98, 0x8d, + 0x31, 0x19, 0x7e, 0x6a, 0x11, 0xe6, 0x11, 0x77, 0x40, 0x27, 0x54, 0x5c, 0xfe, 0xd7, 0x46, 0x9d, + 0xc0, 0xfa, 0x7c, 0x2e, 0xca, 0x44, 0x78, 0x38, 0x11, 0x68, 0x03, 0x56, 0xfd, 0xc8, 0x32, 0x21, + 0x71, 0xcf, 0xae, 0x15, 0x72, 0xa9, 0x19, 0x71, 0x79, 0x30, 0x8d, 0xb7, 0x3d, 0x96, 0xac, 0x6f, + 0x06, 0x3c, 0xba, 0xa5, 0xc2, 0x78, 0x0a, 0xe9, 0x9c, 0xc7, 0xb0, 0xc2, 0x54, 0x6c, 0x5d, 0x49, + 0x2d, 0xad, 0x92, 0xdb, 0xd3, 0xc6, 0x9a, 0xc2, 0xda, 0x81, 0x7c, 0x87, 0x4e, 0x3d, 0xdd, 0x5d, + 0x13, 0x56, 0x7c, 0xc2, 0xb9, 0xeb, 0xe9, 0x6b, 0xab, 0x45, 0xeb, 0xab, 0x01, 0x85, 0xc8, 0xf3, + 0x7a, 0x57, 0x6e, 0x77, 0x95, 0xeb, 0xcf, 0x09, 0xbb, 0xa0, 0x43, 0xd2, 0x57, 0x0f, 0x40, 0x54, + 0x7b, 0x3e, 0xd6, 0x9d, 0xc8, 0x77, 0x60, 0x03, 0x56, 0x05, 0xf5, 0x09, 0x17, 0xae, 0x3f, 0x53, + 0x4b, 0x90, 0xc5, 0xd7, 0x0a, 0x54, 0x86, 0xdc, 0x38, 0xe0, 0x42, 0x81, 0x17, 0x15, 0x38, 0x91, + 0xf7, 0x28, 0xe4, 0xf4, 0x1d, 0x46, 0x26, 0x3c, 0x74, 0xba, 0xb8, 0xde, 0xb5, 0x8f, 0xce, 0xfa, + 0xbd, 0x13, 0xa7, 0x63, 0x37, 0x9a, 0xaf, 0x9b, 0xf6, 0x61, 0x69, 0x01, 0x3d, 0x80, 0x7b, 0x89, + 0x05, 0xdb, 0x07, 0x75, 0xc7, 0x2e, 0x19, 0xa8, 0x0c, 0xeb, 0x89, 0xd2, 0x39, 0xed, 0xd5, 0x9d, + 0x37, 0xda, 0x96, 0x41, 0x08, 0x8a, 0x89, 0xad, 0x65, 0xe3, 0x23, 0xbb, 0x94, 0xdd, 0x3b, 0x87, + 0xb5, 0xdf, 0xee, 0x37, 0xda, 0x84, 0x72, 0xbb, 0xd7, 0x6d, 0xb4, 0x5b, 0x76, 0xdf, 0xe9, 0xd6, + 0xbb, 0x3d, 0xe7, 0x46, 0xd4, 0x0d, 0x30, 0x6f, 0xd8, 0x1b, 0xed, 0x56, 0xab, 0xd9, 0xed, 0xda, + 0x87, 0x25, 0x03, 0x59, 0xb0, 0x79, 0xc3, 0x5a, 0x3f, 0xc6, 0x76, 0xfd, 0xf0, 0xac, 0x6f, 0xbf, + 0x6d, 0x3a, 0xd2, 0x27, 0x53, 0xfb, 0x99, 0x81, 0x52, 0x27, 0xe4, 0x63, 0xb5, 0xb9, 0x47, 0xd1, + 0x9b, 0x8b, 0xde, 0xc3, 0xa2, 0xec, 0x3c, 0x4a, 0xbd, 0x71, 0x73, 0x53, 0x2c, 0xef, 0xfe, 0xdd, + 0x31, 0x1a, 0xa2, 0xb5, 0x20, 0xc9, 0xe5, 0xb6, 0xa7, 0x93, 0xcf, 0xbd, 0x54, 0xe9, 0xe4, 0xf3, + 0xaf, 0x89, 0xb5, 0x80, 0xae, 0x0c, 0xb8, 0xff, 0xc7, 0x9e, 0xa3, 0xe7, 0x69, 0x0c, 0x77, 0x5d, + 0xfc, 0xf2, 0xfe, 0x3f, 0xa2, 0x74, 0x12, 0x07, 0x1e, 0x6c, 0x0e, 0x03, 0x3f, 0x05, 0x7d, 0x50, + 0x88, 0x3b, 0xdd, 0x91, 0x9f, 0x5b, 0xc7, 0x78, 0xb7, 0xef, 0x51, 0x31, 0x0e, 0x07, 0x95, 0x61, + 0xe0, 0x57, 0x25, 0xac, 0x3a, 0x07, 0xab, 0x26, 0xb0, 0x6a, 0xfc, 0x27, 0x56, 0xd5, 0x9f, 0x38, + 0x1b, 0x0c, 0x96, 0xd5, 0xe1, 0xd9, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, 0x4b, 0xd1, 0xc3, + 0x2d, 0x07, 0x00, 0x00, + }, +} + +func init() { + yarpc.RegisterClientBuilder( + func(clientConfig transport.ClientConfig, structField reflect.StructField) PushQueueGatewayYARPCClient { + return NewPushQueueGatewayYARPCClient(clientConfig, protobuf.ClientBuilderOptions(clientConfig, structField)...) + }, + ) +} diff --git a/pushqueue/gateway/protopb/gateway_grpc.pb.go b/pushqueue/gateway/protopb/gateway_grpc.pb.go new file mode 100644 index 00000000..88c1bb6e --- /dev/null +++ b/pushqueue/gateway/protopb/gateway_grpc.pb.go @@ -0,0 +1,211 @@ +// Copyright (c) 2025 Uber Technologies, 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. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.21.12 +// source: gateway.proto + +package protopb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + PushQueueGateway_Ping_FullMethodName = "/uber.submitqueue.pushqueue.PushQueueGateway/Ping" + PushQueueGateway_Land_FullMethodName = "/uber.submitqueue.pushqueue.PushQueueGateway/Land" + PushQueueGateway_CheckMergeability_FullMethodName = "/uber.submitqueue.pushqueue.PushQueueGateway/CheckMergeability" +) + +// PushQueueGatewayClient is the client API for PushQueueGateway service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PushQueueGatewayClient interface { + Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) + Land(ctx context.Context, in *LandRequest, opts ...grpc.CallOption) (*LandResponse, error) + CheckMergeability(ctx context.Context, in *CheckMergeabilityRequest, opts ...grpc.CallOption) (*CheckMergeabilityResponse, error) +} + +type pushQueueGatewayClient struct { + cc grpc.ClientConnInterface +} + +func NewPushQueueGatewayClient(cc grpc.ClientConnInterface) PushQueueGatewayClient { + return &pushQueueGatewayClient{cc} +} + +func (c *pushQueueGatewayClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PingResponse) + err := c.cc.Invoke(ctx, PushQueueGateway_Ping_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pushQueueGatewayClient) Land(ctx context.Context, in *LandRequest, opts ...grpc.CallOption) (*LandResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LandResponse) + err := c.cc.Invoke(ctx, PushQueueGateway_Land_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pushQueueGatewayClient) CheckMergeability(ctx context.Context, in *CheckMergeabilityRequest, opts ...grpc.CallOption) (*CheckMergeabilityResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CheckMergeabilityResponse) + err := c.cc.Invoke(ctx, PushQueueGateway_CheckMergeability_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PushQueueGatewayServer is the server API for PushQueueGateway service. +// All implementations must embed UnimplementedPushQueueGatewayServer +// for forward compatibility. +type PushQueueGatewayServer interface { + Ping(context.Context, *PingRequest) (*PingResponse, error) + Land(context.Context, *LandRequest) (*LandResponse, error) + CheckMergeability(context.Context, *CheckMergeabilityRequest) (*CheckMergeabilityResponse, error) + mustEmbedUnimplementedPushQueueGatewayServer() +} + +// UnimplementedPushQueueGatewayServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedPushQueueGatewayServer struct{} + +func (UnimplementedPushQueueGatewayServer) Ping(context.Context, *PingRequest) (*PingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +} +func (UnimplementedPushQueueGatewayServer) Land(context.Context, *LandRequest) (*LandResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Land not implemented") +} +func (UnimplementedPushQueueGatewayServer) CheckMergeability(context.Context, *CheckMergeabilityRequest) (*CheckMergeabilityResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckMergeability not implemented") +} +func (UnimplementedPushQueueGatewayServer) mustEmbedUnimplementedPushQueueGatewayServer() {} +func (UnimplementedPushQueueGatewayServer) testEmbeddedByValue() {} + +// UnsafePushQueueGatewayServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PushQueueGatewayServer will +// result in compilation errors. +type UnsafePushQueueGatewayServer interface { + mustEmbedUnimplementedPushQueueGatewayServer() +} + +func RegisterPushQueueGatewayServer(s grpc.ServiceRegistrar, srv PushQueueGatewayServer) { + // If the following call pancis, it indicates UnimplementedPushQueueGatewayServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&PushQueueGateway_ServiceDesc, srv) +} + +func _PushQueueGateway_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PushQueueGatewayServer).Ping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PushQueueGateway_Ping_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PushQueueGatewayServer).Ping(ctx, req.(*PingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PushQueueGateway_Land_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LandRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PushQueueGatewayServer).Land(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PushQueueGateway_Land_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PushQueueGatewayServer).Land(ctx, req.(*LandRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PushQueueGateway_CheckMergeability_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckMergeabilityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PushQueueGatewayServer).CheckMergeability(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PushQueueGateway_CheckMergeability_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PushQueueGatewayServer).CheckMergeability(ctx, req.(*CheckMergeabilityRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// PushQueueGateway_ServiceDesc is the grpc.ServiceDesc for PushQueueGateway service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PushQueueGateway_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "uber.submitqueue.pushqueue.PushQueueGateway", + HandlerType: (*PushQueueGatewayServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Ping", + Handler: _PushQueueGateway_Ping_Handler, + }, + { + MethodName: "Land", + Handler: _PushQueueGateway_Land_Handler, + }, + { + MethodName: "CheckMergeability", + Handler: _PushQueueGateway_CheckMergeability_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "gateway.proto", +} From 6be5d1b354744674e5a8681ef924d4df6f71cca6 Mon Sep 17 00:00:00 2001 From: "kevin.new" Date: Wed, 10 Jun 2026 16:27:05 +0000 Subject: [PATCH 2/3] chore: tidy module files after proto generation Co-Authored-By: Claude Opus 4.6 (1M context) --- MODULE.bazel | 1 + go.mod | 3 +++ go.sum | 17 +++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/MODULE.bazel b/MODULE.bazel index af8557eb..d6835568 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -51,6 +51,7 @@ use_repo( go_deps, "com_github_data_dog_go_sqlmock", "com_github_go_sql_driver_mysql", + "com_github_gogo_protobuf", "com_github_spf13_cobra", "com_github_stretchr_testify", "com_github_uber_go_tally", diff --git a/go.mod b/go.mod index ba21f2e4..9db89d9c 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.24.5 require ( github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/go-sql-driver/mysql v1.6.0 + github.com/gogo/protobuf v1.3.2 github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.11.1 github.com/uber-go/tally v3.5.8+incompatible @@ -23,6 +24,8 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/gogo/googleapis v1.4.1 // indirect + github.com/gogo/status v1.1.0 // indirect github.com/golang/mock v1.7.0-rc.1 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/go.sum b/go.sum index 199e1c87..6417ffa1 100644 --- a/go.sum +++ b/go.sum @@ -35,9 +35,11 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA= @@ -77,6 +79,7 @@ github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/ github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.7.0 h1:+SbscKmWJ5mOK/bO1zS60F5I9WwZDWOfRsC4RwfwRV0= github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -167,6 +170,8 @@ github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVK github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/uber/tchannel-go v1.34.4 h1:Wi7SSfUQbJ4lPqS4trP1uAZvWu46oK0qz0tOodcfcbY= github.com/uber/tchannel-go v1.34.4/go.mod h1:ERHDsQa50nNJxV8Mm6V4nxPWyGvGxiV+T/dUNRzmoC4= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= @@ -205,6 +210,8 @@ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhp golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= @@ -215,7 +222,9 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= @@ -224,8 +233,10 @@ golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= @@ -241,6 +252,7 @@ golang.org/x/sys v0.0.0-20200117145432-59e60aa80a0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -251,6 +263,7 @@ golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= @@ -263,6 +276,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200117215004-fe56e6335763/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= @@ -273,8 +288,10 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto/googleapis/rpc v0.0.0-20241230172942-26aa7a208def h1:4P81qv5JXI/sDNae2ClVx88cgDDA6DPilADkG9tYKz8= google.golang.org/genproto/googleapis/rpc v0.0.0-20241230172942-26aa7a208def/go.mod h1:bdAgzvd4kFrpykc5/AC2eLUiegK9T/qxZHD4hXYf/ho= +google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= From 38edc81d8eb84795ac52fc7d0accc595b6f1c8bf Mon Sep 17 00:00:00 2001 From: "kevin.new" Date: Wed, 10 Jun 2026 17:50:30 +0000 Subject: [PATCH 3/3] fix: correct proto BUILD.bazel for Bzlmod and format generated files Use @rules_go (not @io_bazel_rules_go) and add proto/protopb alias to match stovepipe pattern. Reformat generated .pb.go files. Co-Authored-By: Claude Opus 4.6 (1M context) --- pushqueue/gateway/proto/BUILD.bazel | 23 +++++++++++++++----- pushqueue/gateway/protopb/gateway.pb.go | 5 +++-- pushqueue/gateway/protopb/gateway_grpc.pb.go | 1 + 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/pushqueue/gateway/proto/BUILD.bazel b/pushqueue/gateway/proto/BUILD.bazel index a04b92f1..4ae2a35a 100644 --- a/pushqueue/gateway/proto/BUILD.bazel +++ b/pushqueue/gateway/proto/BUILD.bazel @@ -3,22 +3,33 @@ load("@rules_go//proto:def.bzl", "go_proto_library") load("@rules_proto//proto:defs.bzl", "proto_library") proto_library( - name = "protopb_proto", + name = "gatewaypb_proto", srcs = ["gateway.proto"], visibility = ["//visibility:public"], ) +# keep go_proto_library( - name = "protopb_go_proto", - compilers = ["@io_bazel_rules_go//proto:go_grpc_v2"], - importpath = "github.com/uber/submitqueue/pushqueue/gateway/protopb", - proto = ":protopb_proto", + name = "gatewaypb_go_proto", + compilers = [ + "@rules_go//proto:go_proto", + "@rules_go//proto:go_grpc_v2", + ], + importpath = "github.com/uber/submitqueue/pushqueue/gateway/proto", + proto = ":gatewaypb_proto", + visibility = ["//visibility:public"], +) + +go_library( + name = "proto", + embed = [":gatewaypb_go_proto"], + importpath = "github.com/uber/submitqueue/pushqueue/gateway/proto", visibility = ["//visibility:public"], ) go_library( name = "protopb", - embed = [":protopb_go_proto"], + embed = [":gatewaypb_go_proto"], importpath = "github.com/uber/submitqueue/pushqueue/gateway/protopb", visibility = ["//visibility:public"], ) diff --git a/pushqueue/gateway/protopb/gateway.pb.go b/pushqueue/gateway/protopb/gateway.pb.go index f999a7aa..92ea24e8 100644 --- a/pushqueue/gateway/protopb/gateway.pb.go +++ b/pushqueue/gateway/protopb/gateway.pb.go @@ -21,11 +21,12 @@ package protopb import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/pushqueue/gateway/protopb/gateway_grpc.pb.go b/pushqueue/gateway/protopb/gateway_grpc.pb.go index 88c1bb6e..c563c780 100644 --- a/pushqueue/gateway/protopb/gateway_grpc.pb.go +++ b/pushqueue/gateway/protopb/gateway_grpc.pb.go @@ -22,6 +22,7 @@ package protopb import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status"