fix: QEA to XMI export parity - #33
Draft
HassanAkbar wants to merge 7 commits into
Draft
Conversation
HassanAkbar
marked this pull request as draft
August 10, 2026 17:04
There was a problem hiding this comment.
Pull request overview
This PR tightens QEA → Sparx XMI export parity by aligning synthesized IDs, visibility handling, xref/$XREFPROP serialization, diagram geometry/path encoding, and emitting additional UML elements (nested classifiers, dependencies, signals, primitive types). It also adds a parity “ratchet” spec to prevent regressions against the checked-in EA reference exports.
Changes:
- Reworked synthesized ID allocation (LI/SL/OE/RT) and classifier walk/allocation order to better match EA’s counters and nesting conventions.
- Implemented/expanded Extension serialization: populated
<xrefs>via$XREFPROP, added<primitivetypes>, and improved diagram<elements>geometry/style/path output. - Added/expanded specs for parity, visibility/textual scopes, run-state operator handling, MDG registry discovery, and CLI export behavior.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/ea/transformers/qea_to_xmi/visibility_spec.rb | Adds coverage for textual scope values and Public suppression. |
| spec/ea/transformers/qea_to_xmi/transformer_spec.rb | Updates expectations for nested classifiers, visibility, synthesized IDs, signals, primitive hrefs, deps, and realizations. |
| spec/ea/transformers/qea_to_xmi/run_state_spec.rb | Updates expectations to keep multi-char operators verbatim. |
| spec/ea/transformers/qea_to_xmi/parity_spec.rb | New parity ratchet over example models + self-parse check. |
| spec/ea/transformers/qea_to_xmi/id_allocator_spec.rb | Refactors allocator specs to assert EA-derived ID shape/counters. |
| spec/ea/transformers/qea_to_xmi/extension_serializer_spec.rb | Adds expectations for xrefs, signals, primitivetypes, diagram element serialization. |
| spec/ea/transformers/qea_to_xmi/cardinality_spec.rb | Updates unlimited upper bound wire form to * and treats stored -1 as unlimited. |
| spec/ea/qea/models/ea_xref_spec.rb | Adds mapping coverage for Visibility/Behavior/Partition. |
| spec/ea/qea/models/ea_connector_spec.rb | Adds UK spelling realization coverage. |
| spec/ea/mdg/registry_from_paths_spec.rb | New tests for registry loading from files/dirs with graceful skipping. |
| spec/ea/cli/command/export_spec.rb | New CLI export specs for --mdg behavior (xmi-only). |
| lib/ea/transformers/qea_to_xmi/visibility.rb | Supports textual scopes with integer fallback. |
| lib/ea/transformers/qea_to_xmi/transformer.rb | Implements EA-like walk/nesting, bounds preallocation, dependency endpoint refs, signals, classifier ref resolution, realization filtering. |
| lib/ea/transformers/qea_to_xmi/run_state.rb | Emits run-state operator verbatim in OpaqueExpression bodies. |
| lib/ea/transformers/qea_to_xmi/primitive_types.rb | New helper to synthesize EA’s primitivetypes extension hierarchy + OMG href mapping. |
| lib/ea/transformers/qea_to_xmi/id_allocator.rb | Redesigns allocator to memoize by (owner,prefix,seed) with global vs per-owner counters and EA-like tail/width rules. |
| lib/ea/transformers/qea_to_xmi/extension_serializer.rb | Populates xrefs via $XREFPROP, adds primitivetypes section, improves diagram element serialization and Path separator handling. |
| lib/ea/transformers/qea_to_xmi/cardinality.rb | Switches unlimited wire form to * and expands unlimited token normalization. |
| lib/ea/transformers/qea_to_xmi.rb | Autoloads PrimitiveTypes. |
| lib/ea/qea/models/ea_xref.rb | Adds visibility/behavior/partition attributes for xref serialization. |
| lib/ea/qea/models/ea_object.rb | Centralizes transformer type mapping (adds Signal) and keeps enum stereotype override. |
| lib/ea/qea/models/ea_connector.rb | Treats both Realization/Realisation as realizations. |
| lib/ea/mdg/registry.rb | Adds from_paths and recursive directory expansion with safe skipping. |
| lib/ea/cli/command/mdg.rb | Uses Registry.from_paths for MDG discovery. |
| lib/ea/cli/command/export.rb | Threads optional MDG registry through xmi exporter only. |
| lib/ea/cli/app.rb | Adds --mdg CLI option (xmi only). |
| Gemfile | Temporarily pins xmi to a GitHub branch for unreleased features. |
| ea.gemspec | Loosens xmi dependency floor to support the temporary pin. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #32.
Makes our QEA→XMI export match EA's own output.
$XREFPROPmini-language.*for unlimited bounds, never-1.Depends on unreleased xmi features. Companion PR: lutaml/xmi#94.
CI notes, both temporary until xmi 0.7.0 ships:
>= 0.6.2for that resolution.~> 0.7.Known gaps, tracked for follow-up:
uml:PackageImportfor Package connectors.