Skip to content

export: mint erwin-native ids ({UPPERCASE-GUID}+00000000) so real erwin imports - #64

Merged
dbose merged 1 commit into
mainfrom
fix-erwin-id-format
Nov 2, 2026
Merged

dbose merged 1 commit into
mainfrom
fix-erwin-id-format

Conversation

@dbose

@dbose dbose commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

The bug

Importing a Modelith-exported erwin XML into real erwin Data Modeler (10.10) hangs at "EAT is importing" and never loads. Root cause: the object ids Modelith mints for its own (non-erwin-origin) objects are the wrong shape.

  • Real erwin writes ids as an UPPERCASE brace GUID with a +8hex serial, e.g. {0007EEEF-A625-4777-B5CB-6BCF63932FF4}+00000000. Its import engine (EAT) validates this shape.
  • _guid() was emitting a lowercase SHA-1 brace GUID with no serial, e.g. {1754afad-b7e9-5df5-bfc7-2e763e0683d8}.

In a scoped-export file of a real GHG mart, 382 of 505 ids were malformed — the model root, all new entities + their attributes, every relationship, the subject area, and 71 *_Ref elements pointing at them. The 123 ids that would have loaded were the old erwin-origin objects keeping their preserved erwin_id.

(Both the format and the root cause were confirmed by inspecting a real erwin export and the exporter source.)

The fix

_guid() now emits {UPPERCASE-GUID}+00000000. Every minted id and every <..._Ref> flows from the same id maps, so one change fixes ids and refs consistently. A preserved erwin_id (a real erwin object, which already has this shape) is emitted verbatim — the normalisation only ever touches ids we mint.

  • Output stays XSD-valid and still round-trips through our own importer (it is case-insensitive on id joins).
  • No migration: a Modelith-native model's export ids are a pure function of the model on disk, so re-exporting an existing model picks up the fix — no need to recreate anything.

Tests

3 new guards (in addition to the existing 16): the minted model-root id is {UPPERCASE}+00000000; a fully-native model emits no lowercase and no suffix-less brace GUID; a preserved erwin_id is emitted unchanged. 612 passed, ruff clean.

Not the cause (noted, not fixed here)

Date/Boolean attributes export as Logical_Data_Type VARCHAR because those domains aren't defined in the XML — loses typing but does not block the import. Separate quality fix.

Caveat

Real erwin can't be driven in CI here. The fix is built to the {UPPERCASE-GUID}+00000000 format observed in a real erwin 10.10 export and is XSD-valid + round-trips; the actual EAT import is confirmable on the Windows box with the GHG mart.

…in imports

erwin's import engine (EAT) hangs on a Modelith-minted object id: it was a lowercase SHA-1
brace GUID with no serial, e.g. {1754afad-...}. Real erwin (10.10) writes ids as an UPPERCASE
brace GUID with a +8hex serial, e.g. {0007EEEF-A625-4777-B5CB-6BCF63932FF4}+00000000, and
validates that shape on import. A scoped-export file of a real mart had 382/505 ids malformed
(the model root, every new entity + its attributes, every relationship, the subject area, and
71 *_Ref elements) and the import hung at 'EAT is importing'; the 123 ids that loaded were the
old erwin-origin objects keeping their preserved erwin_id.

Fix _guid() to emit {UPPERCASE-GUID}+00000000. Every minted id and every <..._Ref> flows from
the same id maps, so one change fixes ids and refs consistently; a preserved erwin_id is still
emitted verbatim. Output stays XSD-valid and still round-trips through our own importer (it is
case-insensitive on id joins). Tests assert the uppercase+serial shape and fail on any lowercase
or suffix-less brace GUID. A Modelith-native model's export ids are a pure function of the model
on disk, so re-exporting an existing model picks up the fix with no migration.
@dbose
dbose merged commit 9980fd5 into main Nov 2, 2026
2 checks passed
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