From 5bb2355d551db70041590f16dcdf943d7d17c476 Mon Sep 17 00:00:00 2001 From: Preetam Dwivedi Date: Wed, 17 Jun 2026 10:11:44 -0700 Subject: [PATCH] feat(stovepipe): add Ingest RPC to gateway for trunk commit verification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary ### Why? Stovepipe verifies commits that are already on trunk (post-merge/post-submit build and test), but its gateway only exposed Ping. It needs an intake RPC, analogous to SubmitQueue's Land, where a client hands in a trunk commit and gets back a tracking id while verification runs asynchronously. ### What? Adds the `Ingest` RPC to the Stovepipe gateway proto contract (proto-only; controller and server wiring follow separately): - `IngestRequest{ queue, change }` and `IngestResponse{ spid }`, where `spid` is the "stovepipe id" handle for tracking the request lifecycle (mirroring Land's `sqid`). - `change` reuses the shared `uber.base.change.Change` wire type from the parent PR; for git, callers pass a `git://///` commit URI. Unlike Land there is no merge strategy, since the commit is already on trunk. ## Test Plan - ✅ `make proto` - ✅ `./tool/bazel build //...` - ✅ `make test` Co-authored-by: Cursor --- api/stovepipe/gateway/proto/BUILD.bazel | 3 + api/stovepipe/gateway/proto/gateway.proto | 21 +++ api/stovepipe/gateway/protopb/BUILD.bazel | 1 + api/stovepipe/gateway/protopb/gateway.pb.go | 143 ++++++++++++++++-- .../gateway/protopb/gateway.pb.yarpc.go | 107 ++++++++++--- .../gateway/protopb/gateway_grpc.pb.go | 44 +++++- tool/proto/BUILD.bazel | 1 + 7 files changed, 286 insertions(+), 34 deletions(-) diff --git a/api/stovepipe/gateway/proto/BUILD.bazel b/api/stovepipe/gateway/proto/BUILD.bazel index 7611c3e3..36a87e6d 100644 --- a/api/stovepipe/gateway/proto/BUILD.bazel +++ b/api/stovepipe/gateway/proto/BUILD.bazel @@ -11,6 +11,7 @@ proto_library( name = "gatewaypb_proto", srcs = ["gateway.proto"], visibility = ["//visibility:public"], + deps = ["//api/base/change/proto:changepb_proto"], ) # keep @@ -23,6 +24,8 @@ go_proto_library( importpath = "github.com/uber/submitqueue/api/stovepipe/gateway/proto", proto = ":gatewaypb_proto", visibility = ["//visibility:public"], + # keep + deps = ["//api/base/change/proto:changepb_go_proto"], ) go_library( diff --git a/api/stovepipe/gateway/proto/gateway.proto b/api/stovepipe/gateway/proto/gateway.proto index f61ac0d7..4463e026 100644 --- a/api/stovepipe/gateway/proto/gateway.proto +++ b/api/stovepipe/gateway/proto/gateway.proto @@ -21,6 +21,8 @@ option java_multiple_files = true; option java_outer_classname = "GatewayProto"; option java_package = "com.uber.submitqueue.stovepipe"; +import "api/base/change/proto/change.proto"; + // PingRequest is the request for the Ping method message PingRequest { // Optional message to include in the ping @@ -39,8 +41,27 @@ message PingResponse { string hostname = 4; } +// IngestRequest defines a request to ingest a trunk commit into Stovepipe, triggering its verification (build and test) post-merge/post-submit. +message IngestRequest { + // Name of the queue processing the ingest request. The queue should be defined in the configuration, otherwise an error is returned. + string queue = 1; + // Change (trunk commit) to ingest, identified by URI. The target trunk and build/test configuration are defined by the queue configuration. + // Stovepipe ingests commits that are already on trunk; for git, supply a "git://///" URI. + uber.base.change.Change change = 2; +} + +// IngestResponse defines the response to an ingest request. +message IngestResponse { + // Globally unique identifier for the ingested commit's verification request (the "stovepipe id", spid). Used to track the request lifecycle. + string spid = 1; +} + // StovepipeGateway provides the Stovepipe gateway API. service StovepipeGateway { // Ping returns a response indicating the service is alive rpc Ping(PingRequest) returns (PingResponse) {} + + // Ingest accepts a trunk commit and triggers its verification (post-merge/post-submit build and test). + // The processing is asynchronous and returns an IngestResponse immediately; the verification runs in the background. + rpc Ingest(IngestRequest) returns (IngestResponse) {} } diff --git a/api/stovepipe/gateway/protopb/BUILD.bazel b/api/stovepipe/gateway/protopb/BUILD.bazel index 23853190..9117601b 100644 --- a/api/stovepipe/gateway/protopb/BUILD.bazel +++ b/api/stovepipe/gateway/protopb/BUILD.bazel @@ -10,6 +10,7 @@ go_library( importpath = "github.com/uber/submitqueue/api/stovepipe/gateway/protopb", visibility = ["//visibility:public"], deps = [ + "//api/base/change/protopb", "@org_golang_google_grpc//:grpc", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", diff --git a/api/stovepipe/gateway/protopb/gateway.pb.go b/api/stovepipe/gateway/protopb/gateway.pb.go index 8be733bd..5d75950c 100644 --- a/api/stovepipe/gateway/protopb/gateway.pb.go +++ b/api/stovepipe/gateway/protopb/gateway.pb.go @@ -25,6 +25,7 @@ import ( sync "sync" unsafe "unsafe" + protopb "github.com/uber/submitqueue/api/base/change/protopb" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) @@ -155,20 +156,128 @@ func (x *PingResponse) GetHostname() string { return "" } +// IngestRequest defines a request to ingest a trunk commit into Stovepipe, triggering its verification (build and test) post-merge/post-submit. +type IngestRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name of the queue processing the ingest request. The queue should be defined in the configuration, otherwise an error is returned. + Queue string `protobuf:"bytes,1,opt,name=queue,proto3" json:"queue,omitempty"` + // Change (trunk commit) to ingest, identified by URI. The target trunk and build/test configuration are defined by the queue configuration. + // Stovepipe ingests commits that are already on trunk; for git, supply a "git://///" URI. + Change *protopb.Change `protobuf:"bytes,2,opt,name=change,proto3" json:"change,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IngestRequest) Reset() { + *x = IngestRequest{} + mi := &file_gateway_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IngestRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IngestRequest) ProtoMessage() {} + +func (x *IngestRequest) 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 IngestRequest.ProtoReflect.Descriptor instead. +func (*IngestRequest) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{2} +} + +func (x *IngestRequest) GetQueue() string { + if x != nil { + return x.Queue + } + return "" +} + +func (x *IngestRequest) GetChange() *protopb.Change { + if x != nil { + return x.Change + } + return nil +} + +// IngestResponse defines the response to an ingest request. +type IngestResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Globally unique identifier for the ingested commit's verification request (the "stovepipe id", spid). Used to track the request lifecycle. + Spid string `protobuf:"bytes,1,opt,name=spid,proto3" json:"spid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IngestResponse) Reset() { + *x = IngestResponse{} + mi := &file_gateway_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IngestResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IngestResponse) ProtoMessage() {} + +func (x *IngestResponse) 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 IngestResponse.ProtoReflect.Descriptor instead. +func (*IngestResponse) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{3} +} + +func (x *IngestResponse) GetSpid() string { + if x != nil { + return x.Spid + } + return "" +} + var File_gateway_proto protoreflect.FileDescriptor const file_gateway_proto_rawDesc = "" + "\n" + - "\rgateway.proto\x12\x1auber.submitqueue.stovepipe\"'\n" + + "\rgateway.proto\x12\x1auber.submitqueue.stovepipe\x1a\"api/base/change/proto/change.proto\"'\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\bhostname2o\n" + + "\bhostname\x18\x04 \x01(\tR\bhostname\"W\n" + + "\rIngestRequest\x12\x14\n" + + "\x05queue\x18\x01 \x01(\tR\x05queue\x120\n" + + "\x06change\x18\x02 \x01(\v2\x18.uber.base.change.ChangeR\x06change\"$\n" + + "\x0eIngestResponse\x12\x12\n" + + "\x04spid\x18\x01 \x01(\tR\x04spid2\xd2\x01\n" + "\x10StovepipeGateway\x12[\n" + - "\x04Ping\x12'.uber.submitqueue.stovepipe.PingRequest\x1a(.uber.submitqueue.stovepipe.PingResponse\"\x00Bk\n" + + "\x04Ping\x12'.uber.submitqueue.stovepipe.PingRequest\x1a(.uber.submitqueue.stovepipe.PingResponse\"\x00\x12a\n" + + "\x06Ingest\x12).uber.submitqueue.stovepipe.IngestRequest\x1a*.uber.submitqueue.stovepipe.IngestResponse\"\x00Bk\n" + "\x1ecom.uber.submitqueue.stovepipeB\fGatewayProtoP\x01Z9github.com/uber/submitqueue/api/stovepipe/gateway/protopbb\x06proto3" var ( @@ -183,19 +292,25 @@ func file_gateway_proto_rawDescGZIP() []byte { return file_gateway_proto_rawDescData } -var file_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_gateway_proto_goTypes = []any{ - (*PingRequest)(nil), // 0: uber.submitqueue.stovepipe.PingRequest - (*PingResponse)(nil), // 1: uber.submitqueue.stovepipe.PingResponse + (*PingRequest)(nil), // 0: uber.submitqueue.stovepipe.PingRequest + (*PingResponse)(nil), // 1: uber.submitqueue.stovepipe.PingResponse + (*IngestRequest)(nil), // 2: uber.submitqueue.stovepipe.IngestRequest + (*IngestResponse)(nil), // 3: uber.submitqueue.stovepipe.IngestResponse + (*protopb.Change)(nil), // 4: uber.base.change.Change } var file_gateway_proto_depIdxs = []int32{ - 0, // 0: uber.submitqueue.stovepipe.StovepipeGateway.Ping:input_type -> uber.submitqueue.stovepipe.PingRequest - 1, // 1: uber.submitqueue.stovepipe.StovepipeGateway.Ping:output_type -> uber.submitqueue.stovepipe.PingResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 4, // 0: uber.submitqueue.stovepipe.IngestRequest.change:type_name -> uber.base.change.Change + 0, // 1: uber.submitqueue.stovepipe.StovepipeGateway.Ping:input_type -> uber.submitqueue.stovepipe.PingRequest + 2, // 2: uber.submitqueue.stovepipe.StovepipeGateway.Ingest:input_type -> uber.submitqueue.stovepipe.IngestRequest + 1, // 3: uber.submitqueue.stovepipe.StovepipeGateway.Ping:output_type -> uber.submitqueue.stovepipe.PingResponse + 3, // 4: uber.submitqueue.stovepipe.StovepipeGateway.Ingest:output_type -> uber.submitqueue.stovepipe.IngestResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_gateway_proto_init() } @@ -209,7 +324,7 @@ func file_gateway_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_gateway_proto_rawDesc), len(file_gateway_proto_rawDesc)), NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/api/stovepipe/gateway/protopb/gateway.pb.yarpc.go b/api/stovepipe/gateway/protopb/gateway.pb.yarpc.go index 8ca3da5c..89f0c61d 100644 --- a/api/stovepipe/gateway/protopb/gateway.pb.yarpc.go +++ b/api/stovepipe/gateway/protopb/gateway.pb.yarpc.go @@ -22,6 +22,7 @@ var _ = ioutil.NopCloser // StovepipeGatewayYARPCClient is the YARPC client-side interface for the StovepipeGateway service. type StovepipeGatewayYARPCClient interface { Ping(context.Context, *PingRequest, ...yarpc.CallOption) (*PingResponse, error) + Ingest(context.Context, *IngestRequest, ...yarpc.CallOption) (*IngestResponse, error) } func newStovepipeGatewayYARPCClient(clientConfig transport.ClientConfig, anyResolver v2.AnyResolver, options ...v2.ClientOption) StovepipeGatewayYARPCClient { @@ -43,6 +44,7 @@ func NewStovepipeGatewayYARPCClient(clientConfig transport.ClientConfig, options // StovepipeGatewayYARPCServer is the YARPC server-side interface for the StovepipeGateway service. type StovepipeGatewayYARPCServer interface { Ping(context.Context, *PingRequest) (*PingResponse, error) + Ingest(context.Context, *IngestRequest) (*IngestResponse, error) } type buildStovepipeGatewayYARPCProceduresParams struct { @@ -66,6 +68,16 @@ func buildStovepipeGatewayYARPCProcedures(params buildStovepipeGatewayYARPCProce }, ), }, + { + MethodName: "Ingest", + Handler: v2.NewUnaryHandler( + v2.UnaryHandlerParams{ + Handle: handler.Ingest, + NewRequest: newStovepipeGatewayServiceIngestYARPCRequest, + AnyResolver: params.AnyResolver, + }, + ), + }, }, OnewayHandlerParams: []v2.BuildProceduresOnewayHandlerParams{}, StreamHandlerParams: []v2.BuildProceduresStreamHandlerParams{}, @@ -190,6 +202,18 @@ func (c *_StovepipeGatewayYARPCCaller) Ping(ctx context.Context, request *PingRe return response, err } +func (c *_StovepipeGatewayYARPCCaller) Ingest(ctx context.Context, request *IngestRequest, options ...yarpc.CallOption) (*IngestResponse, error) { + responseMessage, err := c.streamClient.Call(ctx, "Ingest", request, newStovepipeGatewayServiceIngestYARPCResponse, options...) + if responseMessage == nil { + return nil, err + } + response, ok := responseMessage.(*IngestResponse) + if !ok { + return nil, v2.CastError(emptyStovepipeGatewayServiceIngestYARPCResponse, responseMessage) + } + return response, err +} + type _StovepipeGatewayYARPCHandler struct { server StovepipeGatewayYARPCServer } @@ -210,6 +234,22 @@ func (h *_StovepipeGatewayYARPCHandler) Ping(ctx context.Context, requestMessage return response, err } +func (h *_StovepipeGatewayYARPCHandler) Ingest(ctx context.Context, requestMessage proto.Message) (proto.Message, error) { + var request *IngestRequest + var ok bool + if requestMessage != nil { + request, ok = requestMessage.(*IngestRequest) + if !ok { + return nil, v2.CastError(emptyStovepipeGatewayServiceIngestYARPCRequest, requestMessage) + } + } + response, err := h.server.Ingest(ctx, request) + if response == nil { + return nil, err + } + return response, err +} + func newStovepipeGatewayServicePingYARPCRequest() proto.Message { return &PingRequest{} } @@ -218,31 +258,60 @@ func newStovepipeGatewayServicePingYARPCResponse() proto.Message { return &PingResponse{} } +func newStovepipeGatewayServiceIngestYARPCRequest() proto.Message { + return &IngestRequest{} +} + +func newStovepipeGatewayServiceIngestYARPCResponse() proto.Message { + return &IngestResponse{} +} + var ( - emptyStovepipeGatewayServicePingYARPCRequest = &PingRequest{} - emptyStovepipeGatewayServicePingYARPCResponse = &PingResponse{} + emptyStovepipeGatewayServicePingYARPCRequest = &PingRequest{} + emptyStovepipeGatewayServicePingYARPCResponse = &PingResponse{} + emptyStovepipeGatewayServiceIngestYARPCRequest = &IngestRequest{} + emptyStovepipeGatewayServiceIngestYARPCResponse = &IngestResponse{} ) var yarpcFileDescriptorClosuref1a937782ebbded5 = [][]byte{ // gateway.proto []byte{ - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0x31, 0x4f, 0xc3, 0x30, - 0x10, 0x85, 0x09, 0xad, 0x80, 0x5e, 0x83, 0x84, 0x3c, 0x45, 0x11, 0x42, 0x25, 0x4b, 0x33, 0xd9, - 0x12, 0x4c, 0xac, 0x5d, 0xd8, 0x50, 0x14, 0x36, 0x18, 0x90, 0x13, 0x9d, 0x52, 0x0b, 0x39, 0x76, - 0x73, 0x76, 0x11, 0x3f, 0x80, 0xff, 0x8d, 0xe2, 0xa4, 0xa5, 0x4b, 0xe9, 0xe6, 0x3b, 0xbf, 0x4f, - 0x7a, 0xef, 0x1e, 0x5c, 0x37,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x00, 0x00, 0xff, 0xff, 0x7e, 0x8b, - 0x21, 0x26, 0xc2, 0x01, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x4e, 0xe3, 0x30, + 0x10, 0x86, 0x37, 0xdb, 0x6e, 0x77, 0x3b, 0x6d, 0x57, 0xc8, 0xe2, 0x10, 0x45, 0x08, 0x95, 0x08, + 0xa9, 0x85, 0x83, 0x83, 0xca, 0x89, 0x6b, 0x39, 0x20, 0x2e, 0xa8, 0x0a, 0x07, 0x24, 0x38, 0x20, + 0x27, 0x8c, 0x52, 0x0b, 0x39, 0x76, 0x6b, 0xa7, 0x88, 0x07, 0xe0, 0x05, 0x79, 0x22, 0x14, 0xdb, + 0x29, 0xe5, 0xd0, 0xc2, 0x29, 0x1e, 0xe7, 0xff, 0xec, 0x99, 0xdf, 0x3f, 0x0c, 0x0a, 0x66, 0xf0, + 0x85, 0xbd, 0x52, 0xb5, 0x94, 0x46, 0x92, 0xa8, 0xca, 0x70, 0x49, 0x75, 0x95, 0x09, 0x6e, 0x16, + 0x15, 0x56, 0x48, 0xb5, 0x91, 0x2b, 0x54, 0x5c, 0x61, 0x14, 0x33, 0xc5, 0x93, 0x8c, 0x69, 0x4c, + 0xf2, 0x39, 0x2b, 0x0b, 0x4c, 0x2c, 0xe2, 0x0b, 0xc7, 0xc7, 0x23, 0xe8, 0xcd, 0x78, 0x59, 0xa4, + 0xb8, 0xa8, 0x50, 0x1b, 0x12, 0xc2, 0x5f, 0x81, 0x5a, 0xb3, 0x02, 0xc3, 0x60, 0x18, 0x8c, 0xbb, + 0x69, 0x53, 0xc6, 0x6f, 0x01, 0xf4, 0x9d, 0x52, 0x2b, 0x59, 0x6a, 0xdc, 0x2e, 0x25, 0x47, 0xd0, + 0xd7, 0xb8, 0x5c, 0xf1, 0x1c, 0x1f, 0x4b, 0x26, 0x30, 0xfc, 0x6d, 0x7f, 0xf7, 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 0xd1, 0x69, 0x3d, 0x05, 0xc9, 0x02, 0x00, 0x00, + }, + // api/base/change/proto/change.proto + []byte{ + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0x2c, 0xc8, 0xd4, + 0x4f, 0x4a, 0x2c, 0x4e, 0xd5, 0x4f, 0xce, 0x48, 0xcc, 0x4b, 0x4f, 0xd5, 0x2f, 0x28, 0xca, 0x2f, + 0xc9, 0x87, 0x72, 0xf4, 0xc0, 0x1c, 0x21, 0x81, 0xd2, 0xa4, 0xd4, 0x22, 0x3d, 0x90, 0x22, 0x3d, + 0x88, 0xb8, 0x92, 0x0c, 0x17, 0x9b, 0x33, 0x98, 0x25, 0x24, 0xc4, 0xc5, 0x52, 0x5a, 0x94, 0x59, + 0x2c, 0xc1, 0xa8, 0xc0, 0xac, 0xc1, 0x19, 0x04, 0x66, 0x3b, 0xa5, 0x71, 0x29, 0x24, 0xe7, 0xe7, + 0xea, 0x81, 0x75, 0x15, 0x97, 0x26, 0xe5, 0x66, 0x96, 0x14, 0x96, 0xa6, 0x96, 0xa6, 0x22, 0x9b, + 0xe0, 0xc4, 0x0d, 0xd1, 0x1f, 0x00, 0xb2, 0x20, 0x80, 0x31, 0xca, 0x38, 0x3d, 0xb3, 0x24, 0xa3, + 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xa4, 0x4f, 0x1f, 0x49, 0x9f, 0x3e, 0x56, 0x27, 0x16, + 0x24, 0x25, 0xb1, 0x81, 0x19, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x91, 0x62, 0xef, + 0xc4, 0x00, 0x00, 0x00, }, } diff --git a/api/stovepipe/gateway/protopb/gateway_grpc.pb.go b/api/stovepipe/gateway/protopb/gateway_grpc.pb.go index 6600736c..b1056451 100644 --- a/api/stovepipe/gateway/protopb/gateway_grpc.pb.go +++ b/api/stovepipe/gateway/protopb/gateway_grpc.pb.go @@ -34,7 +34,8 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - StovepipeGateway_Ping_FullMethodName = "/uber.submitqueue.stovepipe.StovepipeGateway/Ping" + StovepipeGateway_Ping_FullMethodName = "/uber.submitqueue.stovepipe.StovepipeGateway/Ping" + StovepipeGateway_Ingest_FullMethodName = "/uber.submitqueue.stovepipe.StovepipeGateway/Ingest" ) // StovepipeGatewayClient is the client API for StovepipeGateway service. @@ -45,6 +46,9 @@ const ( type StovepipeGatewayClient interface { // Ping returns a response indicating the service is alive Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) + // Ingest accepts a trunk commit and triggers its verification (post-merge/post-submit build and test). + // The processing is asynchronous and returns an IngestResponse immediately; the verification runs in the background. + Ingest(ctx context.Context, in *IngestRequest, opts ...grpc.CallOption) (*IngestResponse, error) } type stovepipeGatewayClient struct { @@ -65,6 +69,16 @@ func (c *stovepipeGatewayClient) Ping(ctx context.Context, in *PingRequest, opts return out, nil } +func (c *stovepipeGatewayClient) Ingest(ctx context.Context, in *IngestRequest, opts ...grpc.CallOption) (*IngestResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(IngestResponse) + err := c.cc.Invoke(ctx, StovepipeGateway_Ingest_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // StovepipeGatewayServer is the server API for StovepipeGateway service. // All implementations must embed UnimplementedStovepipeGatewayServer // for forward compatibility. @@ -73,6 +87,9 @@ func (c *stovepipeGatewayClient) Ping(ctx context.Context, in *PingRequest, opts type StovepipeGatewayServer interface { // Ping returns a response indicating the service is alive Ping(context.Context, *PingRequest) (*PingResponse, error) + // Ingest accepts a trunk commit and triggers its verification (post-merge/post-submit build and test). + // The processing is asynchronous and returns an IngestResponse immediately; the verification runs in the background. + Ingest(context.Context, *IngestRequest) (*IngestResponse, error) mustEmbedUnimplementedStovepipeGatewayServer() } @@ -86,6 +103,9 @@ type UnimplementedStovepipeGatewayServer struct{} func (UnimplementedStovepipeGatewayServer) Ping(context.Context, *PingRequest) (*PingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") } +func (UnimplementedStovepipeGatewayServer) Ingest(context.Context, *IngestRequest) (*IngestResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ingest not implemented") +} func (UnimplementedStovepipeGatewayServer) mustEmbedUnimplementedStovepipeGatewayServer() {} func (UnimplementedStovepipeGatewayServer) testEmbeddedByValue() {} @@ -125,6 +145,24 @@ func _StovepipeGateway_Ping_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _StovepipeGateway_Ingest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IngestRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StovepipeGatewayServer).Ingest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StovepipeGateway_Ingest_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StovepipeGatewayServer).Ingest(ctx, req.(*IngestRequest)) + } + return interceptor(ctx, in, info, handler) +} + // StovepipeGateway_ServiceDesc is the grpc.ServiceDesc for StovepipeGateway service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -136,6 +174,10 @@ var StovepipeGateway_ServiceDesc = grpc.ServiceDesc{ MethodName: "Ping", Handler: _StovepipeGateway_Ping_Handler, }, + { + MethodName: "Ingest", + Handler: _StovepipeGateway_Ingest_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "gateway.proto", diff --git a/tool/proto/BUILD.bazel b/tool/proto/BUILD.bazel index b230014e..f7e9f0ba 100644 --- a/tool/proto/BUILD.bazel +++ b/tool/proto/BUILD.bazel @@ -42,6 +42,7 @@ go_proto_generated_files( go_proto_generated_files( name = "api_stovepipe_gateway", srcs = ["//api/stovepipe/gateway/proto:gateway.proto"], + imports = ["//api/base/change/proto:change.proto"], out_dir = "api_stovepipe_gateway", )