first working template

This commit is contained in:
paul committed 2026-09-18 08:56:37 +12:00
1 parent 62a3714562
commit ca6bea351a
21 files changed
+684 -31

No files matched your search

+28 -10
View File
@@ -108,9 +108,24 @@ which stay optional on the inbound topic. Enum properties list the values verbat
**Credentials.** `flink/job.sql` connects to `ods:5432/ods` as `postgres` with password
`${ODS_PASSWORD}`, exactly as the template shows. Never write a real credential into a product.
**Seed.** Write `ods/040_seed.sql` unless told not to: two or three rows per table with fixed
uuids, parents first, subtype rows matching their parent's discriminator, values that satisfy
every CHECK. The seed is what makes the GraphQL and Trino smoke tests show data.
**Seed.** Always write `ods/040_seed.sql`: two or three rows per table with fixed uuids,
parents first, subtype rows matching their parent's discriminator, values that satisfy every
CHECK. The unit tests are written against it.
**Unit tests.** Copy `tests/test_*.py` from the template unchanged, and write
`tests/expectations.yaml` from the seed and the DDL:
- **Rows and samples:** each table's seed row count, and one sample row with every column the
seed sets. Quote values YAML would retype, such as postcodes and registration numbers.
- **Rejects:** one update per enum column, `CHECK` constraint, foreign key, unique column and
`NOT NULL` column, naming the constraint as PostgreSQL reports it. That is
`<table>_<column>_check` for an inline enum, the constraint's own name for a named one,
`<table>_<column>_fkey` or the FK's declared name, `<table>_<column>_key` for `UNIQUE`, and
`not-null`. Target the first sample, and pick values that break only the constraint under
test (for a foreign key, a uuid no parent has).
- **GraphQL:** one query per relationship field in `schema.graphql`, with an `orderBy` on nested
collections and the seed values it must return.
- **Round trip:** a valid record for a table without required foreign keys, with a key no seed
row uses, and a one-column text update.
**ODPS.** `class` maps to `type` (domain-aligned is `dataset`), `status` `Active` to
`production`, `availability` `"99.95%"` to `99.95`, `refresh: real-time` to a freshness of
@@ -128,23 +143,26 @@ product brings the domain near the limit.
2. Derive the table list and order, then the column list per table. Write every file in
`products/<slug>/` in the domain repository in one pass. Every template file has a
counterpart; nothing else is added.
3. Self-check before touching the platform: no `{{` and no `>>>` anywhere in the product;
3. Self-check before touching the platform: no `{{` and no `>>>` anywhere in the product
(including `tests/expectations.yaml`);
each table in `product.yaml` has an inbound and an outbound topic and a schema file; the
column lists agree across DDL, JSON Schema and Flink; `smoke.graphql` and `smoke.sql`
cover every table; parents precede children everywhere.
4. From the domain repository, deploy with `uv run data-domain deploy products/<slug>`. Deploy
expects a clean slate, so on any failure run `uv run data-domain undeploy products/<slug>
--yes`, fix, and deploy again.
5. Run `uv run data-domain test products/<slug>`.
6. Verify what `test` does not: introspect the endpoint with curl for one subtype and one
association table and confirm the relationship field names match `schema.graphql`; confirm
the Trino counts equal the seed row counts.
5. Run `uv run data-domain test products/<slug>`, then `uv run data-domain unit
products/<slug>`. A failing unit test is a defect in the product or its expectations; fix
whichever is wrong, and never weaken an expectation to match a product that disagrees with
the model.
6. If the domain is registered with the management zone, run `uv run data-domain register
products/<slug>` and confirm the data product appears under the domain.
7. Leave the product deployed and report.
## Report
Lead with the deploy and test outcome, including anything skipped or failed, with the CLI
output for failures. Then the versions generated from (model version and commit, template
Lead with the deploy, test, unit test and registration outcome, including anything skipped
or failed, with the CLI output for failures. Then the versions generated from (model version and commit, template
commit), and a short generation summary: entity to table mapping, the relationships left
outside the boundary, the assumptions (the ODS is current state and declared bitemporal
tracking is served by the outbound topics and the lake; discriminator values; typed