feat(gateway): add Status RPC to look up request status by sqid#164
Merged
Conversation
There was a problem hiding this comment.
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
GetRequestStatusControllerwith 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.
50c0830 to
bddbe79
Compare
There was a problem hiding this comment.
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
behinddwalls
approved these changes
May 29, 2026
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>
bddbe79 to
05c63ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
StatusRPC to the gateway that returns the current status of a previously submitted request, reconciled from the append-only request log viacore/request.GetCurrentStateFromRequestLog.Decision was made to name this
Statusinstead of something likeGetRequestStatusto abide by pre-existing naming patterns in this repo (prefers short names likeLand,Ping, etc).Test Plan
✅
make test && make fmt && make lint✅ Integration tests w/
make local-gateway-startIssues
Stack