Skip to content

Make metamodel regeneration reproducible #109

Description

@kervel

src/metamodel (linkml_meta) is generated by gen-rust from a linkml checkout, but nothing
recorded which generator revision produced the committed crate. That makes a regen
unreproducible and, worse, silently destructive: a regen from the wrong revision reverts whatever
the committed crate has that the generator no longer emits.

Not hypothetical. The per-key map merge strategy (option_map_overwrite, which keeps a
slot_usage override of annotations from dropping the inherited ones) was missing from the
generator branch that happened to be checked out; a regen would have replaced it with whole-map
overwrite_except_none and no test would have failed.

What was added

The criterion, corrected

The first version of this issue required the generator PRs to be merged before a regenerated
crate could land here. That was wrong, and it would have parked every regen behind an upstream
review queue. Naming the changes is enough: the stamp lists the PRs, and applying them on top of
linkml/main and running ./regen.sh reproduces the crate. A generator fix has to be
identifiable — pushed, with a PR open — not merged.

Status

Done, via #115: the metamodel is regenerated, --check is clean against the stamped revision, and
the stamp names linkml/linkml#3919 as the change needed to reproduce it.

The per-PR tracking issues stay open until they merge upstream and drop out of the stamp on a later
regen: #108 (now fixed here), #110, #111.

Two loose ends, neither worth its own issue: src/metamodel/Cargo.toml~ is a committed editor
backup, and --check needs a local linkml checkout so it cannot run in CI as-is.

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