From 4770a658599a783e63d07bcbf053526bee493003 Mon Sep 17 00:00:00 2001 From: Anton Krivoborodov Date: Thu, 17 Sep 2026 14:44:40 +0000 Subject: [PATCH 1/3] feat: add optional 'maturity' attribute to comp need type Adds an optional 'maturity' option (preview/experimental/release) to the 'comp' need type in metamodel.yaml, plus regression tests covering valid and invalid values. --- src/extensions/score_metamodel/metamodel.yaml | 2 ++ .../tests/rst/options/test_options_options.rst | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/extensions/score_metamodel/metamodel.yaml b/src/extensions/score_metamodel/metamodel.yaml index ed60080bc..bb28d4647 100644 --- a/src/extensions/score_metamodel/metamodel.yaml +++ b/src/extensions/score_metamodel/metamodel.yaml @@ -582,6 +582,8 @@ needs_types: safety: ^(QM|ASIL_B)$ # req-Id: tool_req__docs_common_attr_status status: ^(valid|invalid)$ + optional_options: + maturity: ^(preview|experimental|release)$ mandatory_links: belongs_to: feat # preparation for linking change according to DR-005 optional_links: diff --git a/src/extensions/score_metamodel/tests/rst/options/test_options_options.rst b/src/extensions/score_metamodel/tests/rst/options/test_options_options.rst index db5faf001..25ee6f142 100644 --- a/src/extensions/score_metamodel/tests/rst/options/test_options_options.rst +++ b/src/extensions/score_metamodel/tests/rst/options/test_options_options.rst @@ -78,6 +78,22 @@ +.. Test if the optional `maturity` option for `comp` follows the pattern `^(preview|experimental|release)$` + +.. comp:: Test Component Maturity Bad + :id: comp__test_options__maturity_bad + :maturity: stable + :expect: comp__test_options__maturity_bad.maturity (stable): does not follow pattern `^(preview|experimental|release)$`. + + + +.. comp:: Test Component Maturity Good + :id: comp__test_options__maturity_good + :maturity: preview + :expect_not: does not follow pattern + + + .. feat_saf_fmea:: This is a test :id: feat_saf_fmea__test_options__3 :sufficient: no From d563fc51394357a1df61a71c3af8d68653b9976d Mon Sep 17 00:00:00 2001 From: Anton Krivoborodov Date: Fri, 18 Sep 2026 07:02:39 +0000 Subject: [PATCH 2/3] test: update expected needs.json fixtures for new 'maturity' field The optional 'maturity' attribute added to the 'comp' need type introduces a new field in the generated sphinx-needs schema. Update the checked-in golden needs.json/needs_local.json files accordingly. --- .../scenarios/basic_docs/_expected/needs_json/needs.json | 9 +++++++++ .../_expected/data_bundle_needs/needs.json | 9 +++++++++ .../_expected/isolated_source_bundle_needs/needs.json | 9 +++++++++ .../data_files_runfiles/_expected/needs_json/needs.json | 9 +++++++++ .../nested_bundles/_expected/needs_json/needs.json | 9 +++++++++ .../reference_integration/_expected/needs_local.json | 9 +++++++++ .../legacy_module/_expected/needs_json/needs.json | 9 +++++++++ .../docs/components/component/_expected/needs_local.json | 9 +++++++++ .../modern_module/_expected/needs_json/needs.json | 9 +++++++++ .../unlinked_component/_expected/needs_local.json | 9 +++++++++ .../score_platform/_expected/needs_json/needs.json | 9 +++++++++ .../consumer/_expected/needs_json/needs.json | 9 +++++++++ .../producer/_expected/needs_json/needs.json | 9 +++++++++ 13 files changed, 117 insertions(+) diff --git a/src/tests/docs_bzl/scenarios/basic_docs/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/basic_docs/_expected/needs_json/needs.json index 346aeed66..28be54c34 100644 --- a/src/tests/docs_bzl/scenarios/basic_docs/_expected/needs_json/needs.json +++ b/src/tests/docs_bzl/scenarios/basic_docs/_expected/needs_json/needs.json @@ -679,6 +679,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", diff --git a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/data_bundle_needs/needs.json b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/data_bundle_needs/needs.json index d5da28295..1ace36205 100644 --- a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/data_bundle_needs/needs.json +++ b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/data_bundle_needs/needs.json @@ -679,6 +679,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", diff --git a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/isolated_source_bundle_needs/needs.json b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/isolated_source_bundle_needs/needs.json index eece8f468..1bae1365b 100644 --- a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/isolated_source_bundle_needs/needs.json +++ b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/isolated_source_bundle_needs/needs.json @@ -679,6 +679,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", diff --git a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/needs_json/needs.json index fb6acfd31..b718aa38d 100644 --- a/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/needs_json/needs.json +++ b/src/tests/docs_bzl/scenarios/data_files_runfiles/_expected/needs_json/needs.json @@ -679,6 +679,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", diff --git a/src/tests/docs_bzl/scenarios/nested_bundles/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/needs_json/needs.json index f214d4128..3c051981a 100644 --- a/src/tests/docs_bzl/scenarios/nested_bundles/_expected/needs_json/needs.json +++ b/src/tests/docs_bzl/scenarios/nested_bundles/_expected/needs_json/needs.json @@ -696,6 +696,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", diff --git a/src/tests/docs_bzl/scenarios/reference_integration/_expected/needs_local.json b/src/tests/docs_bzl/scenarios/reference_integration/_expected/needs_local.json index 1a3ed00e2..a1e02ccb4 100644 --- a/src/tests/docs_bzl/scenarios/reference_integration/_expected/needs_local.json +++ b/src/tests/docs_bzl/scenarios/reference_integration/_expected/needs_local.json @@ -679,6 +679,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", diff --git a/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/_expected/needs_json/needs.json index 3bc37bab0..9d2199ca5 100644 --- a/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/_expected/needs_json/needs.json +++ b/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/_expected/needs_json/needs.json @@ -696,6 +696,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", diff --git a/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/docs/components/component/_expected/needs_local.json b/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/docs/components/component/_expected/needs_local.json index 16ea98a94..97c76ac00 100644 --- a/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/docs/components/component/_expected/needs_local.json +++ b/src/tests/docs_bzl/scenarios/reference_integration/legacy_module/docs/components/component/_expected/needs_local.json @@ -696,6 +696,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", diff --git a/src/tests/docs_bzl/scenarios/reference_integration/modern_module/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/reference_integration/modern_module/_expected/needs_json/needs.json index 43eabf09e..6638cc3b2 100644 --- a/src/tests/docs_bzl/scenarios/reference_integration/modern_module/_expected/needs_json/needs.json +++ b/src/tests/docs_bzl/scenarios/reference_integration/modern_module/_expected/needs_json/needs.json @@ -779,6 +779,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", diff --git a/src/tests/docs_bzl/scenarios/reference_integration/modern_module/docs/components/unlinked_component/_expected/needs_local.json b/src/tests/docs_bzl/scenarios/reference_integration/modern_module/docs/components/unlinked_component/_expected/needs_local.json index 8bdb206d2..1bf568898 100644 --- a/src/tests/docs_bzl/scenarios/reference_integration/modern_module/docs/components/unlinked_component/_expected/needs_local.json +++ b/src/tests/docs_bzl/scenarios/reference_integration/modern_module/docs/components/unlinked_component/_expected/needs_local.json @@ -695,6 +695,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", diff --git a/src/tests/docs_bzl/scenarios/reference_integration/score_platform/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/reference_integration/score_platform/_expected/needs_json/needs.json index fb4ecca51..a7392c434 100644 --- a/src/tests/docs_bzl/scenarios/reference_integration/score_platform/_expected/needs_json/needs.json +++ b/src/tests/docs_bzl/scenarios/reference_integration/score_platform/_expected/needs_json/needs.json @@ -723,6 +723,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", diff --git a/src/tests/docs_bzl/scenarios/subdirectory_bundle/consumer/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/subdirectory_bundle/consumer/_expected/needs_json/needs.json index 09e3ff71a..068482d70 100644 --- a/src/tests/docs_bzl/scenarios/subdirectory_bundle/consumer/_expected/needs_json/needs.json +++ b/src/tests/docs_bzl/scenarios/subdirectory_bundle/consumer/_expected/needs_json/needs.json @@ -725,6 +725,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", diff --git a/src/tests/docs_bzl/scenarios/subdirectory_bundle/producer/_expected/needs_json/needs.json b/src/tests/docs_bzl/scenarios/subdirectory_bundle/producer/_expected/needs_json/needs.json index 6a304b688..a0f7e4930 100644 --- a/src/tests/docs_bzl/scenarios/subdirectory_bundle/producer/_expected/needs_json/needs.json +++ b/src/tests/docs_bzl/scenarios/subdirectory_bundle/producer/_expected/needs_json/needs.json @@ -710,6 +710,15 @@ }, "type": "array" }, + "maturity": { + "default": "", + "description": "Added by needs_fields config", + "field_type": "extra", + "type": [ + "string", + "null" + ] + }, "max_amount": { "default": null, "description": "Added by service github-issues", From 777e15de79eb5855578470d8f7e9df26c5c81526 Mon Sep 17 00:00:00 2001 From: Anton Krivoborodov Date: Fri, 18 Sep 2026 09:19:37 +0000 Subject: [PATCH 3/3] fix: move 'maturity' attribute from comp to mod need type --- src/extensions/score_metamodel/metamodel.yaml | 3 +-- .../tests/rst/options/test_options_options.rst | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/extensions/score_metamodel/metamodel.yaml b/src/extensions/score_metamodel/metamodel.yaml index bb28d4647..c7b7894ba 100644 --- a/src/extensions/score_metamodel/metamodel.yaml +++ b/src/extensions/score_metamodel/metamodel.yaml @@ -538,6 +538,7 @@ needs_types: safety: ^(QM|ASIL_B)$ # req-Id: tool_req__docs_common_attr_status status: ^(valid|invalid)$ + maturity: ^(preview|experimental|release)$ mandatory_links: # req-Id: tool_req__arch_linkage_safety includes: comp @@ -582,8 +583,6 @@ needs_types: safety: ^(QM|ASIL_B)$ # req-Id: tool_req__docs_common_attr_status status: ^(valid|invalid)$ - optional_options: - maturity: ^(preview|experimental|release)$ mandatory_links: belongs_to: feat # preparation for linking change according to DR-005 optional_links: diff --git a/src/extensions/score_metamodel/tests/rst/options/test_options_options.rst b/src/extensions/score_metamodel/tests/rst/options/test_options_options.rst index 25ee6f142..0ed27448f 100644 --- a/src/extensions/score_metamodel/tests/rst/options/test_options_options.rst +++ b/src/extensions/score_metamodel/tests/rst/options/test_options_options.rst @@ -78,17 +78,17 @@ -.. Test if the optional `maturity` option for `comp` follows the pattern `^(preview|experimental|release)$` +.. Test if the optional `maturity` option for `mod` follows the pattern `^(preview|experimental|release)$` -.. comp:: Test Component Maturity Bad - :id: comp__test_options__maturity_bad +.. mod:: Test Module Maturity Bad + :id: mod__test_options__maturity_bad :maturity: stable - :expect: comp__test_options__maturity_bad.maturity (stable): does not follow pattern `^(preview|experimental|release)$`. + :expect: mod__test_options__maturity_bad.maturity (stable): does not follow pattern `^(preview|experimental|release)$`. -.. comp:: Test Component Maturity Good - :id: comp__test_options__maturity_good +.. mod:: Test Module Maturity Good + :id: mod__test_options__maturity_good :maturity: preview :expect_not: does not follow pattern