refactor(storage): fold ChangeStore into storage, drop dead store#191
Merged
Conversation
This was referenced Jun 4, 2026
sbalabanov
requested changes
Jun 4, 2026
3a1a203 to
9af42e1
Compare
c61303e to
771be50
Compare
## Summary ### Why? Two "change"-related stores were in the wrong shape. `ChangeStore` — the real, used store that records per-URI claims for in-flight requests and backs `start`'s URI claiming and `validate`'s overlap detection — lived as its own top-level extension and was injected into controllers as a separate dependency, bypassing the `storage.Storage` aggregator that owns every other entity store. Meanwhile `ChangeProviderStore` (exposed via `Storage.GetChangeProviderStore()`, with a mysql impl, mock, and schema) was dead code: no controller ever called it, and its `entity.ChangeProvider` was orphaned alongside it. ### What? - Move `ChangeStore` into `package storage`: the interface, mysql impl, and `change.sql` schema now live under `extension/storage[/mysql]`, and `ChangeStore` is a first-class member of the `Storage` aggregator via `GetChangeStore()` — matching every other store. - `start` and `validate` controllers drop their separate `changeStore` constructor param and read `store.GetChangeStore()`; the example orchestrator no longer constructs/injects it separately. - Delete the dead `ChangeProviderStore` (interface, mysql, mock, schema), `GetChangeProviderStore()`, and the orphaned `entity/change_provider.go`. - Fold the standalone changestore integration suite into the shared `StorageContractSuite` (driven through `GetChangeStore()`); e2e drops the now-redundant changestore schema apply. ## Test Plan - ✅ `make build`, `make test` (start/validate controllers pass against the storage-package mock) - ✅ `make lint`, `make check-gazelle`, `make check-mocks`, `make check-tidy` (no drift; `go.mod` / `MODULE.bazel` unchanged) - ✅ `make integration-test` (storage mysql suite now exercises the change store via `GetChangeStore()`) - ✅ `make e2e-test` (full land→validate flow: URI claim + overlap detection, `change` table applied from the storage schema dir)
771be50 to
4526267
Compare
JamyDev
approved these changes
Jun 5, 2026
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
Why?
Two "change"-related stores were in the wrong shape.
ChangeStore— thereal, used store that records per-URI claims for in-flight requests and
backs
start's URI claiming andvalidate's overlap detection — livedas its own top-level extension and was injected into controllers as a
separate dependency, bypassing the
storage.Storageaggregator that ownsevery other entity store. Meanwhile
ChangeProviderStore(exposed viaStorage.GetChangeProviderStore(), with a mysql impl, mock, and schema)was dead code: no controller ever called it, and its
entity.ChangeProviderwas orphaned alongside it.
What?
ChangeStoreintopackage storage: the interface, mysql impl,and
change.sqlschema now live underextension/storage[/mysql], andChangeStoreis a first-class member of theStorageaggregator viaGetChangeStore()— matching every other store.startandvalidatecontrollers drop their separatechangeStoreconstructor param and read
store.GetChangeStore(); the exampleorchestrator no longer constructs/injects it separately.
ChangeProviderStore(interface, mysql, mock, schema),GetChangeProviderStore(), and the orphanedentity/change_provider.go.StorageContractSuite(driven throughGetChangeStore()); e2e drops thenow-redundant changestore schema apply.
Test Plan
make build,make test(start/validate controllers pass against thestorage-package mock)
make lint,make check-gazelle,make check-mocks,make check-tidy(no drift;
go.mod/MODULE.bazelunchanged)make integration-test(storage mysql suite now exercises the changestore via
GetChangeStore())make e2e-test(full land→validate flow: URI claim + overlap detection,changetable applied from the storage schema dir)Issues
Stack