diff --git a/api/submitqueue/gateway/proto/gateway.proto b/api/submitqueue/gateway/proto/gateway.proto index e9a8dec4a..3d46b38e3 100644 --- a/api/submitqueue/gateway/proto/gateway.proto +++ b/api/submitqueue/gateway/proto/gateway.proto @@ -157,6 +157,22 @@ message ListResponse { string next_page_token = 2; } +// Queue identifies a configured submit queue. +message Queue { + // Unique queue name accepted by the gateway. + string name = 1; +} + +// ListQueuesRequest selects all configured submit queues. +message ListQueuesRequest { +} + +// ListQueuesResponse contains all configured queues, including queues with no requests. +message ListQueuesResponse { + // Queues ordered by name ascending. + repeated Queue queues = 1; +} + // GetRequestHistoryByIDRequest selects one retained request history by sqid. message GetRequestHistoryByIDRequest { // Globally unique identifier for the request. @@ -250,6 +266,9 @@ service SubmitQueueGateway { // Ping returns a response indicating the service is alive rpc Ping(PingRequest) returns (PingResponse) {} + // ListQueues returns all configured submit queues ordered by name ascending. + rpc ListQueues(ListQueuesRequest) returns (ListQueuesResponse) {} + // Land lands a set of code changes into a target branch, performing the necessary validations across all other changes in the queue. // The processing is asynchronous and returns a LandResponse immediately. The land request is processed in the background. rpc Land(LandRequest) returns (LandResponse) {} diff --git a/api/submitqueue/gateway/protopb/gateway.pb.go b/api/submitqueue/gateway/protopb/gateway.pb.go index 135455a89..0a83dec4b 100644 --- a/api/submitqueue/gateway/protopb/gateway.pb.go +++ b/api/submitqueue/gateway/protopb/gateway.pb.go @@ -14,7 +14,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.10 +// protoc-gen-go v1.36.11 // protoc v5.29.3 // source: gateway.proto @@ -820,6 +820,135 @@ func (x *ListResponse) GetNextPageToken() string { return "" } +// Queue identifies a configured submit queue. +type Queue struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Unique queue name accepted by the gateway. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Queue) Reset() { + *x = Queue{} + mi := &file_gateway_proto_msgTypes[13] + 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[13] + 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{13} +} + +func (x *Queue) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// ListQueuesRequest selects all configured submit queues. +type ListQueuesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListQueuesRequest) Reset() { + *x = ListQueuesRequest{} + mi := &file_gateway_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListQueuesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListQueuesRequest) ProtoMessage() {} + +func (x *ListQueuesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_proto_msgTypes[14] + 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 ListQueuesRequest.ProtoReflect.Descriptor instead. +func (*ListQueuesRequest) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{14} +} + +// ListQueuesResponse contains all configured queues, including queues with no requests. +type ListQueuesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Queues ordered by name ascending. + Queues []*Queue `protobuf:"bytes,1,rep,name=queues,proto3" json:"queues,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListQueuesResponse) Reset() { + *x = ListQueuesResponse{} + mi := &file_gateway_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListQueuesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListQueuesResponse) ProtoMessage() {} + +func (x *ListQueuesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_proto_msgTypes[15] + 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 ListQueuesResponse.ProtoReflect.Descriptor instead. +func (*ListQueuesResponse) Descriptor() ([]byte, []int) { + return file_gateway_proto_rawDescGZIP(), []int{15} +} + +func (x *ListQueuesResponse) GetQueues() []*Queue { + if x != nil { + return x.Queues + } + return nil +} + // GetRequestHistoryByIDRequest selects one retained request history by sqid. type GetRequestHistoryByIDRequest struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -834,7 +963,7 @@ type GetRequestHistoryByIDRequest struct { func (x *GetRequestHistoryByIDRequest) Reset() { *x = GetRequestHistoryByIDRequest{} - mi := &file_gateway_proto_msgTypes[13] + mi := &file_gateway_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -846,7 +975,7 @@ func (x *GetRequestHistoryByIDRequest) String() string { func (*GetRequestHistoryByIDRequest) ProtoMessage() {} func (x *GetRequestHistoryByIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_proto_msgTypes[13] + mi := &file_gateway_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -859,7 +988,7 @@ func (x *GetRequestHistoryByIDRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRequestHistoryByIDRequest.ProtoReflect.Descriptor instead. func (*GetRequestHistoryByIDRequest) Descriptor() ([]byte, []int) { - return file_gateway_proto_rawDescGZIP(), []int{13} + return file_gateway_proto_rawDescGZIP(), []int{16} } func (x *GetRequestHistoryByIDRequest) GetSqid() string { @@ -899,7 +1028,7 @@ type HistoryEvent struct { func (x *HistoryEvent) Reset() { *x = HistoryEvent{} - mi := &file_gateway_proto_msgTypes[14] + mi := &file_gateway_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -911,7 +1040,7 @@ func (x *HistoryEvent) String() string { func (*HistoryEvent) ProtoMessage() {} func (x *HistoryEvent) ProtoReflect() protoreflect.Message { - mi := &file_gateway_proto_msgTypes[14] + mi := &file_gateway_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -924,7 +1053,7 @@ func (x *HistoryEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use HistoryEvent.ProtoReflect.Descriptor instead. func (*HistoryEvent) Descriptor() ([]byte, []int) { - return file_gateway_proto_rawDescGZIP(), []int{14} + return file_gateway_proto_rawDescGZIP(), []int{17} } func (x *HistoryEvent) GetTimestampMs() int64 { @@ -980,7 +1109,7 @@ type GetRequestHistoryByIDResponse struct { func (x *GetRequestHistoryByIDResponse) Reset() { *x = GetRequestHistoryByIDResponse{} - mi := &file_gateway_proto_msgTypes[15] + mi := &file_gateway_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -992,7 +1121,7 @@ func (x *GetRequestHistoryByIDResponse) String() string { func (*GetRequestHistoryByIDResponse) ProtoMessage() {} func (x *GetRequestHistoryByIDResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_proto_msgTypes[15] + mi := &file_gateway_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1005,7 +1134,7 @@ func (x *GetRequestHistoryByIDResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRequestHistoryByIDResponse.ProtoReflect.Descriptor instead. func (*GetRequestHistoryByIDResponse) Descriptor() ([]byte, []int) { - return file_gateway_proto_rawDescGZIP(), []int{15} + return file_gateway_proto_rawDescGZIP(), []int{18} } func (x *GetRequestHistoryByIDResponse) GetEvents() []*HistoryEvent { @@ -1029,7 +1158,7 @@ type GetRequestHistoryByChangeURIRequest struct { func (x *GetRequestHistoryByChangeURIRequest) Reset() { *x = GetRequestHistoryByChangeURIRequest{} - mi := &file_gateway_proto_msgTypes[16] + mi := &file_gateway_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1041,7 +1170,7 @@ func (x *GetRequestHistoryByChangeURIRequest) String() string { func (*GetRequestHistoryByChangeURIRequest) ProtoMessage() {} func (x *GetRequestHistoryByChangeURIRequest) ProtoReflect() protoreflect.Message { - mi := &file_gateway_proto_msgTypes[16] + mi := &file_gateway_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1054,7 +1183,7 @@ func (x *GetRequestHistoryByChangeURIRequest) ProtoReflect() protoreflect.Messag // Deprecated: Use GetRequestHistoryByChangeURIRequest.ProtoReflect.Descriptor instead. func (*GetRequestHistoryByChangeURIRequest) Descriptor() ([]byte, []int) { - return file_gateway_proto_rawDescGZIP(), []int{16} + return file_gateway_proto_rawDescGZIP(), []int{19} } func (x *GetRequestHistoryByChangeURIRequest) GetChangeUri() string { @@ -1084,7 +1213,7 @@ type RequestHistory struct { func (x *RequestHistory) Reset() { *x = RequestHistory{} - mi := &file_gateway_proto_msgTypes[17] + mi := &file_gateway_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1096,7 +1225,7 @@ func (x *RequestHistory) String() string { func (*RequestHistory) ProtoMessage() {} func (x *RequestHistory) ProtoReflect() protoreflect.Message { - mi := &file_gateway_proto_msgTypes[17] + mi := &file_gateway_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1109,7 +1238,7 @@ func (x *RequestHistory) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestHistory.ProtoReflect.Descriptor instead. func (*RequestHistory) Descriptor() ([]byte, []int) { - return file_gateway_proto_rawDescGZIP(), []int{17} + return file_gateway_proto_rawDescGZIP(), []int{20} } func (x *RequestHistory) GetSqid() string { @@ -1137,7 +1266,7 @@ type GetRequestHistoryByChangeURIResponse struct { func (x *GetRequestHistoryByChangeURIResponse) Reset() { *x = GetRequestHistoryByChangeURIResponse{} - mi := &file_gateway_proto_msgTypes[18] + mi := &file_gateway_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1149,7 +1278,7 @@ func (x *GetRequestHistoryByChangeURIResponse) String() string { func (*GetRequestHistoryByChangeURIResponse) ProtoMessage() {} func (x *GetRequestHistoryByChangeURIResponse) ProtoReflect() protoreflect.Message { - mi := &file_gateway_proto_msgTypes[18] + mi := &file_gateway_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1162,7 +1291,7 @@ func (x *GetRequestHistoryByChangeURIResponse) ProtoReflect() protoreflect.Messa // Deprecated: Use GetRequestHistoryByChangeURIResponse.ProtoReflect.Descriptor instead. func (*GetRequestHistoryByChangeURIResponse) Descriptor() ([]byte, []int) { - return file_gateway_proto_rawDescGZIP(), []int{18} + return file_gateway_proto_rawDescGZIP(), []int{21} } func (x *GetRequestHistoryByChangeURIResponse) GetHistories() []*RequestHistory { @@ -1183,7 +1312,7 @@ type Error struct { func (x *Error) Reset() { *x = Error{} - mi := &file_gateway_proto_msgTypes[19] + mi := &file_gateway_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1195,7 +1324,7 @@ func (x *Error) String() string { func (*Error) ProtoMessage() {} func (x *Error) ProtoReflect() protoreflect.Message { - mi := &file_gateway_proto_msgTypes[19] + mi := &file_gateway_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1208,7 +1337,7 @@ func (x *Error) ProtoReflect() protoreflect.Message { // Deprecated: Use Error.ProtoReflect.Descriptor instead. func (*Error) Descriptor() ([]byte, []int) { - return file_gateway_proto_rawDescGZIP(), []int{19} + return file_gateway_proto_rawDescGZIP(), []int{22} } func (x *Error) GetMessage() string { @@ -1231,7 +1360,7 @@ type UnrecognizedQueueError struct { func (x *UnrecognizedQueueError) Reset() { *x = UnrecognizedQueueError{} - mi := &file_gateway_proto_msgTypes[20] + mi := &file_gateway_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1243,7 +1372,7 @@ func (x *UnrecognizedQueueError) String() string { func (*UnrecognizedQueueError) ProtoMessage() {} func (x *UnrecognizedQueueError) ProtoReflect() protoreflect.Message { - mi := &file_gateway_proto_msgTypes[20] + mi := &file_gateway_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1256,7 +1385,7 @@ func (x *UnrecognizedQueueError) ProtoReflect() protoreflect.Message { // Deprecated: Use UnrecognizedQueueError.ProtoReflect.Descriptor instead. func (*UnrecognizedQueueError) Descriptor() ([]byte, []int) { - return file_gateway_proto_rawDescGZIP(), []int{20} + return file_gateway_proto_rawDescGZIP(), []int{23} } func (x *UnrecognizedQueueError) GetError() *Error { @@ -1288,7 +1417,7 @@ type RequestNotFoundError struct { func (x *RequestNotFoundError) Reset() { *x = RequestNotFoundError{} - mi := &file_gateway_proto_msgTypes[21] + mi := &file_gateway_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1300,7 +1429,7 @@ func (x *RequestNotFoundError) String() string { func (*RequestNotFoundError) ProtoMessage() {} func (x *RequestNotFoundError) ProtoReflect() protoreflect.Message { - mi := &file_gateway_proto_msgTypes[21] + mi := &file_gateway_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1313,7 +1442,7 @@ func (x *RequestNotFoundError) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestNotFoundError.ProtoReflect.Descriptor instead. func (*RequestNotFoundError) Descriptor() ([]byte, []int) { - return file_gateway_proto_rawDescGZIP(), []int{21} + return file_gateway_proto_rawDescGZIP(), []int{24} } func (x *RequestNotFoundError) GetError() *Error { @@ -1393,7 +1522,12 @@ const file_gateway_proto_rawDesc = "" + "page_token\x18\x05 \x01(\tR\tpageToken\"|\n" + "\fListResponse\x12D\n" + "\brequests\x18\x01 \x03(\v2(.uber.submitqueue.gateway.RequestSummaryR\brequests\x12&\n" + - "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"H\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\x1b\n" + + "\x05Queue\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\"\x13\n" + + "\x11ListQueuesRequest\"M\n" + + "\x12ListQueuesResponse\x127\n" + + "\x06queues\x18\x01 \x03(\v2\x1f.uber.submitqueue.gateway.QueueR\x06queues\"H\n" + "\x1cGetRequestHistoryByIDRequest\x12\x12\n" + "\x04sqid\x18\x01 \x01(\tR\x04sqid\x12\x14\n" + "\x05queue\x18\x02 \x01(\tR\x05queue\"\xa1\x02\n" + @@ -1428,9 +1562,11 @@ const file_gateway_proto_rawDesc = "" + "\x05error\x18\x01 \x01(\v2\x1f.uber.submitqueue.gateway.ErrorR\x05error\x12\x12\n" + "\x04sqid\x18\x02 \x01(\tR\x04sqid\x12\x1d\n" + "\n" + - "change_uri\x18\x03 \x01(\tR\tchangeUri2\xdc\a\n" + + "change_uri\x18\x03 \x01(\tR\tchangeUri2\xc7\b\n" + "\x12SubmitQueueGateway\x12W\n" + - "\x04Ping\x12%.uber.submitqueue.gateway.PingRequest\x1a&.uber.submitqueue.gateway.PingResponse\"\x00\x12W\n" + + "\x04Ping\x12%.uber.submitqueue.gateway.PingRequest\x1a&.uber.submitqueue.gateway.PingResponse\"\x00\x12i\n" + + "\n" + + "ListQueues\x12+.uber.submitqueue.gateway.ListQueuesRequest\x1a,.uber.submitqueue.gateway.ListQueuesResponse\"\x00\x12W\n" + "\x04Land\x12%.uber.submitqueue.gateway.LandRequest\x1a&.uber.submitqueue.gateway.LandResponse\"\x00\x12]\n" + "\x06Cancel\x12'.uber.submitqueue.gateway.CancelRequest\x1a(.uber.submitqueue.gateway.CancelResponse\"\x00\x12\x8a\x01\n" + "\x15GetRequestSummaryByID\x126.uber.submitqueue.gateway.GetRequestSummaryByIDRequest\x1a7.uber.submitqueue.gateway.GetRequestSummaryByIDResponse\"\x00\x12\x9f\x01\n" + @@ -1452,7 +1588,7 @@ func file_gateway_proto_rawDescGZIP() []byte { return file_gateway_proto_rawDescData } -var file_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 27) var file_gateway_proto_goTypes = []any{ (*PingRequest)(nil), // 0: uber.submitqueue.gateway.PingRequest (*PingResponse)(nil), // 1: uber.submitqueue.gateway.PingResponse @@ -1467,54 +1603,60 @@ var file_gateway_proto_goTypes = []any{ (*GetRequestSummaryByChangeURIResponse)(nil), // 10: uber.submitqueue.gateway.GetRequestSummaryByChangeURIResponse (*ListRequest)(nil), // 11: uber.submitqueue.gateway.ListRequest (*ListResponse)(nil), // 12: uber.submitqueue.gateway.ListResponse - (*GetRequestHistoryByIDRequest)(nil), // 13: uber.submitqueue.gateway.GetRequestHistoryByIDRequest - (*HistoryEvent)(nil), // 14: uber.submitqueue.gateway.HistoryEvent - (*GetRequestHistoryByIDResponse)(nil), // 15: uber.submitqueue.gateway.GetRequestHistoryByIDResponse - (*GetRequestHistoryByChangeURIRequest)(nil), // 16: uber.submitqueue.gateway.GetRequestHistoryByChangeURIRequest - (*RequestHistory)(nil), // 17: uber.submitqueue.gateway.RequestHistory - (*GetRequestHistoryByChangeURIResponse)(nil), // 18: uber.submitqueue.gateway.GetRequestHistoryByChangeURIResponse - (*Error)(nil), // 19: uber.submitqueue.gateway.Error - (*UnrecognizedQueueError)(nil), // 20: uber.submitqueue.gateway.UnrecognizedQueueError - (*RequestNotFoundError)(nil), // 21: uber.submitqueue.gateway.RequestNotFoundError - nil, // 22: uber.submitqueue.gateway.RequestSummary.MetadataEntry - nil, // 23: uber.submitqueue.gateway.HistoryEvent.MetadataEntry - (*protopb.Change)(nil), // 24: uber.base.change.Change - (protopb1.Strategy)(0), // 25: uber.base.mergestrategy.Strategy + (*Queue)(nil), // 13: uber.submitqueue.gateway.Queue + (*ListQueuesRequest)(nil), // 14: uber.submitqueue.gateway.ListQueuesRequest + (*ListQueuesResponse)(nil), // 15: uber.submitqueue.gateway.ListQueuesResponse + (*GetRequestHistoryByIDRequest)(nil), // 16: uber.submitqueue.gateway.GetRequestHistoryByIDRequest + (*HistoryEvent)(nil), // 17: uber.submitqueue.gateway.HistoryEvent + (*GetRequestHistoryByIDResponse)(nil), // 18: uber.submitqueue.gateway.GetRequestHistoryByIDResponse + (*GetRequestHistoryByChangeURIRequest)(nil), // 19: uber.submitqueue.gateway.GetRequestHistoryByChangeURIRequest + (*RequestHistory)(nil), // 20: uber.submitqueue.gateway.RequestHistory + (*GetRequestHistoryByChangeURIResponse)(nil), // 21: uber.submitqueue.gateway.GetRequestHistoryByChangeURIResponse + (*Error)(nil), // 22: uber.submitqueue.gateway.Error + (*UnrecognizedQueueError)(nil), // 23: uber.submitqueue.gateway.UnrecognizedQueueError + (*RequestNotFoundError)(nil), // 24: uber.submitqueue.gateway.RequestNotFoundError + nil, // 25: uber.submitqueue.gateway.RequestSummary.MetadataEntry + nil, // 26: uber.submitqueue.gateway.HistoryEvent.MetadataEntry + (*protopb.Change)(nil), // 27: uber.base.change.Change + (protopb1.Strategy)(0), // 28: uber.base.mergestrategy.Strategy } var file_gateway_proto_depIdxs = []int32{ - 24, // 0: uber.submitqueue.gateway.LandRequest.change:type_name -> uber.base.change.Change - 25, // 1: uber.submitqueue.gateway.LandRequest.strategy:type_name -> uber.base.mergestrategy.Strategy - 22, // 2: uber.submitqueue.gateway.RequestSummary.metadata:type_name -> uber.submitqueue.gateway.RequestSummary.MetadataEntry + 27, // 0: uber.submitqueue.gateway.LandRequest.change:type_name -> uber.base.change.Change + 28, // 1: uber.submitqueue.gateway.LandRequest.strategy:type_name -> uber.base.mergestrategy.Strategy + 25, // 2: uber.submitqueue.gateway.RequestSummary.metadata:type_name -> uber.submitqueue.gateway.RequestSummary.MetadataEntry 6, // 3: uber.submitqueue.gateway.GetRequestSummaryByIDResponse.request:type_name -> uber.submitqueue.gateway.RequestSummary 6, // 4: uber.submitqueue.gateway.GetRequestSummaryByChangeURIResponse.requests:type_name -> uber.submitqueue.gateway.RequestSummary 6, // 5: uber.submitqueue.gateway.ListResponse.requests:type_name -> uber.submitqueue.gateway.RequestSummary - 23, // 6: uber.submitqueue.gateway.HistoryEvent.metadata:type_name -> uber.submitqueue.gateway.HistoryEvent.MetadataEntry - 14, // 7: uber.submitqueue.gateway.GetRequestHistoryByIDResponse.events:type_name -> uber.submitqueue.gateway.HistoryEvent - 14, // 8: uber.submitqueue.gateway.RequestHistory.events:type_name -> uber.submitqueue.gateway.HistoryEvent - 17, // 9: uber.submitqueue.gateway.GetRequestHistoryByChangeURIResponse.histories:type_name -> uber.submitqueue.gateway.RequestHistory - 19, // 10: uber.submitqueue.gateway.UnrecognizedQueueError.error:type_name -> uber.submitqueue.gateway.Error - 19, // 11: uber.submitqueue.gateway.RequestNotFoundError.error:type_name -> uber.submitqueue.gateway.Error - 0, // 12: uber.submitqueue.gateway.SubmitQueueGateway.Ping:input_type -> uber.submitqueue.gateway.PingRequest - 2, // 13: uber.submitqueue.gateway.SubmitQueueGateway.Land:input_type -> uber.submitqueue.gateway.LandRequest - 4, // 14: uber.submitqueue.gateway.SubmitQueueGateway.Cancel:input_type -> uber.submitqueue.gateway.CancelRequest - 7, // 15: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestSummaryByID:input_type -> uber.submitqueue.gateway.GetRequestSummaryByIDRequest - 9, // 16: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestSummaryByChangeURI:input_type -> uber.submitqueue.gateway.GetRequestSummaryByChangeURIRequest - 11, // 17: uber.submitqueue.gateway.SubmitQueueGateway.List:input_type -> uber.submitqueue.gateway.ListRequest - 13, // 18: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestHistoryByID:input_type -> uber.submitqueue.gateway.GetRequestHistoryByIDRequest - 16, // 19: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestHistoryByChangeURI:input_type -> uber.submitqueue.gateway.GetRequestHistoryByChangeURIRequest - 1, // 20: uber.submitqueue.gateway.SubmitQueueGateway.Ping:output_type -> uber.submitqueue.gateway.PingResponse - 3, // 21: uber.submitqueue.gateway.SubmitQueueGateway.Land:output_type -> uber.submitqueue.gateway.LandResponse - 5, // 22: uber.submitqueue.gateway.SubmitQueueGateway.Cancel:output_type -> uber.submitqueue.gateway.CancelResponse - 8, // 23: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestSummaryByID:output_type -> uber.submitqueue.gateway.GetRequestSummaryByIDResponse - 10, // 24: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestSummaryByChangeURI:output_type -> uber.submitqueue.gateway.GetRequestSummaryByChangeURIResponse - 12, // 25: uber.submitqueue.gateway.SubmitQueueGateway.List:output_type -> uber.submitqueue.gateway.ListResponse - 15, // 26: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestHistoryByID:output_type -> uber.submitqueue.gateway.GetRequestHistoryByIDResponse - 18, // 27: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestHistoryByChangeURI:output_type -> uber.submitqueue.gateway.GetRequestHistoryByChangeURIResponse - 20, // [20:28] is the sub-list for method output_type - 12, // [12:20] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 13, // 6: uber.submitqueue.gateway.ListQueuesResponse.queues:type_name -> uber.submitqueue.gateway.Queue + 26, // 7: uber.submitqueue.gateway.HistoryEvent.metadata:type_name -> uber.submitqueue.gateway.HistoryEvent.MetadataEntry + 17, // 8: uber.submitqueue.gateway.GetRequestHistoryByIDResponse.events:type_name -> uber.submitqueue.gateway.HistoryEvent + 17, // 9: uber.submitqueue.gateway.RequestHistory.events:type_name -> uber.submitqueue.gateway.HistoryEvent + 20, // 10: uber.submitqueue.gateway.GetRequestHistoryByChangeURIResponse.histories:type_name -> uber.submitqueue.gateway.RequestHistory + 22, // 11: uber.submitqueue.gateway.UnrecognizedQueueError.error:type_name -> uber.submitqueue.gateway.Error + 22, // 12: uber.submitqueue.gateway.RequestNotFoundError.error:type_name -> uber.submitqueue.gateway.Error + 0, // 13: uber.submitqueue.gateway.SubmitQueueGateway.Ping:input_type -> uber.submitqueue.gateway.PingRequest + 14, // 14: uber.submitqueue.gateway.SubmitQueueGateway.ListQueues:input_type -> uber.submitqueue.gateway.ListQueuesRequest + 2, // 15: uber.submitqueue.gateway.SubmitQueueGateway.Land:input_type -> uber.submitqueue.gateway.LandRequest + 4, // 16: uber.submitqueue.gateway.SubmitQueueGateway.Cancel:input_type -> uber.submitqueue.gateway.CancelRequest + 7, // 17: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestSummaryByID:input_type -> uber.submitqueue.gateway.GetRequestSummaryByIDRequest + 9, // 18: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestSummaryByChangeURI:input_type -> uber.submitqueue.gateway.GetRequestSummaryByChangeURIRequest + 11, // 19: uber.submitqueue.gateway.SubmitQueueGateway.List:input_type -> uber.submitqueue.gateway.ListRequest + 16, // 20: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestHistoryByID:input_type -> uber.submitqueue.gateway.GetRequestHistoryByIDRequest + 19, // 21: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestHistoryByChangeURI:input_type -> uber.submitqueue.gateway.GetRequestHistoryByChangeURIRequest + 1, // 22: uber.submitqueue.gateway.SubmitQueueGateway.Ping:output_type -> uber.submitqueue.gateway.PingResponse + 15, // 23: uber.submitqueue.gateway.SubmitQueueGateway.ListQueues:output_type -> uber.submitqueue.gateway.ListQueuesResponse + 3, // 24: uber.submitqueue.gateway.SubmitQueueGateway.Land:output_type -> uber.submitqueue.gateway.LandResponse + 5, // 25: uber.submitqueue.gateway.SubmitQueueGateway.Cancel:output_type -> uber.submitqueue.gateway.CancelResponse + 8, // 26: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestSummaryByID:output_type -> uber.submitqueue.gateway.GetRequestSummaryByIDResponse + 10, // 27: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestSummaryByChangeURI:output_type -> uber.submitqueue.gateway.GetRequestSummaryByChangeURIResponse + 12, // 28: uber.submitqueue.gateway.SubmitQueueGateway.List:output_type -> uber.submitqueue.gateway.ListResponse + 18, // 29: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestHistoryByID:output_type -> uber.submitqueue.gateway.GetRequestHistoryByIDResponse + 21, // 30: uber.submitqueue.gateway.SubmitQueueGateway.GetRequestHistoryByChangeURI:output_type -> uber.submitqueue.gateway.GetRequestHistoryByChangeURIResponse + 22, // [22:31] is the sub-list for method output_type + 13, // [13:22] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_gateway_proto_init() } @@ -1528,7 +1670,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: 24, + NumMessages: 27, NumExtensions: 0, NumServices: 1, }, diff --git a/api/submitqueue/gateway/protopb/gateway.pb.yarpc.go b/api/submitqueue/gateway/protopb/gateway.pb.yarpc.go index 889e83b75..8654d566a 100644 --- a/api/submitqueue/gateway/protopb/gateway.pb.yarpc.go +++ b/api/submitqueue/gateway/protopb/gateway.pb.yarpc.go @@ -22,6 +22,7 @@ var _ = ioutil.NopCloser // SubmitQueueGatewayYARPCClient is the YARPC client-side interface for the SubmitQueueGateway service. type SubmitQueueGatewayYARPCClient interface { Ping(context.Context, *PingRequest, ...yarpc.CallOption) (*PingResponse, error) + ListQueues(context.Context, *ListQueuesRequest, ...yarpc.CallOption) (*ListQueuesResponse, error) Land(context.Context, *LandRequest, ...yarpc.CallOption) (*LandResponse, error) Cancel(context.Context, *CancelRequest, ...yarpc.CallOption) (*CancelResponse, error) GetRequestSummaryByID(context.Context, *GetRequestSummaryByIDRequest, ...yarpc.CallOption) (*GetRequestSummaryByIDResponse, error) @@ -50,6 +51,7 @@ func NewSubmitQueueGatewayYARPCClient(clientConfig transport.ClientConfig, optio // SubmitQueueGatewayYARPCServer is the YARPC server-side interface for the SubmitQueueGateway service. type SubmitQueueGatewayYARPCServer interface { Ping(context.Context, *PingRequest) (*PingResponse, error) + ListQueues(context.Context, *ListQueuesRequest) (*ListQueuesResponse, error) Land(context.Context, *LandRequest) (*LandResponse, error) Cancel(context.Context, *CancelRequest) (*CancelResponse, error) GetRequestSummaryByID(context.Context, *GetRequestSummaryByIDRequest) (*GetRequestSummaryByIDResponse, error) @@ -80,6 +82,16 @@ func buildSubmitQueueGatewayYARPCProcedures(params buildSubmitQueueGatewayYARPCP }, ), }, + { + MethodName: "ListQueues", + Handler: v2.NewUnaryHandler( + v2.UnaryHandlerParams{ + Handle: handler.ListQueues, + NewRequest: newSubmitQueueGatewayServiceListQueuesYARPCRequest, + AnyResolver: params.AnyResolver, + }, + ), + }, { MethodName: "Land", Handler: v2.NewUnaryHandler( @@ -274,6 +286,18 @@ func (c *_SubmitQueueGatewayYARPCCaller) Ping(ctx context.Context, request *Ping return response, err } +func (c *_SubmitQueueGatewayYARPCCaller) ListQueues(ctx context.Context, request *ListQueuesRequest, options ...yarpc.CallOption) (*ListQueuesResponse, error) { + responseMessage, err := c.streamClient.Call(ctx, "ListQueues", request, newSubmitQueueGatewayServiceListQueuesYARPCResponse, options...) + if responseMessage == nil { + return nil, err + } + response, ok := responseMessage.(*ListQueuesResponse) + if !ok { + return nil, v2.CastError(emptySubmitQueueGatewayServiceListQueuesYARPCResponse, responseMessage) + } + return response, err +} + func (c *_SubmitQueueGatewayYARPCCaller) Land(ctx context.Context, request *LandRequest, options ...yarpc.CallOption) (*LandResponse, error) { responseMessage, err := c.streamClient.Call(ctx, "Land", request, newSubmitQueueGatewayServiceLandYARPCResponse, options...) if responseMessage == nil { @@ -378,6 +402,22 @@ func (h *_SubmitQueueGatewayYARPCHandler) Ping(ctx context.Context, requestMessa return response, err } +func (h *_SubmitQueueGatewayYARPCHandler) ListQueues(ctx context.Context, requestMessage proto.Message) (proto.Message, error) { + var request *ListQueuesRequest + var ok bool + if requestMessage != nil { + request, ok = requestMessage.(*ListQueuesRequest) + if !ok { + return nil, v2.CastError(emptySubmitQueueGatewayServiceListQueuesYARPCRequest, requestMessage) + } + } + response, err := h.server.ListQueues(ctx, request) + if response == nil { + return nil, err + } + return response, err +} + func (h *_SubmitQueueGatewayYARPCHandler) Land(ctx context.Context, requestMessage proto.Message) (proto.Message, error) { var request *LandRequest var ok bool @@ -498,6 +538,14 @@ func newSubmitQueueGatewayServicePingYARPCResponse() proto.Message { return &PingResponse{} } +func newSubmitQueueGatewayServiceListQueuesYARPCRequest() proto.Message { + return &ListQueuesRequest{} +} + +func newSubmitQueueGatewayServiceListQueuesYARPCResponse() proto.Message { + return &ListQueuesResponse{} +} + func newSubmitQueueGatewayServiceLandYARPCRequest() proto.Message { return &LandRequest{} } @@ -557,6 +605,8 @@ func newSubmitQueueGatewayServiceGetRequestHistoryByChangeURIYARPCResponse() pro var ( emptySubmitQueueGatewayServicePingYARPCRequest = &PingRequest{} emptySubmitQueueGatewayServicePingYARPCResponse = &PingResponse{} + emptySubmitQueueGatewayServiceListQueuesYARPCRequest = &ListQueuesRequest{} + emptySubmitQueueGatewayServiceListQueuesYARPCResponse = &ListQueuesResponse{} emptySubmitQueueGatewayServiceLandYARPCRequest = &LandRequest{} emptySubmitQueueGatewayServiceLandYARPCResponse = &LandResponse{} emptySubmitQueueGatewayServiceCancelYARPCRequest = &CancelRequest{} @@ -576,76 +626,80 @@ var ( var yarpcFileDescriptorClosuref1a937782ebbded5 = [][]byte{ // gateway.proto []byte{ - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4b, 0x6f, 0xdb, 0x46, - 0x10, 0x0e, 0x45, 0x5b, 0xb6, 0x46, 0xb2, 0x6b, 0x6c, 0xd3, 0x94, 0x50, 0x6d, 0xc4, 0x66, 0x53, - 0x47, 0x87, 0x42, 0x0a, 0xdc, 0xf4, 0x81, 0x06, 0x09, 0x10, 0x27, 0xce, 0x03, 0xa8, 0x53, 0x85, - 0xae, 0x51, 0x20, 0x40, 0x21, 0xac, 0xa4, 0x89, 0x4c, 0xd8, 0x24, 0xe5, 0xdd, 0xa5, 0x5b, 0x19, - 0x3d, 0xf4, 0xd2, 0x4b, 0xcf, 0xbd, 0x17, 0xfd, 0x2d, 0x3d, 0xf5, 0x3f, 0xf4, 0xc7, 0x14, 0xfb, - 0x20, 0x45, 0xda, 0x22, 0xa3, 0x38, 0x39, 0x89, 0xbb, 0x3b, 0xcf, 0xef, 0x9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xdb, 0x40, 0x62, 0x54, 0x0f, + 0xdf, 0x86, 0x0c, 0x25, 0x40, 0x73, 0xd0, 0x4a, 0x74, 0xb2, 0xad, 0x0e, 0x76, 0x39, 0xb9, 0x0e, + 0xb5, 0x11, 0x1d, 0x62, 0x97, 0x7b, 0x67, 0x9a, 0x8b, 0xca, 0x6e, 0x55, 0x6e, 0xec, 0x7b, 0x67, + 0x28, 0x33, 0xa9, 0x0e, 0x45, 0x78, 0x84, 0x81, 0xe9, 0x75, 0x25, 0xfe, 0x83, 0xdc, 0x70, 0x7e, + 0x81, 0x86, 0x0e, 0xe2, 0x63, 0xe6, 0x86, 0x6c, 0xc2, 0xff, 0x02, 0xfc, 0x59, 0x74, 0x13, 0x96, + 0x75, 0xa5, 0x96, 0xe4, 0xf6, 0x5e, 0x6c, 0xfd, 0x3a, 0x94, 0x5f, 0xa9, 0x34, 0x11, 0x28, 0x29, + 0x26, 0x35, 0x5d, 0xaa, 0x58, 0xf4, 0x0a, 0xfc, 0x5f, 0xba, 0xa6, 0x04, 0xb8, 0x31, 0xe5, 0xec, + 0x02, 0x49, 0x6e, 0x1a, 0xaf, 0xef, 0x41, 0x45, 0x79, 0x16, 0xf9, 0x7c, 0x23, 0xdb, 0x67, 0x85, + 0x74, 0x8d, 0x78, 0xfa, 0xf6, 0x3c, 0xf7, 0xb8, 0x08, 0x2f, 0x7b, 0x7b, 0xfe, 0x2a, 0x40, 0xc3, + 0x28, 0xd8, 0x39, 0xc5, 0x40, 0xc8, 0x17, 0x26, 0x7e, 0x2d, 0x64, 0xf5, 0x2c, 0x55, 0xbd, 0x7a, + 0xbc, 0x97, 0xe2, 0xa0, 0x42, 0x0e, 0x07, 0x15, 0xcf, 0x73, 0xd0, 0x5e, 0x82, 0x83, 0x4a, 0x2a, + 0xde, 0xbb, 0xd9, 0xf1, 0x26, 0x7d, 0xca, 0x62, 0x20, 0x19, 0xa6, 0x98, 0x8c, 0xd0, 0xb4, 0x87, + 0xfa, 0x96, 0x61, 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+ 0x00, 0x00, }, // api/base/change/proto/change.proto []byte{ diff --git a/api/submitqueue/gateway/protopb/gateway_grpc.pb.go b/api/submitqueue/gateway/protopb/gateway_grpc.pb.go index 79f70f8e2..af24d56c1 100644 --- a/api/submitqueue/gateway/protopb/gateway_grpc.pb.go +++ b/api/submitqueue/gateway/protopb/gateway_grpc.pb.go @@ -35,6 +35,7 @@ const _ = grpc.SupportPackageIsVersion9 const ( SubmitQueueGateway_Ping_FullMethodName = "/uber.submitqueue.gateway.SubmitQueueGateway/Ping" + SubmitQueueGateway_ListQueues_FullMethodName = "/uber.submitqueue.gateway.SubmitQueueGateway/ListQueues" SubmitQueueGateway_Land_FullMethodName = "/uber.submitqueue.gateway.SubmitQueueGateway/Land" SubmitQueueGateway_Cancel_FullMethodName = "/uber.submitqueue.gateway.SubmitQueueGateway/Cancel" SubmitQueueGateway_GetRequestSummaryByID_FullMethodName = "/uber.submitqueue.gateway.SubmitQueueGateway/GetRequestSummaryByID" @@ -52,6 +53,8 @@ const ( type SubmitQueueGatewayClient interface { // Ping returns a response indicating the service is alive Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) + // ListQueues returns all configured submit queues ordered by name ascending. + ListQueues(ctx context.Context, in *ListQueuesRequest, opts ...grpc.CallOption) (*ListQueuesResponse, error) // Land lands a set of code changes into a target branch, performing the necessary validations across all other changes in the queue. // The processing is asynchronous and returns a LandResponse immediately. The land request is processed in the background. Land(ctx context.Context, in *LandRequest, opts ...grpc.CallOption) (*LandResponse, error) @@ -97,6 +100,16 @@ func (c *submitQueueGatewayClient) Ping(ctx context.Context, in *PingRequest, op return out, nil } +func (c *submitQueueGatewayClient) ListQueues(ctx context.Context, in *ListQueuesRequest, opts ...grpc.CallOption) (*ListQueuesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListQueuesResponse) + err := c.cc.Invoke(ctx, SubmitQueueGateway_ListQueues_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *submitQueueGatewayClient) Land(ctx context.Context, in *LandRequest, opts ...grpc.CallOption) (*LandResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(LandResponse) @@ -175,6 +188,8 @@ func (c *submitQueueGatewayClient) GetRequestHistoryByChangeURI(ctx context.Cont type SubmitQueueGatewayServer interface { // Ping returns a response indicating the service is alive Ping(context.Context, *PingRequest) (*PingResponse, error) + // ListQueues returns all configured submit queues ordered by name ascending. + ListQueues(context.Context, *ListQueuesRequest) (*ListQueuesResponse, error) // Land lands a set of code changes into a target branch, performing the necessary validations across all other changes in the queue. // The processing is asynchronous and returns a LandResponse immediately. The land request is processed in the background. Land(context.Context, *LandRequest) (*LandResponse, error) @@ -213,6 +228,9 @@ type UnimplementedSubmitQueueGatewayServer struct{} func (UnimplementedSubmitQueueGatewayServer) Ping(context.Context, *PingRequest) (*PingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") } +func (UnimplementedSubmitQueueGatewayServer) ListQueues(context.Context, *ListQueuesRequest) (*ListQueuesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListQueues not implemented") +} func (UnimplementedSubmitQueueGatewayServer) Land(context.Context, *LandRequest) (*LandResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Land not implemented") } @@ -273,6 +291,24 @@ func _SubmitQueueGateway_Ping_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _SubmitQueueGateway_ListQueues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListQueuesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubmitQueueGatewayServer).ListQueues(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SubmitQueueGateway_ListQueues_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubmitQueueGatewayServer).ListQueues(ctx, req.(*ListQueuesRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _SubmitQueueGateway_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 { @@ -410,6 +446,10 @@ var SubmitQueueGateway_ServiceDesc = grpc.ServiceDesc{ MethodName: "Ping", Handler: _SubmitQueueGateway_Ping_Handler, }, + { + MethodName: "ListQueues", + Handler: _SubmitQueueGateway_ListQueues_Handler, + }, { MethodName: "Land", Handler: _SubmitQueueGateway_Land_Handler, diff --git a/service/submitqueue/gateway/client/BUILD.bazel b/service/submitqueue/gateway/client/BUILD.bazel index ea6834daa..05c45c90c 100644 --- a/service/submitqueue/gateway/client/BUILD.bazel +++ b/service/submitqueue/gateway/client/BUILD.bazel @@ -1,8 +1,11 @@ -load("@rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") go_library( name = "gateway_lib", - srcs = ["main.go"], + srcs = [ + "list_queues.go", + "main.go", + ], importpath = "github.com/uber/submitqueue/service/submitqueue/gateway/client", visibility = ["//visibility:private"], deps = [ @@ -16,3 +19,18 @@ go_binary( embed = [":gateway_lib"], visibility = ["//visibility:public"], ) + +go_test( + name = "go_default_test", + srcs = ["list_queues_test.go"], + embed = [":gateway_lib"], # keep + deps = [ + "//api/submitqueue/gateway/protopb:go_default_library", + "//submitqueue/client:go_default_library", + "@com_github_stretchr_testify//assert:go_default_library", + "@com_github_stretchr_testify//require:go_default_library", + "@org_golang_google_grpc//:go_default_library", + "@org_golang_google_grpc//codes:go_default_library", + "@org_golang_google_grpc//status:go_default_library", + ], +) diff --git a/service/submitqueue/gateway/client/list_queues.go b/service/submitqueue/gateway/client/list_queues.go new file mode 100644 index 000000000..1ca0d4512 --- /dev/null +++ b/service/submitqueue/gateway/client/list_queues.go @@ -0,0 +1,44 @@ +// 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 main + +import ( + "context" + "flag" + "fmt" + "io" + + "github.com/uber/submitqueue/submitqueue/client" +) + +func runListQueues(ctx context.Context, sq *client.Client, args []string, output io.Writer) error { + fs := flag.NewFlagSet("list-queues", flag.ContinueOnError) + if err := fs.Parse(args); err != nil { + return err + } + if fs.NArg() != 0 { + return fmt.Errorf("list-queues accepts no positional arguments") + } + queues, err := sq.ListQueues(ctx) + if err != nil { + return err + } + for _, queue := range queues { + if _, err := fmt.Fprintln(output, queue.GetName()); err != nil { + return err + } + } + return nil +} diff --git a/service/submitqueue/gateway/client/list_queues_test.go b/service/submitqueue/gateway/client/list_queues_test.go new file mode 100644 index 000000000..c8af3c8a7 --- /dev/null +++ b/service/submitqueue/gateway/client/list_queues_test.go @@ -0,0 +1,98 @@ +// 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 main + +import ( + "bytes" + "context" + "io" + "net" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + pb "github.com/uber/submitqueue/api/submitqueue/gateway/protopb" + "github.com/uber/submitqueue/submitqueue/client" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func TestRunListQueues(t *testing.T) { + tests := []struct { + name string + queues []*pb.Queue + err error + want string + }{ + { + name: "one name per line", + queues: []*pb.Queue{{Name: "main"}, {Name: "release"}}, + want: "main\nrelease\n", + }, + { + name: "no configured queues produce no output", + }, + { + name: "gateway failure produces no output", + err: status.Error(codes.Unavailable, "queue config unavailable"), + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + listener, err := net.Listen("tcp", "127.0.0.1:0") + require.NoError(t, err) + server := grpc.NewServer() + pb.RegisterSubmitQueueGatewayServer(server, &queueListingGateway{queues: tt.queues, err: tt.err}) + go func() { _ = server.Serve(listener) }() + t.Cleanup(server.Stop) + + sq, err := client.New(client.Options{Addr: listener.Addr().String()}) + require.NoError(t, err) + t.Cleanup(func() { _ = sq.Close() }) + var output bytes.Buffer + + err = runListQueues(context.Background(), sq, nil, &output) + if tt.err != nil { + require.Error(t, err) + assert.Equal(t, status.Code(tt.err), status.Code(err)) + } else { + require.NoError(t, err) + } + assert.Equal(t, tt.want, output.String()) + }) + } +} + +func TestRunListQueuesRejectsArguments(t *testing.T) { + for _, args := range [][]string{{"extra"}, {"-queue", "main"}} { + t.Run(args[0], func(t *testing.T) { + require.Error(t, runListQueues(context.Background(), nil, args, io.Discard)) + }) + } +} + +type queueListingGateway struct { + pb.UnimplementedSubmitQueueGatewayServer + queues []*pb.Queue + err error +} + +func (g *queueListingGateway) ListQueues(context.Context, *pb.ListQueuesRequest) (*pb.ListQueuesResponse, error) { + if g.err != nil { + return nil, g.err + } + return &pb.ListQueuesResponse{Queues: g.queues}, nil +} diff --git a/service/submitqueue/gateway/client/main.go b/service/submitqueue/gateway/client/main.go index f17dd01fa..ebef5b45b 100644 --- a/service/submitqueue/gateway/client/main.go +++ b/service/submitqueue/gateway/client/main.go @@ -44,11 +44,12 @@ import ( const usage = `Usage: client [global flags] [command flags] Commands: - ping Check that the gateway is reachable - land Submit a change, or an ordered stack of changes, to a queue - status Read a request's current status - list Show a queue's recent requests as a table - watch Follow a queue's requests until they settle + ping Check that the gateway is reachable + land Submit a change, or an ordered stack of changes, to a queue + status Read a request's current status + list Show a queue's recent requests as a table + list-queues Show all configured submit queues + watch Follow a queue's requests until they settle Global flags: -addr gateway address (default "localhost:8081") @@ -58,6 +59,7 @@ Global flags: Examples: client ping + client list-queues client land -queue my-queue -pr https://github.com/uber/sq-sandbox/pull/7 client land -queue my-queue -uri github://github.com/uber/r/pull/7/ -strategy SQUASH_REBASE client land -queue my-queue -pr -pr @@ -113,6 +115,8 @@ func run(opts client.Options, timeout time.Duration, command string, args []stri return runStatus(ctx, sq, args) case "list": return runList(ctx, sq, args) + case "list-queues": + return runListQueues(ctx, sq, args, os.Stdout) case "watch": return runWatch(ctx, sq, args) default: diff --git a/service/submitqueue/gateway/server/BUILD.bazel b/service/submitqueue/gateway/server/BUILD.bazel index 4640041b0..0ff81f653 100644 --- a/service/submitqueue/gateway/server/BUILD.bazel +++ b/service/submitqueue/gateway/server/BUILD.bazel @@ -76,10 +76,16 @@ go_test( srcs = ["main_test.go"], embed = [":gateway_lib"], # keep deps = [ + "//api/submitqueue/gateway/protopb:go_default_library", + "//submitqueue/entity:go_default_library", + "//submitqueue/extension/queueconfig/mock:go_default_library", "//submitqueue/gateway/controller:go_default_library", "@com_github_stretchr_testify//assert:go_default_library", "@com_github_stretchr_testify//require:go_default_library", + "@com_github_uber_go_tally//:go_default_library", "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//status:go_default_library", + "@org_uber_go_mock//gomock:go_default_library", + "@org_uber_go_zap//:go_default_library", ], ) diff --git a/service/submitqueue/gateway/server/main.go b/service/submitqueue/gateway/server/main.go index 3e0b5f246..88611a65b 100644 --- a/service/submitqueue/gateway/server/main.go +++ b/service/submitqueue/gateway/server/main.go @@ -64,6 +64,7 @@ type GatewayServer struct { cancelController controller.CancelController requestSummaryController controller.RequestSummaryController listController controller.ListController + listQueuesController controller.ListQueuesController requestHistoryController controller.RequestHistoryController } @@ -122,6 +123,14 @@ func (s *GatewayServer) List(ctx context.Context, req *pb.ListRequest) (*pb.List return mapper.ListResultToProto(result), nil } +func (s *GatewayServer) ListQueues(ctx context.Context, _ *pb.ListQueuesRequest) (*pb.ListQueuesResponse, error) { + queues, err := s.listQueuesController.ListQueues(ctx) + if err != nil { + return nil, err + } + return &pb.ListQueuesResponse{Queues: mapper.QueuesToProto(queues)}, nil +} + // GetRequestHistoryByID maps the wire request to an entity, delegates to the controller, and maps the result back to the wire response. func (s *GatewayServer) GetRequestHistoryByID(ctx context.Context, req *pb.GetRequestHistoryByIDRequest) (*pb.GetRequestHistoryByIDResponse, error) { events, err := s.requestHistoryController.GetRequestHistoryByID(ctx, mapper.ProtoToGetRequestHistoryByIDRequest(req)) @@ -354,6 +363,7 @@ func run() error { cancelController := controller.NewCancelController(logger.Sugar(), scope, storageFty, materializer, registry) requestSummaryController := controller.NewRequestSummaryController(logger.Sugar(), scope, storageFty) listController := controller.NewListController(logger.Sugar(), scope, storageFty, queueConfigs) + listQueuesController := controller.NewListQueuesController(logger.Sugar(), scope, queueConfigs) requestHistoryController := controller.NewRequestHistoryController(logger.Sugar(), scope, storageFty) gatewayServer := &GatewayServer{ pingController: pingController, @@ -361,6 +371,7 @@ func run() error { cancelController: cancelController, requestSummaryController: requestSummaryController, listController: listController, + listQueuesController: listQueuesController, requestHistoryController: requestHistoryController, } diff --git a/service/submitqueue/gateway/server/main_test.go b/service/submitqueue/gateway/server/main_test.go index c864096ca..a86781061 100644 --- a/service/submitqueue/gateway/server/main_test.go +++ b/service/submitqueue/gateway/server/main_test.go @@ -15,16 +15,69 @@ package main import ( + "context" "errors" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/uber-go/tally" + pb "github.com/uber/submitqueue/api/submitqueue/gateway/protopb" + "github.com/uber/submitqueue/submitqueue/entity" + qcmock "github.com/uber/submitqueue/submitqueue/extension/queueconfig/mock" "github.com/uber/submitqueue/submitqueue/gateway/controller" + "go.uber.org/mock/gomock" + "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) +func TestGatewayServerListQueues(t *testing.T) { + configErr := errors.New("queue config unavailable") + tests := []struct { + name string + queues []entity.QueueConfig + err error + want []string + }{ + { + name: "configured queues exposed in name order", + queues: []entity.QueueConfig{{Name: "release"}, {Name: "main"}}, + want: []string{"main", "release"}, + }, + { + name: "no configured queues", + want: []string{}, + }, + { + name: "configuration failure", + err: configErr, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + queueConfigs := qcmock.NewMockStore(gomock.NewController(t)) + queueConfigs.EXPECT().List(gomock.Any()).Return(tt.queues, tt.err) + server := &GatewayServer{ + listQueuesController: controller.NewListQueuesController(zap.NewNop().Sugar(), tally.NoopScope, queueConfigs), + } + + resp, err := server.ListQueues(context.Background(), &pb.ListQueuesRequest{}) + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + assert.Nil(t, resp) + return + } + require.NoError(t, err) + names := make([]string, 0, len(resp.GetQueues())) + for _, queue := range resp.GetQueues() { + names = append(names, queue.GetName()) + } + assert.Equal(t, tt.want, names) + }) + } +} + func TestValidateConfiguredQueueTenants(t *testing.T) { require.NoError(t, validateConfiguredQueueTenants( []string{"queue-a", "queue-b"}, diff --git a/service/submitqueue/gateway/server/mapper/BUILD.bazel b/service/submitqueue/gateway/server/mapper/BUILD.bazel index 76271ee87..69bb3e2d6 100644 --- a/service/submitqueue/gateway/server/mapper/BUILD.bazel +++ b/service/submitqueue/gateway/server/mapper/BUILD.bazel @@ -6,6 +6,7 @@ go_library( "cancel.go", "land.go", "list.go", + "list_queues.go", "request_history.go", "request_summary.go", ], diff --git a/service/submitqueue/gateway/server/mapper/list_queues.go b/service/submitqueue/gateway/server/mapper/list_queues.go new file mode 100644 index 000000000..e911a1cf4 --- /dev/null +++ b/service/submitqueue/gateway/server/mapper/list_queues.go @@ -0,0 +1,28 @@ +// 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 mapper + +import ( + pb "github.com/uber/submitqueue/api/submitqueue/gateway/protopb" + "github.com/uber/submitqueue/submitqueue/entity" +) + +func QueuesToProto(queues []entity.QueueConfig) []*pb.Queue { + result := make([]*pb.Queue, 0, len(queues)) + for _, queue := range queues { + result = append(result, &pb.Queue{Name: queue.Name}) + } + return result +} diff --git a/submitqueue/client/BUILD.bazel b/submitqueue/client/BUILD.bazel index 889715d1d..687597f1e 100644 --- a/submitqueue/client/BUILD.bazel +++ b/submitqueue/client/BUILD.bazel @@ -38,6 +38,8 @@ go_test( "@com_github_stretchr_testify//assert:go_default_library", "@com_github_stretchr_testify//require:go_default_library", "@org_golang_google_grpc//:go_default_library", + "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", + "@org_golang_google_grpc//status:go_default_library", ], ) diff --git a/submitqueue/client/README.md b/submitqueue/client/README.md index facafe2db..6da42d80b 100644 --- a/submitqueue/client/README.md +++ b/submitqueue/client/README.md @@ -12,6 +12,10 @@ It exists so the tools are thin. A binary under `service/` is flag parsing over `TokenEnv` names the variable holding a bearer token rather than carrying the token, so a credential never reaches a command line. An unset variable is not an error — it is how a client against a gateway that wants no credential runs, which today is every gateway in this repository. The token is for one reached through something that does check it: a proxy, a sidecar, an ingress terminating auth ahead of the service. +## Discovering queues + +`Client.ListQueues` returns every queue configured on the gateway, including queues that have never received a request, ordered by name ascending. The gateway CLI exposes this as `list-queues`, with one queue name per output line and no output when no queues are configured. This differs from `list`, which reads the request history of one named queue. + ## The view A `Row` is one land request and everything shown about it. A `Tracker` owns a set of rows, polls their histories, and redraws as they move; `Draw` renders once, for a listing that is not following anything. diff --git a/submitqueue/client/query.go b/submitqueue/client/query.go index 97ebeeb07..3b4ea02ca 100644 --- a/submitqueue/client/query.go +++ b/submitqueue/client/query.go @@ -22,6 +22,15 @@ import ( pb "github.com/uber/submitqueue/api/submitqueue/gateway/protopb" ) +// ListQueues includes configured queues with no requests, ordered by name ascending. +func (c *Client) ListQueues(ctx context.Context) ([]*pb.Queue, error) { + resp, err := c.gw.ListQueues(ctx, &pb.ListQueuesRequest{}) + if err != nil { + return nil, fmt.Errorf("list queues failed: %w", err) + } + return resp.GetQueues(), nil +} + // ListQuery selects a page range of a queue's receipt history. type ListQuery struct { // Queue is the exact queue to read. Required: the gateway has no diff --git a/submitqueue/client/query_test.go b/submitqueue/client/query_test.go index 785ffdf76..6954c8d42 100644 --- a/submitqueue/client/query_test.go +++ b/submitqueue/client/query_test.go @@ -24,8 +24,66 @@ import ( "github.com/stretchr/testify/require" pb "github.com/uber/submitqueue/api/submitqueue/gateway/protopb" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) +func TestClientListQueues(t *testing.T) { + tests := []struct { + name string + queues []*pb.Queue + err error + want []string + }{ + { + name: "configured queues", + queues: []*pb.Queue{{Name: "demo"}, {Name: "main"}}, + want: []string{"demo", "main"}, + }, + { + name: "no configured queues", + want: []string{}, + }, + { + name: "gateway failure", + err: status.Error(codes.Unavailable, "queue config unavailable"), + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + sq, stop := dial(t, &queueListingGateway{queues: tt.queues, err: tt.err}) + defer stop() + + queues, err := sq.ListQueues(context.Background()) + if tt.err != nil { + require.Error(t, err) + assert.Equal(t, status.Code(tt.err), status.Code(err)) + assert.Nil(t, queues) + return + } + require.NoError(t, err) + names := make([]string, 0, len(queues)) + for _, queue := range queues { + names = append(names, queue.GetName()) + } + assert.Equal(t, tt.want, names) + }) + } +} + +type queueListingGateway struct { + pb.UnimplementedSubmitQueueGatewayServer + queues []*pb.Queue + err error +} + +func (g *queueListingGateway) ListQueues(context.Context, *pb.ListQueuesRequest) (*pb.ListQueuesResponse, error) { + if g.err != nil { + return nil, g.err + } + return &pb.ListQueuesResponse{Queues: g.queues}, nil +} + func TestListRequiresAQueue(t *testing.T) { sq, stop := dial(t, &pagingGateway{}) defer stop() diff --git a/submitqueue/gateway/controller/BUILD.bazel b/submitqueue/gateway/controller/BUILD.bazel index b02fb10aa..ad80124e8 100644 --- a/submitqueue/gateway/controller/BUILD.bazel +++ b/submitqueue/gateway/controller/BUILD.bazel @@ -6,6 +6,7 @@ go_library( "cancel.go", "land.go", "list.go", + "list_queues.go", "ping.go", "read_errors.go", "request_history.go", @@ -37,6 +38,7 @@ go_test( srcs = [ "cancel_test.go", "land_test.go", + "list_queues_test.go", "list_test.go", "ping_test.go", "request_history_test.go", diff --git a/submitqueue/gateway/controller/list_queues.go b/submitqueue/gateway/controller/list_queues.go new file mode 100644 index 000000000..1c10f822f --- /dev/null +++ b/submitqueue/gateway/controller/list_queues.go @@ -0,0 +1,63 @@ +// 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 controller + +import ( + "context" + "fmt" + "sort" + + "github.com/uber-go/tally" + "github.com/uber/submitqueue/platform/metrics" + "github.com/uber/submitqueue/submitqueue/entity" + "github.com/uber/submitqueue/submitqueue/extension/queueconfig" + "go.uber.org/zap" +) + +type ListQueuesController interface { + // ListQueues includes queues with no requests, ordered by name ascending. + ListQueues(ctx context.Context) ([]entity.QueueConfig, error) +} + +var _ ListQueuesController = (*listQueuesController)(nil) + +type listQueuesController struct { + logger *zap.SugaredLogger + metricsScope tally.Scope + queueConfigs queueconfig.Store +} + +func NewListQueuesController(logger *zap.SugaredLogger, scope tally.Scope, queueConfigs queueconfig.Store) ListQueuesController { + return &listQueuesController{ + logger: logger, + metricsScope: scope.SubScope("list_queues_controller"), + queueConfigs: queueConfigs, + } +} + +func (c *listQueuesController) ListQueues(ctx context.Context) (_ []entity.QueueConfig, retErr error) { + op := metrics.Begin(c.metricsScope, "list_queues", metrics.StorageLatencyBuckets) + defer func() { op.Complete(retErr) }() + + configuredQueues, err := c.queueConfigs.List(ctx) + if err != nil { + return nil, fmt.Errorf("failed to list configured queues: %w", err) + } + queues := append([]entity.QueueConfig{}, configuredQueues...) + sort.Slice(queues, func(i, j int) bool { return queues[i].Name < queues[j].Name }) + + c.logger.Debugw("configured queues listed", "queue_count", len(queues)) + return queues, nil +} diff --git a/submitqueue/gateway/controller/list_queues_test.go b/submitqueue/gateway/controller/list_queues_test.go new file mode 100644 index 000000000..6bf729f3f --- /dev/null +++ b/submitqueue/gateway/controller/list_queues_test.go @@ -0,0 +1,82 @@ +// 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 controller + +import ( + "context" + "errors" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/uber-go/tally" + "github.com/uber/submitqueue/submitqueue/entity" + qcmock "github.com/uber/submitqueue/submitqueue/extension/queueconfig/mock" + "go.uber.org/mock/gomock" + "go.uber.org/zap" +) + +func TestListQueues(t *testing.T) { + configErr := errors.New("queue config unavailable") + tests := []struct { + name string + queues []entity.QueueConfig + err error + want []entity.QueueConfig + }{ + { + name: "configured queues sorted by name", + queues: []entity.QueueConfig{{Name: "release"}, {Name: "main"}, {Name: "demo"}}, + want: []entity.QueueConfig{{Name: "demo"}, {Name: "main"}, {Name: "release"}}, + }, + { + name: "single queue", + queues: []entity.QueueConfig{{Name: "main"}}, + want: []entity.QueueConfig{{Name: "main"}}, + }, + { + name: "no configured queues", + want: []entity.QueueConfig{}, + }, + { + name: "store failure returns no partial result", + queues: []entity.QueueConfig{{Name: "main"}}, + err: configErr, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + queueConfigs := qcmock.NewMockStore(gomock.NewController(t)) + ctx := context.Background() + queueConfigs.EXPECT().List(ctx).Return(tt.queues, tt.err) + original := append([]entity.QueueConfig(nil), tt.queues...) + c := NewListQueuesController(zap.NewNop().Sugar(), tally.NoopScope, queueConfigs) + + got, err := c.ListQueues(ctx) + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + assert.Nil(t, got) + return + } + require.NoError(t, err) + assert.Equal(t, tt.want, got) + assert.Equal(t, original, tt.queues) + if len(got) > 0 { + got[0].Name = "mutated" + assert.Equal(t, original, tt.queues) + } + }) + } +} diff --git a/test/integration/submitqueue/gateway/suite_test.go b/test/integration/submitqueue/gateway/suite_test.go index a59c6fbfb..a39f8e275 100644 --- a/test/integration/submitqueue/gateway/suite_test.go +++ b/test/integration/submitqueue/gateway/suite_test.go @@ -138,6 +138,29 @@ func (s *GatewayIntegrationSuite) TestPingAPI() { assert.NotZero(t, resp.Timestamp) } +func (s *GatewayIntegrationSuite) TestListQueuesAPI() { + t := s.T() + resp, err := s.client.ListQueues(s.ctx, &pb.ListQueuesRequest{}) + require.NoError(t, err) + names := make([]string, 0, len(resp.GetQueues())) + for _, queue := range resp.GetQueues() { + names = append(names, queue.GetName()) + } + assert.Equal(t, []string{ + "demo-queue", + "e2e-cancel-queue", + "e2e-chain-queue", + "e2e-conflict-error-queue", + "e2e-git-queue", + "e2e-redelivery-queue", + "e2e-respeculate-queue", + "e2e-strand-queue", + "e2e-test-queue", + "file-overlap-queue", + "test-queue", + }, names) +} + // TestLandAPI tests the Gateway Land API with queue publishing func (s *GatewayIntegrationSuite) TestLandAPI() { t := s.T()