Skip to content

Commit be1fd97

Browse files
committed
feat(stovepipe): add request history protobuf contract
Summary: Intent: - Expose a stable, queue-scoped contract for reading retained request history. - Establish the shared validation result shape used by recorded validation facts. Changes: - Add request-ID and URI history requests with cursor pagination. - Add the history projection messages and generated gRPC and YARPC bindings. - Align the request-history RFC example on the public entry identifier. This PR builds on #637 in the Stovepipe API proposal stack. --- <sub>Generated by the 🪄 [pr-create](https://sg.uberinternal.com/code.uber.internal/uber-code/devexp-agent-marketplace/-/blob/claude-code/plugins/dev/uber-dev/skills/pr-create/SKILL.md) skill in devexp-agent-marketplace</sub>
1 parent a3459c7 commit be1fd97

5 files changed

Lines changed: 930 additions & 44 deletions

File tree

api/stovepipe/proto/stovepipe.proto

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,101 @@ message IngestResponse {
5454
string id = 1;
5555
}
5656

57+
// GetRequestHistoryByRequestIDRequest selects one request history by the ID
58+
// returned from Ingest.
59+
message GetRequestHistoryByRequestIDRequest {
60+
// Logical queue containing the request.
61+
string queue = 1;
62+
// Globally unique request identifier returned from Ingest.
63+
string request_id = 2;
64+
// Maximum entries to return. Zero selects the server default.
65+
int32 page_size = 3;
66+
// Opaque continuation token. Empty selects the first page.
67+
string page_token = 4;
68+
}
69+
70+
// GetRequestHistoryByURIRequest selects one request history by its exact commit URI.
71+
message GetRequestHistoryByURIRequest {
72+
// Logical queue containing the request.
73+
string queue = 1;
74+
// Exact VCS-agnostic commit URI supplied by the selected request.
75+
string uri = 2;
76+
// Maximum entries to return. Zero selects the server default.
77+
int32 page_size = 3;
78+
// Opaque continuation token. Empty selects the first page.
79+
string page_token = 4;
80+
}
81+
82+
// ValidationResult is the immutable validation verdict for one scope.
83+
message ValidationResult {
84+
// Degree measures how broken the scope is on [0.0, 1.0]. Zero is fully
85+
// green and one is fully broken.
86+
double degree = 1;
87+
}
88+
89+
// HistoryEntry is one retained request state or lifecycle event.
90+
message HistoryEntry {
91+
// Opaque stable identity of this logical occurrence within the request.
92+
string entry_id = 1;
93+
// Occurrence time in Unix milliseconds.
94+
int64 timestamp_ms = 2;
95+
// Exactly one occurrence kind is populated.
96+
oneof occurrence {
97+
// Durable request state reached by the request.
98+
string request_state = 3;
99+
// Event that occurred without changing the request state.
100+
string event = 4;
101+
}
102+
// Newer request that caused a superseded state. Empty when not applicable.
103+
string superseded_by_request_id = 5;
104+
// Build associated with the occurrence. Empty when no build applies.
105+
string build_id = 6;
106+
// Stable domain reason for a terminal request outcome. Empty otherwise.
107+
string outcome_reason = 7;
108+
// Recorded validation verdict. Present only when the occurrence established
109+
// an immutable validation fact.
110+
ValidationResult result = 8;
111+
}
112+
113+
// RequestHistory contains immutable request context and one ordered page of entries.
114+
message RequestHistory {
115+
// Globally unique request identifier.
116+
string request_id = 1;
117+
// VCS-agnostic commit URI validated by the request.
118+
string uri = 2;
119+
// Validation scope selected for the request.
120+
string build_strategy = 3;
121+
// Baseline URI for incremental validation. Empty for a full build.
122+
string base_uri = 4;
123+
// Entries ordered by occurrence time and stable entry identity.
124+
repeated HistoryEntry entries = 5;
125+
}
126+
127+
// GetRequestHistoryByRequestIDResponse contains one page of request history.
128+
message GetRequestHistoryByRequestIDResponse {
129+
// Selected request history and immutable context.
130+
RequestHistory history = 1;
131+
// Opaque continuation token. Empty on the final page.
132+
string next_page_token = 2;
133+
}
134+
135+
// GetRequestHistoryByURIResponse contains one page of request history.
136+
message GetRequestHistoryByURIResponse {
137+
// Selected request history and immutable context.
138+
RequestHistory history = 1;
139+
// Opaque continuation token. Empty on the final page.
140+
string next_page_token = 2;
141+
}
142+
57143
// Stovepipe provides the Stovepipe API.
58144
service Stovepipe {
59145
// Ping returns a response indicating the service is alive
60146
rpc Ping(PingRequest) returns (PingResponse) {}
61147
// Ingest admits a queue's newly observed commit into the validation pipeline and returns
62148
// the minted request ID. The caller hands off asynchronously; validation happens later.
63149
rpc Ingest(IngestRequest) returns (IngestResponse) {}
150+
// GetRequestHistoryByRequestID returns retained history for one request ID.
151+
rpc GetRequestHistoryByRequestID(GetRequestHistoryByRequestIDRequest) returns (GetRequestHistoryByRequestIDResponse) {}
152+
// GetRequestHistoryByURI returns retained history for one exact commit URI.
153+
rpc GetRequestHistoryByURI(GetRequestHistoryByURIRequest) returns (GetRequestHistoryByURIResponse) {}
64154
}

0 commit comments

Comments
 (0)