-
Notifications
You must be signed in to change notification settings - Fork 37
feat(backend/sdoc_source_code): Support merge by MID #2549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
stanislaw
merged 1 commit into
strictdoc-project:main
from
haxtibal:tdmg/source_node_mid
Nov 16, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions
30
...tures/source_code_traceability/_source_nodes/30_merge_with_sdoc_by_default_uid/test.itest
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # | ||
| # This test verifies that a source nodes is merged with a static SDoc node if | ||
| # - the source nodes is not marked up with a UID field (i.e., default UID is effective), and | ||
| # - static SDoc node was explicitly given the default UID. | ||
| # | ||
| # @relation(SDOC-SRS-141, scope=file) | ||
| # | ||
|
|
||
| RUN: %strictdoc --debug export %S --output-dir %T | filecheck %s | ||
|
|
||
| CHECK: Published: Hello world doc | ||
|
|
||
| RUN: %check_exists --file "%T/html/_source_files/src/example.c.html" | ||
|
|
||
| RUN: %cat %T/html/%THIS_TEST_FOLDER/source_node_base.html | filecheck %s --check-prefix CHECK-HTML | ||
| CHECK-HTML: Requirements from Source Nodes | ||
| CHECK-HTML: SRC-NODES-BASE/src/example.c/example_1 | ||
| CHECK-HTML: TITLE from sdoc | ||
| CHECK-HTML: class="requirement__link-parent" href="../30_merge_with_sdoc_by_default_uid/parent.html#REQ-1" | ||
| CHECK-HTML: src/example.c, <i>lines: 3-14</i>, function example_1() | ||
| CHECK-HTML-NOT: FOO text from sdoc | ||
| CHECK-HTML: FOO text from example.c | ||
| CHECK-HTML-NOT: BAR text from sdoc | ||
| CHECK-HTML: BAR text from example.c | ||
|
|
||
| RUN: %cat %T/html/_source_files/src/example.c.html | filecheck %s --check-prefix CHECK-SOURCE-FILE | ||
| CHECK-SOURCE-FILE: SRC-NODES-BASE/src/example.c/example_1 | ||
|
|
||
| RUN: %cat %T/html/source_coverage.html | filecheck %s --check-prefix CHECK-SOURCE-COVERAGE | ||
| CHECK-SOURCE-COVERAGE: 100.0 |
24 changes: 0 additions & 24 deletions
24
...tion/features/source_code_traceability/_source_nodes/30_merge_with_static_node/test.itest
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
...ion/features/source_code_traceability/_source_nodes/31_merge_with_sdoc_by_uid/parent.sdoc
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| [DOCUMENT] | ||
| TITLE: Hello world doc | ||
|
|
||
| [REQUIREMENT] | ||
| UID: REQ-1 | ||
| TITLE: Requirement Title | ||
| STATEMENT: Requirement Statement | ||
|
|
||
| [REQUIREMENT] | ||
| UID: REQ-2 | ||
| TITLE: Requirement Title #2 | ||
| STATEMENT: Requirement Statement #2 | ||
|
|
||
| [REQUIREMENT] | ||
| UID: REQ-3 | ||
| TITLE: Requirement Title #3 | ||
| STATEMENT: Requirement Statement #3 |
72 changes: 72 additions & 0 deletions
72
...es/source_code_traceability/_source_nodes/31_merge_with_sdoc_by_uid/source_node_base.sdoc
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| [DOCUMENT] | ||
| MID: c2d4542d5f1741c88dfcb4f68ad7dcbd | ||
| TITLE: Requirements from Source Nodes | ||
| UID: SRC-NODES-BASE | ||
|
|
||
| [GRAMMAR] | ||
| ELEMENTS: | ||
| - TAG: SECTION | ||
| PROPERTIES: | ||
| IS_COMPOSITE: True | ||
| FIELDS: | ||
| - TITLE: UID | ||
| TYPE: String | ||
| REQUIRED: False | ||
| - TITLE: TITLE | ||
| TYPE: String | ||
| REQUIRED: True | ||
| - TAG: REQUIREMENT | ||
| PROPERTIES: | ||
| VIEW_STYLE: Narrative | ||
| FIELDS: | ||
| - TITLE: UID | ||
| TYPE: String | ||
| REQUIRED: False | ||
| - TITLE: MID | ||
| TYPE: String | ||
| REQUIRED: False | ||
| - TITLE: TITLE | ||
| TYPE: String | ||
| REQUIRED: False | ||
| - TITLE: FOO | ||
| TYPE: String | ||
| REQUIRED: False | ||
| - TITLE: BAR | ||
| TYPE: String | ||
| REQUIRED: False | ||
| RELATIONS: | ||
| - TYPE: Parent | ||
| - TYPE: File | ||
|
|
||
| [[SECTION]] | ||
| TITLE: Merge example.c into static nodes | ||
|
|
||
| [REQUIREMENT] | ||
| UID: REQ-SOURCE-1 | ||
| TITLE: TITLE1 from sdoc | ||
| FOO: FOO1 text from sdoc | ||
| BAR: BAR1 text from sdoc | ||
| RELATIONS: | ||
| - TYPE: Parent | ||
| VALUE: REQ-1 | ||
|
|
||
| [REQUIREMENT] | ||
| UID: REQ-SOURCE-2 | ||
| MID: 80cd685d-0e18-44b8-9842-c1863a2eb9ec | ||
| TITLE: TITLE2 from sdoc | ||
| FOO: FOO2 text from sdoc | ||
| BAR: BAR2 text from sdoc | ||
| RELATIONS: | ||
| - TYPE: Parent | ||
| VALUE: REQ-2 | ||
|
|
||
| [REQUIREMENT] | ||
| UID: REQ-SOURCE-3 | ||
| TITLE: TITLE3 from sdoc | ||
| FOO: FOO3 text from sdoc | ||
| BAR: BAR3 text from sdoc | ||
| RELATIONS: | ||
| - TYPE: Parent | ||
| VALUE: REQ-3 | ||
|
|
||
| [[/SECTION]] |
48 changes: 48 additions & 0 deletions
48
...n/features/source_code_traceability/_source_nodes/31_merge_with_sdoc_by_uid/src/example.c
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #include <stdio.h> | ||
|
|
||
| /** | ||
| * Some text. | ||
| * | ||
| * @relation(REQ-1, scope=function) | ||
| * | ||
| * UID: REQ-SOURCE-1 | ||
| * | ||
| * FOO: FOO1 text from example.c | ||
| * | ||
| * BAR: BAR1 text from example.c | ||
| */ | ||
| void example_1(void) { | ||
| print("hello world\n"); | ||
| } | ||
|
|
||
| /** | ||
| * Some text. | ||
| * | ||
| * @relation(REQ-2, scope=function) | ||
| * | ||
| * UID: REQ-SOURCE-2 | ||
| * | ||
| * FOO: FOO2 text from example.c | ||
| * | ||
| * BAR: BAR2 text from example.c | ||
| */ | ||
| void example_2(void) { | ||
| print("hello world\n"); | ||
| } | ||
|
|
||
| /** | ||
| * Some text. | ||
| * | ||
| * @relation(REQ-3, scope=function) | ||
| * | ||
| * UID: REQ-SOURCE-3 | ||
| * | ||
| * MID: 1973a567-a109-491d-b7f0-6bb22eafa6ab | ||
| * | ||
| * FOO: FOO3 text from example.c | ||
| * | ||
| * BAR: BAR3 text from example.c | ||
| */ | ||
| void example_3(void) { | ||
| print("hello world\n"); | ||
| } |
14 changes: 14 additions & 0 deletions
14
.../features/source_code_traceability/_source_nodes/31_merge_with_sdoc_by_uid/strictdoc.toml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| [project] | ||
|
|
||
| features = [ | ||
| "REQUIREMENT_TO_SOURCE_TRACEABILITY", | ||
| "SOURCE_FILE_LANGUAGE_PARSERS", | ||
| ] | ||
|
|
||
| source_nodes = [ | ||
| { "src/" = { uid = "SRC-NODES-BASE", node_type = "REQUIREMENT" } } | ||
| ] | ||
|
|
||
| exclude_source_paths = [ | ||
| "test.itest" | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.