Skip to content

hydra-gates: generate_mock_register.py --keep rewrites the whole mock register instead of adding objects #793

Description

@rubenvdlinde

What happens

hydra-gates/scripts/generate_mock_register.py <app> --keep is documented as preserving the existing mock register and adding demo objects for schemas that lack them. On 2026-09-26 four independent build lanes on learniq, integriq and openregister ran it to satisfy gate-101 (demo-data-coverage, ADR-111 rule 1) and every run rewrote the whole file: it reconstructs components from scratch, drops the components.schemas block the committed file still carries, reformats every line, and in one case downgraded info.version from 1.1.0 to 1.0.0. Observed diffs: 58,910 lines (learniq #908), 22,084 deletions (learniq #904), 22,080 lines (learniq #912), 11,459 to 4,940 lines (integriq #2183). Each lane caught it with git diff --stat before committing and fell back to calling _object_for() directly and splicing the new objects into components.objects.

Why it matters

Gate-101 only runs with a delta base (--base origin/development), so a lane first meets it in CI, reaches for the documented fix, and gets a diff that would break check:register in the same PR. The safe path is undocumented.

Ask

Either make --keep genuinely additive (read the existing file, add only the missing objects, leave schemas, info.version and formatting untouched), or rename it and document the _object_for() splice as the supported way to add demo data to an existing register. A unit test that runs --keep against a register with a components.schemas block and asserts a diff of only added objects would pin it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions