Skip to content

Fix model JSON generation for combined XMI (TEDM2O-13)#296

Merged
gkostkowski merged 3 commits intodevelopfrom
feature/M2O3-209
Feb 3, 2026
Merged

Fix model JSON generation for combined XMI (TEDM2O-13)#296
gkostkowski merged 3 commits intodevelopfrom
feature/M2O3-209

Conversation

@gkostkowski
Copy link
Copy Markdown
Contributor

Summary

  • Added bash options to multiline recipes to fail fast on error
  • Fixed XPath in JSON generation that was breaking for combined XMI
  • Added a new test and test data for the merged XMI case
  • Updated other XPath occurrences to handle the combined XMI case
  • Attribute range label resolution now accounts for references to elements that may not be defined in the XMI

Scope of changes:
* Added bash options to multiline recipes to fail fast on error
* Fixed XPath in JSON generation that was breaking for combined XMI
* Added a new test and test data for the merged XMI case
* Updated other XPath occurrences to handle the combined XMI case
* Attribute range label resolution now accounts for references to elements that may not be defined in the XMI
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes XPath expressions in JSON generation that were breaking when processing combined XMI files that merge multiple modules. When elements from different modules are combined into a single XMI file, duplicate element definitions can exist, causing XPath queries to return multiple results instead of a single element.

Changes:

  • Added set -eo pipefail to Makefile recipes to enable fast-fail on errors in bash commands
  • Fixed XPath queries to select only the first element when duplicates exist in combined XMI files using the [1] predicate
  • Enhanced attribute/association range label resolution to gracefully handle references to elements that may not be defined in the XMI

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Makefile Added bash error handling (set -eo pipefail) to generate-respec and generate-asciidoc-glossary targets to ensure scripts fail fast on errors
src/rspec/rspec-generation.xsl Fixed XPath queries in three locations to handle combined XMI by selecting first element with [1] predicate and added null checks for undefined element references
test/unitTests/test-rspec/test-rspec-generation.xspec Added test scenario for combined XMI covering two modules to verify correct label resolution across module boundaries

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gkostkowski gkostkowski marked this pull request as ready for review January 30, 2026 12:20
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@gkostkowski gkostkowski requested a review from costezki January 30, 2026 12:20
@gkostkowski gkostkowski changed the title Fix model JSON generation for combined XMI Fix model JSON generation for combined XMI (TEDM2O-13) Jan 30, 2026
Copy link
Copy Markdown
Collaborator

@costezki costezki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. Thank you.

@gkostkowski gkostkowski merged commit 1f584d3 into develop Feb 3, 2026
2 checks passed
@gkostkowski gkostkowski deleted the feature/M2O3-209 branch February 3, 2026 09:48
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.

3 participants