Skip to content

feat(gateway): add Status RPC to look up request status by sqid#164

Merged
albertywu merged 1 commit into
mainfrom
wua/add-request-status-api
May 29, 2026
Merged

feat(gateway): add Status RPC to look up request status by sqid#164
albertywu merged 1 commit into
mainfrom
wua/add-request-status-api

Conversation

@albertywu
Copy link
Copy Markdown
Contributor

@albertywu albertywu commented May 29, 2026

Summary

Adds a Status RPC to the gateway that returns the current status of a previously submitted request, reconciled from the append-only request log via core/request.GetCurrentStateFromRequestLog.

Decision was made to name this Status instead of something like GetRequestStatus to abide by pre-existing naming patterns in this repo (prefers short names like Land, Ping, etc).

Test Plan

make test && make fmt && make lint
✅ Integration tests w/ make local-gateway-start

PORT=$(docker port submitqueue-gateway-service-1 8080 | head -1 | cut -d: -f2)

# method is registered
grpcurl -plaintext localhost:$PORT list uber.submitqueue.gateway.SubmitQueueGateway
  -> Land, Ping, Status

# seed a request
grpcurl -plaintext -d '{"queue":"test-queue","change":{"uris":["github:///pull/123/c3a4d5e6f7890123456789abcdef0123456789ab"]}}' \
  localhost:$PORT uber.submitqueue.gateway.SubmitQueueGateway/Land
  -> { "sqid": "test-queue/1" }

# happy path
grpcurl -plaintext -d '{"sqid":"test-queue/1"}' \
  localhost:$PORT uber.submitqueue.gateway.SubmitQueueGateway/Status
  -> { "status": "accepted" }

# unknown sqid
grpcurl -plaintext -d '{"sqid":"test-queue/999"}' \
  localhost:$PORT uber.submitqueue.gateway.SubmitQueueGateway/Status
  -> ERROR: request not found for sqid "test-queue/999"

# empty sqid
grpcurl -plaintext -d '{"sqid":""}' \
  localhost:$PORT uber.submitqueue.gateway.SubmitQueueGateway/Status
  -> ERROR: StatusController requires the request to have a sqid specified: invalid request

Issues

Stack

  1. @ feat(gateway): add Status RPC to look up request status by sqid #164
  2. build(proto): use prebuilt protoc toolchain instead of compiling from source #165

Copilot AI review requested due to automatic review settings May 29, 2026 03:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a read-only GetRequestStatus gateway RPC for looking up the reconciled customer-facing status of a submitted request by sqid.

Changes:

  • Adds proto API definitions and regenerated Go/YARPC/gRPC bindings.
  • Introduces GetRequestStatusController with validation, request-log reconciliation, metrics, and tests.
  • Wires the new controller into the example gateway server.

Reviewed changes

Copilot reviewed 5 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
gateway/proto/gateway.proto Defines request/response/error messages and the new RPC.
gateway/protopb/gateway.pb.go Regenerated protobuf types.
gateway/protopb/gateway_grpc.pb.go Regenerated gRPC client/server bindings.
gateway/protopb/gateway.pb.yarpc.go Regenerated YARPC bindings.
gateway/controller/get_request_status.go Adds controller logic for status lookup.
gateway/controller/get_request_status_test.go Adds happy-path and error-path tests.
gateway/controller/BUILD.bazel Adds new source, test, and dependencies.
example/server/gateway/main.go Registers and wires the new controller.
Files not reviewed (3)
  • gateway/protopb/gateway.pb.go: Language not supported
  • gateway/protopb/gateway.pb.yarpc.go: Language not supported
  • gateway/protopb/gateway_grpc.pb.go: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@albertywu albertywu force-pushed the wua/add-request-status-api branch from 50c0830 to bddbe79 Compare May 29, 2026 03:42
@albertywu albertywu changed the title feat(gateway): add GetRequestStatus RPC to look up request status by sqid feat(gateway): add Status RPC to look up request status by sqid May 29, 2026
@albertywu albertywu marked this pull request as ready for review May 29, 2026 04:30
Copilot AI review requested due to automatic review settings May 29, 2026 04:30
@albertywu albertywu requested review from a team, behinddwalls and sbalabanov as code owners May 29, 2026 04:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 8 changed files in this pull request and generated no new comments.

Files not reviewed (3)
  • gateway/protopb/gateway.pb.go: Language not supported
  • gateway/protopb/gateway.pb.yarpc.go: Language not supported
  • gateway/protopb/gateway_grpc.pb.go: Language not supported

Adds a read-only Status RPC to the gateway that returns the current
customer-friendly status of a previously submitted request, reconciled
from the append-only request log via
core/request.GetCurrentStateFromRequestLog. Status is a free-form string
(statuses can be added without breaking clients); unknown sqids map to a
typed RequestNotFoundError (user error) and empty sqids to ErrInvalidRequest.

Named "Status" to match the gateway's short RPC naming (Ping, Land, Status).

Changes:
- gateway/proto/gateway.proto: Status RPC, StatusRequest/StatusResponse, and
  RequestNotFoundError messages (regenerated protopb)
- gateway/controller/status.go: StatusController + tests
- example/server/gateway/main.go: wire controller (reuses existing RequestLogStore)

Validation:
- Unit tests: bazel test //gateway/controller:controller_test  (PASS)
- Integration (local stack): make local-gateway-start
  PORT=$(docker port submitqueue-gateway-service-1 8080 | head -1 | cut -d: -f2)

  # method is registered
  grpcurl -plaintext localhost:$PORT list uber.submitqueue.gateway.SubmitQueueGateway
    -> Land, Ping, Status

  # seed a request
  grpcurl -plaintext -d '{"queue":"test-queue","change":{"uris":["github:///pull/123/c3a4d5e6f7890123456789abcdef0123456789ab"]}}' \
    localhost:$PORT uber.submitqueue.gateway.SubmitQueueGateway/Land
    -> { "sqid": "test-queue/1" }

  # happy path
  grpcurl -plaintext -d '{"sqid":"test-queue/1"}' \
    localhost:$PORT uber.submitqueue.gateway.SubmitQueueGateway/Status
    -> { "status": "accepted" }

  # unknown sqid
  grpcurl -plaintext -d '{"sqid":"test-queue/999"}' \
    localhost:$PORT uber.submitqueue.gateway.SubmitQueueGateway/Status
    -> ERROR: request not found for sqid "test-queue/999"

  # empty sqid
  grpcurl -plaintext -d '{"sqid":""}' \
    localhost:$PORT uber.submitqueue.gateway.SubmitQueueGateway/Status
    -> ERROR: StatusController requires the request to have a sqid specified: invalid request

Co-authored-by: Cursor <cursoragent@cursor.com>
@albertywu albertywu force-pushed the wua/add-request-status-api branch from bddbe79 to 05c63ce Compare May 29, 2026 13:40
@albertywu albertywu added this pull request to the merge queue May 29, 2026
Merged via the queue into main with commit b2b44d9 May 29, 2026
13 checks passed
@github-actions github-actions Bot deleted the wua/add-request-status-api branch May 29, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants