Skip to content

fix(traceability_matrix): skip included documents when listing nodes - #3255

Merged
stanislaw merged 1 commit into
strictdoc-project:mainfrom
cristianchiriac:fix-traceability-matrix-document-from-file
Oct 22, 2026
Merged

stanislaw merged 1 commit into
strictdoc-project:mainfrom
cristianchiriac:fix-traceability-matrix-document-from-file

Conversation

@cristianchiriac

Copy link
Copy Markdown
Contributor

Closes #3237.

With print_fragments=True, DocumentIterator.all_content() also yields the SDocDocument included through [DOCUMENT_FROM_FILE]. main.jinja in the traceability matrix calls is_normative_node() on every yielded item, and SDocDocument does not have that method, so the export failed with 'SDocDocument object' has no attribute 'is_normative_node' whenever TRACEABILITY_MATRIX_SCREEN was enabled in a project with included documents.

The template now checks is_document_node() first and skips included documents. The nodes inside them are still yielded by the iterator and listed in the matrix.

Test: the new integration test traceability_matrix/30__document_from_file has a document that includes another one with [DOCUMENT_FROM_FILE], with the matrix screen enabled. On main the export fails with the error above. With this change the export completes and the matrix lists both REQ-001 and REQ-002. All tests under tests/integration/features/traceability_matrix and tests/integration/features/document_fragments pass locally (17/17).

With print_fragments=True, the document iterator also yields the
SDocDocument that a [DOCUMENT_FROM_FILE] includes. The template called
is_normative_node() on it, and SDocDocument has no such method, so the
export failed when TRACEABILITY_MATRIX_SCREEN was enabled.

Closes #3237.
awschult002 added a commit to awschult002/strictdoc that referenced this pull request Oct 22, 2026
@stanislaw
stanislaw merged commit 41e786f into strictdoc-project:main Oct 22, 2026
46 of 54 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.

Bug: TRACEABILITY_MATRIX_SCREEN does not work with [DOCUMENT_FROM_FILE] anymore

2 participants