Skip to content

[6/N] feat(gateway): add queue request listing#345

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

[6/N] feat(gateway): add queue request listing#345
albertywu merged 1 commit into
mainfrom
wua/request-list-api

Conversation

@albertywu

@albertywu albertywu commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

@albertywu albertywu changed the title feat(gateway): add queue request listing [6/N] feat(gateway): add queue request listing 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-list-api branch from 8ec34b2 to 58b2eca 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-status-api branch from f98c415 to 55fa015 Compare July 15, 2026 04:06
@albertywu
albertywu force-pushed the wua/request-list-api branch from 58b2eca to df83074 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-list-api branch from df83074 to 7cee179 Compare July 15, 2026 04:31
@albertywu
albertywu force-pushed the wua/request-list-api branch from 7cee179 to c5bc7ac Compare July 15, 2026 17:19
@albertywu
albertywu force-pushed the wua/request-status-api branch 2 times, most recently from 824aeb2 to ec6fc6f Compare July 15, 2026 18:40
@albertywu
albertywu force-pushed the wua/request-list-api branch from c5bc7ac to aa17591 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-status-api branch from ec6fc6f to 904b8db Compare July 15, 2026 21:33
@albertywu
albertywu force-pushed the wua/request-list-api branch from aa17591 to d9792df Compare July 15, 2026 21:33
@behinddwalls
behinddwalls force-pushed the wua/request-status-api branch from 904b8db to 730a454 Compare July 15, 2026 21:43
@behinddwalls
behinddwalls force-pushed the wua/request-list-api branch from d9792df to 0ff103e Compare July 15, 2026 21:43
@behinddwalls
behinddwalls changed the base branch from wua/request-status-api to main July 15, 2026 21:50
@behinddwalls
behinddwalls force-pushed the wua/request-list-api branch from 0ff103e to cce7830 Compare July 15, 2026 21:50
@albertywu
albertywu enabled auto-merge July 15, 2026 21:51
@albertywu
albertywu added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit 853a931 Jul 15, 2026
15 of 27 checks passed
@behinddwalls
behinddwalls deleted the wua/request-list-api branch July 15, 2026 21:55
behinddwalls pushed a commit to roychying/submitqueue that referenced this pull request Jul 16, 2026
## Summary
feat(gateway): add request summary lookups

## 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