Skip to content

feat(demo): generated demo data for every schema (ADR-111) - #353

Merged
rubenvdlinde merged 1 commit into
developmentfrom
feat/demo-data-adr-111
Aug 27, 2026
Merged

feat(demo): generated demo data for every schema (ADR-111)#353
rubenvdlinde merged 1 commit into
developmentfrom
feat/demo-data-adr-111

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Implements ADR-111 rules 1–2 (ConductionNL/hydra, merged). Enforcement is ConductionNL/.github#590.

Why

This app declares schemas and shipped no demo data, so it opened on an empty list. The person evaluating it had to author objects by hand — against a schema they don't know yet. Fleet-wide, 562 of 598 schemas were in that state.

🔴 Generated, not written

Every value is derived from the schema that will validate it: enum picks from the enum, pattern is satisfied, format drives the shape, minimum/maxLength are honoured, required is always populated.

Hand-written demo data is wrong in a way nobody sees until the demo — a status outside its own enum, a required field omitted — and it fails at import, in front of whoever asked for the demo.

Produced and validated by the single file gate-99 also runs: vendor/conduction/hydra-gates/scripts/lib/generate_mock_register.py. Regenerate with --keep to preserve any curated objects and top up only what is short.

🔴 It does not install itself

x-openregister.type: mock is imported on demand (ADR-111 rule 3). Sample data appearing on a production instance because somebody upgraded is a data-integrity incident, not a convenience.

occ openregister:descriptors:list --app=<app> --import=<register>

The setup-wizard step that offers this during first-run (ADR-111 rule 4) follows once OpenRegister's shared installer lands — deliberately not twenty-one copies of the same logic.

Verification

--check re-validates every object against its own schema with jsonschema, and reports zero findings.

Rolling this out across five apps found five defects in the generator, every one caught by that check — including a cross-product that paired every register with every schema in a file, and a validator bug that flagged nullable: true (OpenAPI) as invalid, which would have had someone "fix" data that was already correct.

🤖 Generated with Claude Code

This app declares schemas and shipped no demo data, so it opened on an empty
list: the person evaluating it had to author objects by hand against a schema
they did not know yet. Fleet-wide, 562 of 598 schemas were in that state.

🔴 GENERATED, NOT WRITTEN. Every value is derived from the schema that will
validate it — `enum` picks from the enum, `pattern` is satisfied, `format`
drives the shape, `minimum`/`maxLength` are honoured, `required` is always
populated. Hand-written demo data is wrong in a way nobody sees until the demo
(a status outside its own enum, a required field omitted) and it fails at
import, in front of whoever asked for the demo.

Produced and validated by the single copy that gate-99 also runs:
`vendor/conduction/hydra-gates/scripts/lib/generate_mock_register.py`.
Regenerate with that file; `--keep` preserves curated objects and tops up only
what is short.

🔴 IT DOES NOT INSTALL ITSELF (ADR-111 rule 3). `x-openregister.type: mock` is
imported ON DEMAND — sample data appearing on a production instance because
somebody upgraded is a data-integrity incident, not a convenience. Install it
with:

    occ openregister:descriptors:list --app=<app> --import=<register>

The setup-wizard step that offers this during first-run install (ADR-111 rule 4)
follows once OpenRegister's shared installer lands — deliberately not twenty-one
copies of the same logic.

Verified: `--check` re-validates every object against its own schema with
jsonschema and reports clean.
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/launchpad @ d05daa3

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
build
check-manifest
format
check-schema-l10n
composer ✅ 104/104
npm ✅ 538/538
app:check-code ⏭️
info.xml
REUSE
PHPUnit
Newman
Playwright
Hydra gates

Quality workflow — 2026-08-27 14:55 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde
rubenvdlinde merged commit 18cd2ff into development Aug 27, 2026
75 checks passed
@rubenvdlinde
rubenvdlinde deleted the feat/demo-data-adr-111 branch August 27, 2026 15:05
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.

1 participant