refactor(controlplane): move the store-backed server out of internal/app

This commit is contained in:
sam committed 2026-10-25 22:49:27 +11:00
1 parent 81f379346e
commit 29a2a782c9
59 files changed
+154 -154

No files matched your search

+1 -1
View File
@@ -106,7 +106,7 @@ must fail on the relevant assertion before the fix.
- Keep tests fast and cheap to maintain. Test helpers and fixtures belong in
test/, never in production code solely for tests.
- For mirrored control-plane validators, extend the shared fixture at
internal/app/controlplane/testdata/dashboard-validators.json rather than
internal/infrastructure/controlplanestore/testdata/dashboard-validators.json rather than
duplicating accept/reject cases in UI-only tests.
- Use browser checks for rendered behavior. Matching a Vue file with a regex
does not verify what the user sees. Mocked API checks verify UI behavior, not
+2 -2
View File
@@ -6,11 +6,11 @@ import { parseGoDuration } from "../components/ui/duration-input/duration.ts";
* The server validates every replace, so this is not the only line of
* defence: it exists so Save can be refused before the round-trip and the
* operator sees the reason beside the field. The rules mirror the server's
* (internal/app/controlplane), and the same map is read by the store, the
* (internal/infrastructure/controlplanestore), and the same map is read by the store, the
* save bar and the pages' inline messages, so a rule is written once.
*
* A hand-written mirror drifts, which is why every rule here is pinned to the
* server's by internal/app/controlplane/testdata/dashboard-validators.json:
* server's by internal/infrastructure/controlplanestore/testdata/dashboard-validators.json:
* a Go test runs the server validators over that fixture and this file's
* tests run these validators over the same cases, so changing one side alone
* fails a test. Add a case to the fixture, not to one side only.
@@ -20,7 +20,7 @@ import {
* refused values the server accepted.
*
* This runs the real dashboard validators over
* internal/app/controlplane/testdata/dashboard-validators.json -- the same
* internal/infrastructure/controlplanestore/testdata/dashboard-validators.json -- the same
* fixture the Go test in that package runs the real server validators over.
* Either side changing its rule without the other fails a test here or there
* (archie-core-ui-dashboard-3).
@@ -35,7 +35,7 @@ interface ValidatorCase {
const fixture = JSON.parse(
readFileSync(
new URL(
"../../internal/app/controlplane/testdata/dashboard-validators.json",
"../../internal/infrastructure/controlplanestore/testdata/dashboard-validators.json",
import.meta.url,
),
"utf8",