[4/N] feat(submitqueue): activate request status materialization#343
Conversation
3b2b897 to
82341f1
Compare
6ec424a to
6da4c38
Compare
82341f1 to
e280a79
Compare
6da4c38 to
1fe902a
Compare
1fe902a to
bb30051
Compare
e280a79 to
a9c8a02
Compare
a9c8a02 to
01706b3
Compare
bb30051 to
1803e8e
Compare
01706b3 to
2deb9fe
Compare
1803e8e to
5014c91
Compare
|
🛑 Automatic stack rebase aborted — diff mismatch The rebase of Please rebase manually and verify the changes are correct. |
## Summary Add storage contracts, MySQL implementations, generated mocks, and integration coverage for request summaries, queue projections, and change URI mappings. ## Test Plan ✅ `make fmt && make build && make test && make e2e-test` ## Issues ## Stack 1. @ uber#340 1. uber#341 1. uber#342 1. uber#343 1. uber#344 1. uber#345 1. uber#346
5014c91 to
cba4d2e
Compare
|
🛑 Automatic stack rebase aborted — diff mismatch The rebase of Please rebase manually and verify the changes are correct. |
1 similar comment
|
🛑 Automatic stack rebase aborted — diff mismatch The rebase of Please rebase manually and verify the changes are correct. |
Route synchronous, queued, and DLQ request-log writes through the shared materializer so authoritative and queue projections converge with retained history. Preserve the original DLQ failure reason as the terminal request last error. Validation: make fmt && make build && make test && make e2e-test
2deb9fe to
c71e756
Compare
## Summary
feat(gateway): add request history lookups
## Test Plan
✅ `make fmt && make build && make test && make e2e-test`
### Local full-stack gRPC verification
- Date: `2026-07-15`
- Commit: `d814bd69c547418294ba684d49900264189a48fe`
- Started a clean local Gateway, Orchestrator, Runway, and MySQL stack
with `make local-submitqueue-start`.
- Called the real Gateway server with `grpcurl` using
`api/submitqueue/gateway/proto/gateway.proto`.
- Submitted the same pinned change twice. Request 1 landed; request 2
reached `error` as a duplicate of the in-flight request.
| Endpoint | Verified behavior |
|---|---|
| `GetRequestSummaryByID` | Returned the landed summary and an error
summary containing `lastError`. |
| `GetRequestSummaryByChangeURI` | Returned both matching summaries,
newest first. |
| `List` | Returned both queue receipts over two pages with `pageSize:
1`. |
| `GetRequestHistoryByID` | Returned chronological histories ending in
`landed` and `error`. |
| `GetRequestHistoryByChangeURI` | Returned both histories in ascending
sqid order and preserved terminal `lastError`. |
### Exact gRPC requests and stdout
<details><summary><code>Setup: Land request 1</code></summary>
RPC: `uber.submitqueue.gateway.SubmitQueueGateway/Land`
Request:
```json
{"queue":"e2e-test-queue","change":{"uris":["github://uber/grpc-verification/pull/790/d814bd69c547418294ba684d49900264189a48fe"]},"strategy":"REBASE"}
```
STDOUT:
```json
{
"sqid": "e2e-test-queue/1"
}
```
</details>
<details><summary><code>Setup: Land request 2 with the same pinned
change</code></summary>
RPC: `uber.submitqueue.gateway.SubmitQueueGateway/Land`
Request:
```json
{"queue":"e2e-test-queue","change":{"uris":["github://uber/grpc-verification/pull/790/d814bd69c547418294ba684d49900264189a48fe"]},"strategy":"REBASE"}
```
STDOUT:
```json
{
"sqid": "e2e-test-queue/2"
}
```
</details>
<details><summary><code>GetRequestSummaryByID: successful
request</code></summary>
RPC: `uber.submitqueue.gateway.SubmitQueueGateway/GetRequestSummaryByID`
Request:
```json
{"sqid":"e2e-test-queue/1"}
```
STDOUT:
```json
{
"request": {
"sqid": "e2e-test-queue/1",
"queue": "e2e-test-queue",
"changeUris": [
"github://uber/grpc-verification/pull/790/d814bd69c547418294ba684d49900264189a48fe"
],
"receivedAtMs": "1784136105896",
"status": "landed",
"metadata": {
"batch_id": "e2e-test-queue/batch/1"
}
}
}
```
</details>
<details><summary><code>GetRequestSummaryByID: duplicate
request</code></summary>
RPC: `uber.submitqueue.gateway.SubmitQueueGateway/GetRequestSummaryByID`
Request:
```json
{"sqid":"e2e-test-queue/2"}
```
STDOUT:
```json
{
"request": {
"sqid": "e2e-test-queue/2",
"queue": "e2e-test-queue",
"changeUris": [
"github://uber/grpc-verification/pull/790/d814bd69c547418294ba684d49900264189a48fe"
],
"receivedAtMs": "1784136105938",
"status": "error",
"lastError": "request e2e-test-queue/2 is a duplicate of in-flight request e2e-test-queue/1"
}
}
```
</details>
<details><summary><code>GetRequestSummaryByChangeURI</code></summary>
RPC:
`uber.submitqueue.gateway.SubmitQueueGateway/GetRequestSummaryByChangeURI`
Request:
```json
{"changeUri":"github://uber/grpc-verification/pull/790/d814bd69c547418294ba684d49900264189a48fe"}
```
STDOUT:
```json
{
"requests": [
{
"sqid": "e2e-test-queue/2",
"queue": "e2e-test-queue",
"changeUris": [
"github://uber/grpc-verification/pull/790/d814bd69c547418294ba684d49900264189a48fe"
],
"receivedAtMs": "1784136105938",
"status": "error",
"lastError": "request e2e-test-queue/2 is a duplicate of in-flight request e2e-test-queue/1"
},
{
"sqid": "e2e-test-queue/1",
"queue": "e2e-test-queue",
"changeUris": [
"github://uber/grpc-verification/pull/790/d814bd69c547418294ba684d49900264189a48fe"
],
"receivedAtMs": "1784136105896",
"status": "landed",
"metadata": {
"batch_id": "e2e-test-queue/batch/1"
}
}
]
}
```
</details>
<details><summary><code>List: first page</code></summary>
RPC: `uber.submitqueue.gateway.SubmitQueueGateway/List`
Request:
```json
{"queue":"e2e-test-queue","receivedAtOrAfterMs":1784136105896,"receivedBeforeMs":1784136105939,"pageSize":1}
```
STDOUT:
```json
{
"requests": [
{
"sqid": "e2e-test-queue/2",
"queue": "e2e-test-queue",
"changeUris": [
"github://uber/grpc-verification/pull/790/d814bd69c547418294ba684d49900264189a48fe"
],
"receivedAtMs": "1784136105938",
"status": "error",
"lastError": "request e2e-test-queue/2 is a duplicate of in-flight request e2e-test-queue/1"
}
],
"nextPageToken": "bGFzdF9yZWNlaXZlZF9hdF9tcz0xNzg0MTM2MTA1OTM4Jmxhc3RfcmVxdWVzdF9pZD1lMmUtdGVzdC1xdWV1ZSUyRjImcXVldWU9ZTJlLXRlc3QtcXVldWUmcmVjZWl2ZWRfYXRfb3JfYWZ0ZXJfbXM9MTc4NDEzNjEwNTg5NiZyZWNlaXZlZF9iZWZvcmVfbXM9MTc4NDEzNjEwNTkzOQ"
}
```
</details>
<details><summary><code>List: second page</code></summary>
RPC: `uber.submitqueue.gateway.SubmitQueueGateway/List`
Request:
```json
{"queue":"e2e-test-queue","receivedAtOrAfterMs":1784136105896,"receivedBeforeMs":1784136105939,"pageSize":1,"pageToken":"bGFzdF9yZWNlaXZlZF9hdF9tcz0xNzg0MTM2MTA1OTM4Jmxhc3RfcmVxdWVzdF9pZD1lMmUtdGVzdC1xdWV1ZSUyRjImcXVldWU9ZTJlLXRlc3QtcXVldWUmcmVjZWl2ZWRfYXRfb3JfYWZ0ZXJfbXM9MTc4NDEzNjEwNTg5NiZyZWNlaXZlZF9iZWZvcmVfbXM9MTc4NDEzNjEwNTkzOQ"}
```
STDOUT:
```json
{
"requests": [
{
"sqid": "e2e-test-queue/1",
"queue": "e2e-test-queue",
"changeUris": [
"github://uber/grpc-verification/pull/790/d814bd69c547418294ba684d49900264189a48fe"
],
"receivedAtMs": "1784136105896",
"status": "landed",
"metadata": {
"batch_id": "e2e-test-queue/batch/1"
}
}
]
}
```
</details>
<details><summary><code>GetRequestHistoryByID: successful
request</code></summary>
RPC: `uber.submitqueue.gateway.SubmitQueueGateway/GetRequestHistoryByID`
Request:
```json
{"sqid":"e2e-test-queue/1"}
```
STDOUT:
```json
{
"events": [
{
"timestampMs": "1784136105896",
"status": "accepted"
},
{
"timestampMs": "1784136106080",
"status": "started"
},
{
"timestampMs": "1784136106791",
"status": "batched",
"metadata": {
"batch_id": "e2e-test-queue/batch/1"
}
},
{
"timestampMs": "1784136106965",
"status": "scored",
"metadata": {
"batch_id": "e2e-test-queue/batch/1",
"score": "0.7000"
}
},
{
"timestampMs": "1784136108484",
"status": "landed",
"metadata": {
"batch_id": "e2e-test-queue/batch/1"
}
}
]
}
```
</details>
<details><summary><code>GetRequestHistoryByID: duplicate
request</code></summary>
RPC: `uber.submitqueue.gateway.SubmitQueueGateway/GetRequestHistoryByID`
Request:
```json
{"sqid":"e2e-test-queue/2"}
```
STDOUT:
```json
{
"events": [
{
"timestampMs": "1784136105938",
"status": "accepted"
},
{
"timestampMs": "1784136106086",
"status": "started"
},
{
"timestampMs": "1784136106461",
"status": "error",
"lastError": "request e2e-test-queue/2 is a duplicate of in-flight request e2e-test-queue/1"
}
]
}
```
</details>
<details><summary><code>GetRequestHistoryByChangeURI</code></summary>
RPC:
`uber.submitqueue.gateway.SubmitQueueGateway/GetRequestHistoryByChangeURI`
Request:
```json
{"changeUri":"github://uber/grpc-verification/pull/790/d814bd69c547418294ba684d49900264189a48fe"}
```
STDOUT:
```json
{
"histories": [
{
"sqid": "e2e-test-queue/1",
"events": [
{
"timestampMs": "1784136105896",
"status": "accepted"
},
{
"timestampMs": "1784136106080",
"status": "started"
},
{
"timestampMs": "1784136106791",
"status": "batched",
"metadata": {
"batch_id": "e2e-test-queue/batch/1"
}
},
{
"timestampMs": "1784136106965",
"status": "scored",
"metadata": {
"batch_id": "e2e-test-queue/batch/1",
"score": "0.7000"
}
},
{
"timestampMs": "1784136108484",
"status": "landed",
"metadata": {
"batch_id": "e2e-test-queue/batch/1"
}
}
]
},
{
"sqid": "e2e-test-queue/2",
"events": [
{
"timestampMs": "1784136105938",
"status": "accepted"
},
{
"timestampMs": "1784136106086",
"status": "started"
},
{
"timestampMs": "1784136106461",
"status": "error",
"lastError": "request e2e-test-queue/2 is a duplicate of in-flight request e2e-test-queue/1"
}
]
}
]
}
```
</details>
## Issues
## Stack
1. uber#343
1. uber#344
1. uber#345
1. @ uber#346
Summary
Route synchronous, queued, and DLQ request-log writes through the shared materializer so authoritative and queue projections converge with retained history.
Preserve the original DLQ failure reason as the terminal request last error.
Test Plan
✅
make fmt && make build && make test && make e2e-testIssues
Stack