diff --git a/docs/internals/requirements/requirements.rst b/docs/internals/requirements/requirements.rst index a476ab15..52203074 100644 --- a/docs/internals/requirements/requirements.rst +++ b/docs/internals/requirements/requirements.rst @@ -535,10 +535,12 @@ Mapping Docs-as-Code shall support the following architecture element types: - * Feature (feat_arc_sta) + * Feature Static View (feat_arc_sta) + * Feature (feat) * Logical Interface (logic_arc_int) * Logical Interface Operation (logic_arc_int_op) - * Component (comp_arc_sta) + * Component Static View (comp_arc_sta) + * Component (comp) * Interface (real_arc_int) * Interface Operation (real_arc_int_op) @@ -669,8 +671,9 @@ Architecture Attributes * Module View (mod_view_sta) .. note:: - feat_arc_sta, comp_arc_sta, logic_arc_int, real_arc_int are architecture elements - AND architecture views. + feat_arc_sta, comp_arc_sta, logic_arc_int, real_arc_int are architecture views, + but are still defined as architectural elements, which means they have the properties of + architectural elements. 💻 Detailed Design & Code ########################## diff --git a/src/extensions/score_draw_uml_funcs/__init__.py b/src/extensions/score_draw_uml_funcs/__init__.py index 500ded74..067df1ea 100644 --- a/src/extensions/score_draw_uml_funcs/__init__.py +++ b/src/extensions/score_draw_uml_funcs/__init__.py @@ -156,7 +156,7 @@ def draw_comp_incl_impl_int( logger.info(f"{need}: include {need_inc} could not be found") continue - if curr_need["type"] != "comp_arc_sta": + if curr_need["type"] != "comp": continue sub_structure, sub_linkage, proc_impl_interfaces, proc_used_interfaces = ( diff --git a/src/extensions/score_metamodel/metamodel.yaml b/src/extensions/score_metamodel/metamodel.yaml index a18c32f8..e75ed9c4 100644 --- a/src/extensions/score_metamodel/metamodel.yaml +++ b/src/extensions/score_metamodel/metamodel.yaml @@ -419,7 +419,7 @@ needs_types: - architecture_element parts: 2 - # Architecture Element & View + # Architecture View (but owns the requirement properties of architectural elements) # req-Id: tool_req__docs_arch_types # req-Id: tool_req__docs_arch_views feat_arc_sta: @@ -443,7 +443,7 @@ needs_types: - architecture_view parts: 3 - # Architecture View + # Architecture View (but owns the requirement properties of architectural elements) # req-Id: tool_req__docs_arch_views feat_arc_dyn: title: Feature Sequence Diagram @@ -532,10 +532,9 @@ needs_types: title: Module Architecture Static View color: #FEDCD2 style: card - mandatory_links: - includes: comp_arc_sta optional_links: belongs_to: mod # for evaluation + includes: comp, comp_arc_sta # deprecated tags: - architecture_view parts: 3 @@ -570,7 +569,7 @@ needs_types: - architecture_element parts: 2 - # Architecture View + # Architecture View (but owns requirement properties of architectural elements) # req-Id: tool_req__docs_arch_views comp_arc_sta: title: Component Package Diagram @@ -586,14 +585,14 @@ needs_types: optional_links: fulfils: comp_req implements: logic_arc_int, real_arc_int_op - includes: comp_arc_sta + includes: comp_arc_sta, comp uses: logic_arc_int, real_arc_int_op belongs_to: comp # TODO: make it mandatory tags: - architecture_view parts: 3 - # Architecture View + # Architecture View (but owns requirement properties of architectural elements) # req-Id: tool_req__docs_arch_views comp_arc_dyn: title: Component Sequence Diagram diff --git a/src/extensions/score_metamodel/tests/rst/architecture/architecture_tests.rst b/src/extensions/score_metamodel/tests/rst/architecture/architecture_tests.rst new file mode 100644 index 00000000..dedd7532 --- /dev/null +++ b/src/extensions/score_metamodel/tests/rst/architecture/architecture_tests.rst @@ -0,0 +1,162 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +#CHECK: check_options + +.. stkh_req:: Test Stakeholder Requirement 1 + :id: stkh_req__test_stakeholder_requirement_1__basic_stkh_req + :reqtype: Non-Functional + :safety: ASIL_B + :security: YES + :rationale: Exists just for the test the component / feature drawings + :status: invalid + +.. feat_req:: Test Feature Requirement 1 + :id: feat_req__test_feature_1__test_req_1 + :reqtype: Process + :security: YES + :safety: ASIL_B + :satisfies: stkh_req__test_stakeholder_requirement_1__basic_stkh_req + :status: invalid + + Test Feature Requirement 1 + +.. feat:: Test Feature 1 + :id: feat__test_feature_1 + :security: YES + :safety: ASIL_B + :status: invalid + :includes: logic_arc_int__test_feature_1__test_interface_1, logic_arc_int_op__test_feature_1__test_operation_1 + :consists_of: comp__test_component_1, comp__test_component_2 + +.. feat_arc_sta:: Test Feature Static View Feature 1 + :id: feat_arc_sta__test_feature_1__static_view + :security: YES + :safety: ASIL_B + :status: invalid + :fulfils: feat_req__test_feature_1__test_req_1 + :includes: logic_arc_int__test_feature_1__test_interface_1 + + .. needarch + :scale: 50 + :align: center + + {{ draw_feature(need(), needs) }} + +.. feat_arc_dyn:: Test Feature Static Dynamic Feature 1 + :id: feat_arc_dyn__test_feature_1__dynamic_view + :security: YES + :safety: ASIL_B + :status: invalid + :fulfils: feat_req__test_feature_1__test_req_1 + + Put here a sequence diagram + +.. logic_arc_int:: Logic Interface Test 1 + :id: logic_arc_int__test_feature_1__test_interface_1 + :security: YES + :safety: ASIL_B + :status: invalid + +.. logic_arc_int_op:: Logic Operation Test 1 + :id: logic_arc_int_op__test_feature_1__test_operation_1 + :security: YES + :safety: ASIL_B + :status: invalid + :included_by: logic_arc_int__test_feature_1__test_interface_1 + +.. logic_arc_int:: Logic Interface Test 2 + :id: logic_arc_int__test_feature_1__test_interface_2 + :security: YES + :safety: ASIL_B + :status: invalid + +Component 1 +~~~~~~~~~~~ + +.. comp:: Test Component 1 + :id: comp__test_component_1 + :security: YES + :safety: ASIL_B + :status: invalid + :implements: logic_arc_int__test_feature_1__test_interface_1 + :uses: logic_arc_int__test_feature_1__test_interface_2 + :consists_of: sw_unit__component_1__test_unit_1, comp__test_sub_component_1 + +.. comp_req:: Test Component 1 Requirement 1 + :id: comp_req__test_component_1__requirement_1 + :reqtype: Process + :security: YES + :safety: ASIL_B + :satisfies: feat_req__test_feature_1__test_req_1 + :status: invalid + + Test Component 1 Requirement + +.. sw_unit:: SW Test Unit 1 + :id: sw_unit__component_1__test_unit_1 + :security: YES + :safety: ASIL_B + :status: invalid + +.. comp:: Test Sub Component 1 + :id: comp__test_sub_component_1 + :security: YES + :safety: ASIL_B + :status: invalid + :implements: logic_arc_int__test_feature_1__test_interface_1 + :consists_of: sw_unit__sub_component_1__test_unit_2 + +.. comp_arc_sta:: Test Component Architecture Component 1 + :id: comp_arc_sta__feature_name__component_name + :safety: ASIL_B + :security: YES + :status: invalid + :fulfils: comp_req__test_component_1__requirement_1 + :implements: logic_arc_int__test_feature_1__test_interface_1 + :belongs_to: comp__test_sub_component_1 + +.. sw_unit:: SW Test Unit 2 + :id: sw_unit__sub_component_1__test_unit_2 + :security: YES + :safety: ASIL_B + :status: invalid + +Component 1 +~~~~~~~~~~~ + +.. comp:: Test Component 2 + :id: comp__test_component_2 + :security: YES + :safety: QM + :status: invalid + :implements: logic_arc_int__test_feature_1__test_interface_2 + +.. mod:: Feature Test Module 1 + :id: mod__test_feature_1_module_1 + :security: YES + :safety: ASIL_B + :status: valid + :includes: comp__test_component_1, comp__test_component_2 + +.. mod_view_sta:: Feature Test Module 1 Static View + :id: mod_view_sta__test_feature_1_module_1__test_static_view_1 + :belongs_to: mod__test_feature_1_module_1 + :includes: comp_arc_sta__feature_name__component_name + + .. needarch + :scale: 50 + :align: center + + {{ draw_module(need(), needs) }} diff --git a/src/extensions/score_metamodel/tests/rst/attributes/test_prohibited_words.rst b/src/extensions/score_metamodel/tests/rst/attributes/test_prohibited_words.rst index 40546c00..4a470eca 100644 --- a/src/extensions/score_metamodel/tests/rst/attributes/test_prohibited_words.rst +++ b/src/extensions/score_metamodel/tests/rst/attributes/test_prohibited_words.rst @@ -66,7 +66,7 @@ -.. Description of requirement of type feat_arc_sta is not checked for weak words +.. Description of architecture view of type feat_arc_sta is not checked for weak words #EXPECT-NOT: feat_arc_sta_desc_good: contains a weak word: `really` in option: `content`. Please revise the wording. .. feat_arc_sta:: This is a test diff --git a/src/extensions/score_metamodel/tests/test_rules_file_based.py b/src/extensions/score_metamodel/tests/test_rules_file_based.py index 050a60b5..13d3ace5 100644 --- a/src/extensions/score_metamodel/tests/test_rules_file_based.py +++ b/src/extensions/score_metamodel/tests/test_rules_file_based.py @@ -193,6 +193,7 @@ def test_rst_files( # Collect the warnings warnings = app.warning.getvalue().splitlines() + print("\n".join(w for w in warnings if "score_metamodel" in w)) # Check if the expected warnings are present for warning_info in rst_data.warning_infos: