Skip to content

refactor(storage): fold ChangeStore into storage, drop dead store#191

Merged
behinddwalls merged 1 commit into
mainfrom
change-store
Jun 5, 2026
Merged

refactor(storage): fold ChangeStore into storage, drop dead store#191
behinddwalls merged 1 commit into
mainfrom
change-store

Conversation

@behinddwalls
Copy link
Copy Markdown
Collaborator

@behinddwalls behinddwalls commented Jun 4, 2026

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)

Issues

Stack

  1. @ refactor(storage): fold ChangeStore into storage, drop dead store #191
  2. refactor(change): persist typed change details from the change provider #195
  3. refactor(scorer): score batches over typed change details #196
  4. feat(extensions): fake implementations with error injection #197

Comment thread submitqueue/extension/storage/README.md Outdated
## 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)
@behinddwalls behinddwalls merged commit 7d18778 into main Jun 5, 2026
15 checks passed
@behinddwalls behinddwalls deleted the change-store branch June 5, 2026 04:59
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.

3 participants