hydra-gates/scripts/lib/generate_mock_register.py generates a mock object for
every schema it finds. It has no notion of "this schema is a catalogue the app
seeds itself", so for any app that ships seed rows in register.d and ships
demo data, installing demo data duplicates the catalogue.
Measured on dossiq
register.d/96-integrations.json seeds twelve dossiqIntegration rows with
stable slugs. The generator emitted three more:
| key |
seeded slug |
generated slug |
| zgw |
integration-zgw |
dossiqintegration-dossiqintegration-1-1 |
| stuf |
integration-stuf |
dossiqintegration-dossiqintegration-2-2 |
| brp |
integration-brp |
dossiqintegration-dossiqintegration-3-3 |
ImportHandler upserts a seed object on (register, schema, slug), so the two
spellings never collapse. An instance with demo data installed shows two BRP
rows and two ZGW rows.
Why it costs more than a duplicate row
It presents as a product defect somewhere else entirely. On dossiq it broke two
E2E tests, and neither pointed here:
- a Playwright strict-mode violation, two rows matching
/BRP/i
status: error for StUF, from a generated row asserting Circuit open on Gemeente Zuid — a connection failure nobody measured, invented by the
generator to fill a status field
That second one is the part worth fixing upstream rather than per app. A
generator that fills an enum by picking a value will eventually pick the one that
means "something is broken", and a demo instance then reports an outage that does
not exist.
Suggested shape
An opt-out the app can declare, so the exclusion lives next to the seed that
causes it. Either:
- a marker on the schema (
x-hydra-mock: false, or reuse an existing annotation), or
- a generator input listing schemas to skip, defaulted from the schemas that
register.d already seeds objects for, which the generator can see.
The second needs no per-app change at all: if a schema has seed objects in
register.d, the app has said what its rows are, and inventing more is never
right.
Worked around for now
dossiq#2304 removes the three rows and adds a mutation-checked guard test, so a
regeneration that puts them back fails loudly. That guard is per app, which is
why this is filed here.
hydra-gates/scripts/lib/generate_mock_register.pygenerates a mock object forevery schema it finds. It has no notion of "this schema is a catalogue the app
seeds itself", so for any app that ships seed rows in
register.dand shipsdemo data, installing demo data duplicates the catalogue.
Measured on dossiq
register.d/96-integrations.jsonseeds twelvedossiqIntegrationrows withstable slugs. The generator emitted three more:
integration-zgwdossiqintegration-dossiqintegration-1-1integration-stufdossiqintegration-dossiqintegration-2-2integration-brpdossiqintegration-dossiqintegration-3-3ImportHandlerupserts a seed object on (register, schema, slug), so the twospellings never collapse. An instance with demo data installed shows two BRP
rows and two ZGW rows.
Why it costs more than a duplicate row
It presents as a product defect somewhere else entirely. On dossiq it broke two
E2E tests, and neither pointed here:
/BRP/istatus: errorfor StUF, from a generated row assertingCircuit open on Gemeente Zuid— a connection failure nobody measured, invented by thegenerator to fill a status field
That second one is the part worth fixing upstream rather than per app. A
generator that fills an enum by picking a value will eventually pick the one that
means "something is broken", and a demo instance then reports an outage that does
not exist.
Suggested shape
An opt-out the app can declare, so the exclusion lives next to the seed that
causes it. Either:
x-hydra-mock: false, or reuse an existing annotation), orregister.dalready seeds objects for, which the generator can see.The second needs no per-app change at all: if a schema has seed objects in
register.d, the app has said what its rows are, and inventing more is neverright.
Worked around for now
dossiq#2304 removes the three rows and adds a mutation-checked guard test, so a
regeneration that puts them back fails loudly. That guard is per app, which is
why this is filed here.