Skip to content

[2/N] [List API] feat(context): add immutable request admission store#302

Open
albertywu wants to merge 1 commit into
wua/list-api-rfc-designfrom
wua/list-api-request-log
Open

[2/N] [List API] feat(context): add immutable request admission store#302
albertywu wants to merge 1 commit into
wua/list-api-rfc-designfrom
wua/list-api-request-log

Conversation

@albertywu

@albertywu albertywu commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 queue and change_uri columns to the request_log MySQL schema and persist/load them in the MySQL request-log store.
  • Extend entity.RequestLog serialization with Queue and ChangeURIs, 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.

Comment thread submitqueue/extension/storage/mysql/request_log_store.go Outdated
Comment thread submitqueue/extension/storage/mysql/request_log_store_test.go Outdated
Comment thread submitqueue/extension/storage/mysql/schema/request_log.sql
@albertywu albertywu force-pushed the wua/list-api-request-log branch from e8b3462 to e60d532 Compare July 7, 2026 00:22
Copilot AI review requested due to automatic review settings July 7, 2026 00:40
@albertywu albertywu force-pushed the wua/list-api-request-log branch from e60d532 to 4255521 Compare July 7, 2026 00:40

Copilot AI left a comment

Copy link
Copy Markdown

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 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.Metadata is documented as an “empty map if no metadata”, but Insert will marshal a nil map as JSON null, which then round-trips back to a nil map on List. Normalize log.Metadata to an empty map before marshaling so DB rows and readers preserve the non-nil invariant used by RequestLogFromBytes.
	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)
	}

Comment thread submitqueue/extension/storage/mysql/request_log_store.go
@albertywu albertywu force-pushed the wua/list-api-request-log branch from 4255521 to bf69e42 Compare July 7, 2026 00:46
@albertywu albertywu marked this pull request as ready for review July 7, 2026 01:42
Copilot AI review requested due to automatic review settings July 7, 2026 01:42
@albertywu albertywu requested review from a team, behinddwalls and sbalabanov as code owners July 7, 2026 01:42

Copilot AI left a comment

Copy link
Copy Markdown

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 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread submitqueue/extension/storage/mysql/request_log_store.go
Comment thread submitqueue/entity/request_log.go Outdated
Comment thread submitqueue/entity/request_log.go Outdated
@albertywu albertywu changed the title feat(requestlog): persist queue and change metadata [1/N] [List API] feat(requestlog): persist queue and change metadata Jul 7, 2026
Comment thread submitqueue/entity/request_log.go Outdated
Comment thread submitqueue/entity/request_log.go Outdated
Comment thread submitqueue/extension/storage/mysql/request_log_store.go Outdated
Comment thread submitqueue/extension/storage/mysql/request_log_store.go Outdated
@albertywu albertywu force-pushed the wua/list-api-request-log branch from 5fb143c to bf22c1a Compare July 7, 2026 22:29
Copilot AI review requested due to automatic review settings July 7, 2026 22:29
@albertywu albertywu changed the base branch from main to wua/list-api-rfc-design July 7, 2026 22:29
@albertywu albertywu requested a review from behinddwalls July 7, 2026 22:29
@albertywu albertywu requested a review from sbalabanov July 7, 2026 22:29
@albertywu albertywu changed the title [1/N] [List API] feat(requestlog): persist queue and change metadata [2/N] [List API] feat(context): add immutable request admission store Jul 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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

Comment thread submitqueue/extension/storage/request_context_store.go Outdated
Comment thread submitqueue/extension/storage/mysql/request_context_store.go Outdated
@albertywu albertywu force-pushed the wua/list-api-rfc-design branch from 7cd8e9a to ec3d5ec Compare July 7, 2026 22:40
@albertywu albertywu force-pushed the wua/list-api-request-log branch 2 times, most recently from 78d7442 to 914b217 Compare July 8, 2026 00:15
@albertywu albertywu force-pushed the wua/list-api-rfc-design branch from ec3d5ec to 45a3b43 Compare July 8, 2026 00:15
@albertywu albertywu force-pushed the wua/list-api-request-log branch from 914b217 to 05fe3cc Compare July 8, 2026 00:18
@albertywu albertywu force-pushed the wua/list-api-rfc-design branch from 45a3b43 to 476f776 Compare July 8, 2026 00:19
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.

4 participants