|
| 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 | +} |
0 commit comments