[2/N] [List API] feat(context): add immutable request admission store#302
[2/N] [List API] feat(context): add immutable request admission store#302albertywu wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends SubmitQueue’s append-only request log so each log row persists immutable queue and change metadata, enabling future queue-scoped read models while keeping backward-compatible fallbacks via the existing request ID format.
Changes:
- Add
queueandchange_uricolumns to therequest_logMySQL schema and persist/load them in the MySQL request-log store. - Extend
entity.RequestLogserialization withQueueandChangeURIs, including defaulting/back-compat behavior on deserialize. - Add helper functions for extracting queue from request ID (
QueueFromRequestID) and validating known request statuses (IsKnownRequestStatus), plus a small MySQL store unit test and Bazel test target.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| submitqueue/extension/storage/mysql/schema/request_log.sql | Adds queue + change metadata columns to the request_log table schema. |
| submitqueue/extension/storage/mysql/request_log_store.go | Serializes/deserializes new fields and validates queue presence on insert. |
| submitqueue/extension/storage/mysql/request_log_store_test.go | Adds a unit test for rejecting inserts when queue can’t be derived. |
| submitqueue/extension/storage/mysql/BUILD.bazel | Adds a go_test target for the new MySQL unit test. |
| submitqueue/entity/request_log.go | Adds new RequestLog fields, defaults/back-compat, and new helper functions. |
| submitqueue/entity/request_log_test.go | Updates serialization tests and adds coverage for QueueFromRequestID. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e8b3462 to
e60d532
Compare
e60d532 to
4255521
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
submitqueue/extension/storage/mysql/request_log_store.go:67
RequestLog.Metadatais documented as an “empty map if no metadata”, butInsertwill marshal a nil map as JSONnull, which then round-trips back to a nil map onList. Normalizelog.Metadatato an empty map before marshaling so DB rows and readers preserve the non-nil invariant used byRequestLogFromBytes.
metadataJSON, err := json.Marshal(log.Metadata)
if err != nil {
return fmt.Errorf("failed to marshal metadata for request log request_id=%s: %w", log.RequestID, err)
}
4255521 to
bf69e42
Compare
bf69e42 to
5fb143c
Compare
5fb143c to
bf22c1a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
Files not reviewed (2)
- submitqueue/extension/storage/mock/request_context_store_mock.go: Generated file
- submitqueue/extension/storage/mock/storage_mock.go: Generated file
7cd8e9a to
ec3d5ec
Compare
78d7442 to
914b217
Compare
ec3d5ec to
45a3b43
Compare
914b217 to
05fe3cc
Compare
45a3b43 to
476f776
Compare
Summary
Adds immutable request context when request is admitted.
Test Plan
✅
make fmt && make build && make test && make check-mocks && make e2e-testStack