Commit f2d12c4
feat(stovepipe): add storage extension with RequestStore + RequestURIStore (MySQL)
Add the stovepipe `storage` extension and its first backend, so the pipeline can persist validation requests and look them up. Mirrors the SubmitQueue storage conventions (factory `Storage` interface, `ErrNotFound`/`ErrAlreadyExists`/`ErrVersionMismatch` sentinels, metrics-wrapped MySQL ops, optimistic-locking CAS where version arithmetic stays in the caller).
Two stores, one per table:
- `RequestStore` (`request` table) — `Create` (ErrAlreadyExists on duplicate ID), `Get` by ID (ErrNotFound), and `Update`, a pure conditional write that takes the full `Request` plus `oldVersion`/`newVersion` and persists the mutable fields (uri, state) only if the stored version matches (ErrVersionMismatch otherwise).
- `RequestURIStore` (`request_uri` table) — the reverse index from a validated commit to its request, keyed by `(queue, uri)`: `Create` (ErrAlreadyExists on a duplicate `(queue, uri)` — the dedup signal backing the RFC's `(Queue, head URI)` key) and `GetIDByURI` (ErrNotFound). Kept a separate store because it is a separate table; the two are written independently so the contract stays satisfiable by key/value backends.
Includes the MySQL implementation, schema (`request.sql`, `request_uri.sql`), generated mocks, and a docker-compose integration test covering create/get/update-CAS/not-found/duplicate and the URI mapping (including dedup and per-queue isolation).1 parent bb65857 commit f2d12c4
18 files changed
Lines changed: 946 additions & 0 deletions
File tree
- stovepipe/extension/storage
- mock
- mysql
- schema
- test/integration/stovepipe/extension/storage/mysql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments