Skip to content

Commit adfa519

Browse files
kevinlnewclaude
andcommitted
feat(pushqueue): add proto definition and domain scaffold
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) <noreply@anthropic.com>
1 parent 524b020 commit adfa519

8 files changed

Lines changed: 1585 additions & 0 deletions

File tree

pushqueue/core/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
load("@rules_go//go:def.bzl", "go_library")
2+
3+
go_library(
4+
name = "core",
5+
srcs = ["core.go"],
6+
importpath = "github.com/uber/submitqueue/pushqueue/core",
7+
visibility = ["//visibility:public"],
8+
)

pushqueue/core/core.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) 2025 Uber Technologies, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Package core groups infrastructure shared across PushQueue's own services
16+
// (gateway and orchestrator) — the PushQueue-scoped analogue of the repo-level
17+
// core/. Cross-domain infrastructure lives in the top-level core/; this package
18+
// is for plumbing private to PushQueue. Subpackages are added here as shared
19+
// needs emerge, mirroring submitqueue/core.
20+
package core
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
load("@rules_go//go:def.bzl", "go_library")
2+
load("@rules_go//proto:def.bzl", "go_proto_library")
3+
load("@rules_proto//proto:defs.bzl", "proto_library")
4+
5+
proto_library(
6+
name = "protopb_proto",
7+
srcs = ["gateway.proto"],
8+
visibility = ["//visibility:public"],
9+
)
10+
11+
go_proto_library(
12+
name = "protopb_go_proto",
13+
compilers = ["@io_bazel_rules_go//proto:go_grpc_v2"],
14+
importpath = "github.com/uber/submitqueue/pushqueue/gateway/protopb",
15+
proto = ":protopb_proto",
16+
visibility = ["//visibility:public"],
17+
)
18+
19+
go_library(
20+
name = "protopb",
21+
embed = [":protopb_go_proto"],
22+
importpath = "github.com/uber/submitqueue/pushqueue/gateway/protopb",
23+
visibility = ["//visibility:public"],
24+
)
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
// Copyright (c) 2025 Uber Technologies, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package uber.submitqueue.pushqueue;
18+
19+
option go_package = "github.com/uber/submitqueue/pushqueue/gateway/protopb";
20+
option java_multiple_files = true;
21+
option java_outer_classname = "GatewayProto";
22+
option java_package = "com.uber.submitqueue.pushqueue";
23+
24+
enum Strategy {
25+
STRATEGY_UNSPECIFIED = 0;
26+
STRATEGY_REBASE = 1;
27+
STRATEGY_SQUASH_REBASE = 2;
28+
STRATEGY_MERGE = 3;
29+
}
30+
31+
message Queue {
32+
string name = 1;
33+
string address = 2;
34+
string target = 3;
35+
}
36+
37+
message LandItem {
38+
repeated string uris = 1;
39+
Strategy strategy = 2;
40+
}
41+
42+
enum OutcomeStatus {
43+
OUTCOME_STATUS_UNSPECIFIED = 0;
44+
OUTCOME_STATUS_COMMITTED = 1;
45+
OUTCOME_STATUS_ALREADY_EXISTED = 2;
46+
}
47+
48+
message ItemOutcome {
49+
OutcomeStatus status = 1;
50+
repeated string revision_ids = 2;
51+
}
52+
53+
message LandRequest {
54+
Queue queue = 1;
55+
repeated LandItem items = 2;
56+
}
57+
58+
message LandResponse {
59+
bool success = 1;
60+
repeated ItemOutcome outcomes = 2;
61+
string finalize_error = 3;
62+
}
63+
64+
message CheckMergeabilityRequest {
65+
Queue queue = 1;
66+
repeated LandItem items = 2;
67+
}
68+
69+
message MergeabilityItemResult {
70+
bool mergeable = 1;
71+
string reason = 2;
72+
}
73+
74+
message CheckMergeabilityResponse {
75+
bool mergeable = 1;
76+
repeated MergeabilityItemResult results = 2;
77+
}
78+
79+
message PingRequest {
80+
string message = 1;
81+
}
82+
83+
message PingResponse {
84+
string message = 1;
85+
string service_name = 2;
86+
int64 timestamp = 3;
87+
string hostname = 4;
88+
}
89+
90+
service PushQueueGateway {
91+
rpc Ping(PingRequest) returns (PingResponse) {}
92+
rpc Land(LandRequest) returns (LandResponse) {}
93+
rpc CheckMergeability(CheckMergeabilityRequest) returns (CheckMergeabilityResponse) {}
94+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
load("@rules_go//go:def.bzl", "go_library")
2+
3+
go_library(
4+
name = "protopb",
5+
srcs = [
6+
"gateway.pb.go",
7+
"gateway.pb.yarpc.go",
8+
"gateway_grpc.pb.go",
9+
],
10+
importpath = "github.com/uber/submitqueue/pushqueue/gateway/protopb",
11+
visibility = ["//visibility:public"],
12+
deps = [
13+
"@com_github_gogo_protobuf//jsonpb",
14+
"@com_github_gogo_protobuf//proto",
15+
"@org_golang_google_grpc//:grpc",
16+
"@org_golang_google_grpc//codes",
17+
"@org_golang_google_grpc//status",
18+
"@org_golang_google_protobuf//reflect/protoreflect",
19+
"@org_golang_google_protobuf//runtime/protoimpl",
20+
"@org_uber_go_fx//:fx",
21+
"@org_uber_go_yarpc//:yarpc",
22+
"@org_uber_go_yarpc//api/transport",
23+
"@org_uber_go_yarpc//api/x/restriction",
24+
"@org_uber_go_yarpc//encoding/protobuf",
25+
"@org_uber_go_yarpc//encoding/protobuf/reflection",
26+
],
27+
)

0 commit comments

Comments
 (0)