Repository navigation
Conversation
The ReqIF to SDoc converter looked up the parent's ReqIF.ForeignID with the child's attribute definition ref. Each grammar element gets its own spec object type, so when the parent is another node type (for example a REQUIREMENT tracing to a NEED) the lookup raised a KeyError and the import failed. Look up the ForeignID definition in the parent's own spec object type instead. Closes #3192
stanislaw
approved these changes
Oct 18, 2026
stanislaw
left a comment
Collaborator
There was a problem hiding this comment.
Thank you! One CI job has failed due to an unrelated flaky test which I am going to fix separately.
stanislaw
force-pushed
the
fix-reqif-parent-foreign-id
branch
from
October 18, 2026 15:15
b3bcafb to
c7b1e08
Compare
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.
Closes #3192.
When the converter imports a node with Parent relations,
create_requirement_from_spec_object()keeps the definition ref of the child'sReqIF.ForeignIDattribute and then reads the parent's UID with that same ref. Each grammar element is exported as its own spec object type, so the ref is different when the parent is another node type, for example a REQUIREMENT that traces to a NEED. The lookup then raisedKeyError: 'REQUIREMENT_<id>_ReqIF.ForeignID'and the import of a file StrictDoc had just exported failed.The converter now looks up the parent's spec object type and uses its own
ReqIF.ForeignIDdefinition to read the parent UID.Test: the new integration test
reqif/profiles/p01_sdoc/end_to_end/71_relations_between_node_typesuses the grammar from the issue (a NEED and a REQUIREMENT with a Parent relation, role Traces). It exports the document to ReqIF, validates it, converts it back and compares the result with the input. Onmainthe convert step fails with theKeyError; with this change the round trip gives back the same document. All 35 tests undertests/integration/features/reqifpass locally, andruff check/ruff format --checkare clean on the changed file.