8000 refactor(components): promote component store to database-agnostic dbstore package by andrzejfudro · Pull Request #1404 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content

refactor(components): promote component store to database-agnostic dbstore package - #1404

Merged
andrzejfudro merged 3 commits into
refactor/cms-storage-mutations-and-txfrom
refactor/promote-cms-store
Oct 29, 2026
Merged

andrzejfudro merged 3 commits into
refactor/cms-storage-mutations-and-txfrom
refactor/promote-cms-store

Conversation

@andrzejfudro
@andrzejfudro andrzejfudro commented Oct 23, 2026 •
Copy link
Copy Markdown
Collaborator

Summary

Promote pkg/components/store/spanner to the database-agnostic pkg/components/store/dbstore package (dbstore.Store / dbstore.New) now that all component queries, mutations, and transactions run through storage.Storage.

Key Changes

  • Promote dbstore Package (pkg/components/store/dbstore): Move pkg/components/store/spanner to pkg/components/store/dbstore, renaming SpannerStore / NewSpannerStore to Store / New while preserving Git rename similarity across all source and test files.
  • Update Callers & Docs (cmd/experiment_state_server, cmd/health_service, pkg/components/README.md): Point initCMS, HealthServiceLazySpannerWrapper.ComponentsProvider, Bazel targets, and package documentation at pkg/components/store/dbstore.

Assumptions

  • pkg/components/store/dbstore tests still exercise dbstore.Store against the Spanner emulator in this PR — making the dbstore test harness backend-neutral across Spanner and PostgreSQL is split into the follow-up test PR in this stack — dbstore_test remains Spanner-emulator-backed until that follow-up lands.

Verification

  • bazel test //pkg/components/... //cmd/experiment_state_server/... //cmd/health_service/... //internal/storage/... (Passed)
  • ./.githooks/pre-commit (Passed)

TAG=agy
CONV=5d43b8db-2f9c-4908-a311-376a2b7dfdf0

@andrzejfudro
andrzejfudro added this pull request to stack #1399 October 23, 2026 13:12
@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors and renames the production Cloud Spanner persistence driver package from spanner to dbstore (pkg/components/store/dbstore), renaming the SpannerStore struct to Store and updating all associated tests, build files, imports, and documentation. Feedback on these changes suggests updating an unimplemented error message in GetPlatformHealth to refer to Store instead of SpannerStore, and correcting a file path reference in the README.md to point to ownership_fence.go instead of fence.go.

Comment thread pkg/components/store/dbstore/dbstore.go Resolved
Comment thread pkg/components/README.md Resolved
…store package

Rename pkg/components/store/spanner to pkg/components/store/dbstore, rename
SpannerStore/NewSpannerStore to Store/New, and update experiment_state_server,
health_service, and component documentation to import the database-agnostic
dbstore package.

TAG=agy
CONV=5d43b8db-2f9c-4908-a311-376a2b7dfdf0
Comment thread pkg/components/store/dbstore/dbstore.go Resolved
Comment thread pkg/components/store/dbstore/dbstore.go Resolved
VLukiantsev
VLukiantsev previously approved these changes Oct 29, 2026
@VLukiantsev VLukiantsev left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM — clean mechanical rename that matches the description; Bazel targets and callers are updated consistently. Left two non-blocking nits about stale SpannerStore references in comments.

…omote-cms-store

# Conflicts:
#	cmd/experiment_state_server/main.go
Qualify store.Store in the dbstore compile-time assertion comment and
update remaining SpannerStore / spanner_store.go references across test
headers, store comments, and api/buf.yaml.

Comment link: #1404 (comment)
Comment link: #1404 (comment)

TAG=agy
CONV=5d43b8db-2f9c-4908-a311-376a2b7dfdf0
@andrzejfudro
andrzejfudro added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit a8cb3ec Oct 29, 2026
14 checks passed
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.

2 participants

0