Skip to content

[5/N] feat(gateway): add request summary lookups#344

Merged
albertywu merged 1 commit into
mainfrom
wua/request-status-api
Jul 15, 2026
Merged

[5/N] feat(gateway): add request summary lookups#344
albertywu merged 1 commit into
mainfrom
wua/request-status-api

Conversation

@albertywu

@albertywu albertywu commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

@albertywu albertywu changed the title feat(gateway): add request status lookups [5/N] feat(gateway): add request status lookups Jul 13, 2026
@albertywu
albertywu marked this pull request as ready for review July 13, 2026 23:23
@albertywu
albertywu requested review from a team, behinddwalls and sbalabanov as code owners July 13, 2026 23:23
@albertywu
albertywu force-pushed the wua/request-projection-activation branch from 3b2b897 to 82341f1 Compare July 15, 2026 02:51
@albertywu
albertywu force-pushed the wua/request-status-api branch from 19b9499 to f98c415 Compare July 15, 2026 02:51
@albertywu
albertywu marked this pull request as draft July 15, 2026 02:52
@albertywu
albertywu force-pushed the wua/request-projection-activation branch from 82341f1 to e280a79 Compare July 15, 2026 04:06
@albertywu
albertywu force-pushed the wua/request-status-api branch from f98c415 to 55fa015 Compare July 15, 2026 04:06
@albertywu
albertywu marked this pull request as ready for review July 15, 2026 04:14
@albertywu
albertywu force-pushed the wua/request-status-api branch from 55fa015 to f897f97 Compare July 15, 2026 04:31
@albertywu
albertywu force-pushed the wua/request-projection-activation branch from e280a79 to a9c8a02 Compare July 15, 2026 04:31
Comment thread api/submitqueue/gateway/proto/gateway.proto Outdated
Comment thread api/submitqueue/gateway/proto/gateway.proto Outdated
Comment thread submitqueue/gateway/controller/read_errors.go
Comment thread submitqueue/gateway/controller/status.go Outdated
Comment thread api/submitqueue/gateway/proto/gateway.proto Outdated
@albertywu
albertywu force-pushed the wua/request-projection-activation branch from a9c8a02 to 01706b3 Compare July 15, 2026 17:19
@albertywu
albertywu force-pushed the wua/request-status-api branch from f897f97 to 824aeb2 Compare July 15, 2026 17:19
@albertywu
albertywu requested a review from behinddwalls July 15, 2026 17:19
@albertywu albertywu changed the title [5/N] feat(gateway): add request status lookups [5/N] feat(gateway): add request summary lookups Jul 15, 2026
@albertywu
albertywu force-pushed the wua/request-status-api branch from 824aeb2 to ec6fc6f Compare July 15, 2026 18:40
@albertywu
albertywu force-pushed the wua/request-projection-activation branch from 01706b3 to 2deb9fe Compare July 15, 2026 18:40
roychying pushed a commit to roychying/submitqueue that referenced this pull request Jul 15, 2026
## 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
@albertywu
albertywu force-pushed the wua/request-projection-activation branch from 2deb9fe to c71e756 Compare July 15, 2026 21:33
@albertywu
albertywu force-pushed the wua/request-status-api branch from ec6fc6f to 904b8db Compare July 15, 2026 21:33
@behinddwalls
behinddwalls changed the base branch from wua/request-projection-activation to main July 15, 2026 21:43
@behinddwalls
behinddwalls force-pushed the wua/request-status-api branch from 904b8db to 730a454 Compare July 15, 2026 21:43
@albertywu
albertywu added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit 7b4e163 Jul 15, 2026
15 of 27 checks passed
@behinddwalls
behinddwalls deleted the wua/request-status-api branch July 15, 2026 21:50
behinddwalls pushed a commit to roychying/submitqueue that referenced this pull request Jul 16, 2026
## Summary
feat(gateway): add queue request listing

## Test Plan
✅ `make fmt && make build && make test && make e2e-test`

## Issues


## Stack
1. uber#343
1. uber#344
1. @ uber#345
1. uber#346
behinddwalls pushed a commit to roychying/submitqueue that referenced this pull request Jul 16, 2026
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants