Skip to content

Commit 7551573

Browse files
Make version mandatory & further fixes regarding process (#634)
This is making the version mandatory. The other changes in the tool_requirements etc. are needed to enable building for the newest process commit done as a git_override here.
1 parent dfa30ee commit 7551573

7 files changed

Lines changed: 31 additions & 36 deletions

File tree

MODULE.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ http_file(
7070
)
7171

7272
bazel_dep(name = "score_process", version = "2.0.1")
73+
git_override(
74+
module_name = "score_process",
75+
commit = "292ec1c913a88ed1b724e33fdae658df6dc7b033",
76+
remote = "https://github.com/eclipse-score/process_description",
77+
)
7378

7479
# Provide the tools from the devcontainer to Bazel
7580
bazel_dep(name = "score_devcontainer", version = "1.8.0")

MODULE.bazel.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/internals/decisions/001-test-results-in-workflow.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
:::{dec_rec} Decision Record 001: Test results in Docs-As-Code Workflows
22
:id: dec_rec__dac__001_test_results_in_workflows
3+
:version: 1
34
:status: accepted
45
:context: Need to embed test results into docs, but tests are slow.
56
:decision: Run quick docs checks and tests in parallel, then full docs generation sequentially.

docs/internals/requirements/requirements.rst

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -460,21 +460,6 @@ Versioning
460460
* Process
461461
* Non-Functional
462462

463-
.. tool_req:: Enables marking requirements as "covered"
464-
:id: tool_req__docs_req_attr_reqcov
465-
:tags: Requirements
466-
:implemented: PARTIAL
467-
:version: 1
468-
:satisfies: gd_req__req_attr_req_cov
469-
470-
Docs as code shall shall enable marking requirements as covered by their linked children.
471-
472-
Attribute ``reqcov`` must be one of the following values:
473-
* Yes
474-
* No
475-
476-
.. note::
477-
No concept yet, as parents are generally not aware of their children.
478463

479464
.. tool_req:: Support requirements test coverage
480465
:id: tool_req__docs_req_attr_testcov

src/extensions/score_metamodel/metamodel.yaml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ needs_types_base_options:
1919
testlink: ^https://github.com/.*
2020
# Version will be mandatory global option in future releases
2121
# For now giving grace periods to consumers
22+
mandatory_options:
2223
# req-Id: tool_req__docs_common_attr_version
2324
version: ^[0-9]*$
2425

@@ -265,8 +266,6 @@ needs_types:
265266
security: ^(YES|NO)$
266267
valid_from: ^v(0|[1-9]\d*)\.(0|[1-9]\d*)(\.(0|[1-9]\d*))?$
267268
optional_options:
268-
# req-Id: tool_req__docs_req_attr_reqcov
269-
reqcovered: ^(YES|NO)$
270269
# req-Id: tool_req__docs_req_attr_testcov
271270
testcovered: ^(YES|NO)$
272271
hash: ^.*$
@@ -301,8 +300,6 @@ needs_types:
301300
# req-Id: tool_req__docs_req_link_covers_aou
302301
covers: aou_req
303302
optional_options:
304-
# req-Id: tool_req__docs_req_attr_reqcov
305-
reqcovered: ^(YES|NO)$
306303
# req-Id: tool_req__docs_req_attr_testcov
307304
testcovered: ^(YES|NO)$
308305
hash: ^.*$
@@ -336,8 +333,6 @@ needs_types:
336333
# req-Id: tool_req__docs_req_link_covers_aou
337334
covers: aou_req
338335
optional_options:
339-
# req-Id: tool_req__docs_req_attr_reqcov
340-
reqcovered: ^(YES|NO)$
341336
# req-Id: tool_req__docs_req_attr_testcov
342337
testcovered: ^(YES|NO)$
343338
hash: ^.*$
@@ -358,8 +353,6 @@ needs_types:
358353
satisfies: gd_req, stkh_req, feat_req, comp_req
359354
optional_options:
360355
tags: ^.*$
361-
# req-Id: tool_req__docs_req_attr_reqcov
362-
reqcovered: ^(YES|NO)$
363356
# req-Id: tool_req__docs_req_attr_testcov
364357
testcovered: ^(YES|NO)$
365358
hash: ^.*$
@@ -388,8 +381,6 @@ needs_types:
388381
# req-Id: tool_req__docs_common_attr_description
389382
content: ^[\s\S]+$
390383
optional_options:
391-
# req-Id: tool_req__docs_req_attr_reqcov
392-
reqcovered: ^(YES|NO)$
393384
# req-Id: tool_req__docs_req_attr_testcov
394385
testcovered: ^(YES|NO)$
395386
hash: ^.*$

src/extensions/score_metamodel/tests/rst/options/test_options_options.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
.. std_wp:: This is a test
3636
:id: std_wp__test_options__abce
3737
:status: active
38+
:version: 1
3839
:expect_not: attribute
3940

4041

@@ -558,6 +559,7 @@
558559

559560
.. feat_sec_threat:: Valid threat
560561
:id: feat_sec_threat__test_options__ok_3
562+
:version: 1
561563
:threat_id: MT_01_03
562564
:status: valid
563565
:expect_not: feat_sec_threat__test_options__ok_3
@@ -621,6 +623,7 @@
621623

622624
.. feat_sec_ana:: Valid threat scenario
623625
:id: feat_sec_ana__test_options__ok_8
626+
:version: 1
624627
:threat_scenario_id: SC_01_02
625628
:status: valid
626629
:sufficient: yes
@@ -634,6 +637,7 @@
634637

635638
.. feat_sec_ana:: Valid threat scenario with optional mitigation_issue
636639
:id: feat_sec_ana__test_options__ok_9
640+
:version: 1
637641
:threat_scenario_id: SC_01_03
638642
:status: invalid
639643
:sufficient: no

src/extensions/score_metamodel/yaml_parser.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ def default_options():
6767
def _parse_need_type(
6868
directive_name: str,
6969
yaml_data: dict[str, Any],
70-
global_base_opts: dict[str, Any],
70+
global_base_optional_opts: dict[str, Any],
71+
global_base_mandatory_opts: dict[str, Any],
7172
):
7273
"""Build a single ScoreNeedType dict from the metamodel entry, incl defaults."""
7374

@@ -77,14 +78,15 @@ def _parse_need_type(
7778
optional_options = yaml_data.get("optional_options", {})
7879
mandatory_links = yaml_data.get("mandatory_links", {})
7980
optional_links = yaml_data.get("optional_links", {})
81+
global_opts = global_base_optional_opts | global_base_mandatory_opts
8082

8183
overlap_checks: list[tuple[str, dict[str, Any], str, dict[str, Any]]] = [
8284
("mandatory_options", mandatory_options, "optional_options", optional_options),
83-
("mandatory_options", mandatory_options, "global_base_opts", global_base_opts),
84-
("optional_options", optional_options, "global_base_opts", global_base_opts),
85+
("mandatory_options", mandatory_options, "global_base_opts", global_opts),
86+
("optional_options", optional_options, "global_base_opts", global_opts),
8587
("mandatory_links", mandatory_links, "optional_links", optional_links),
86-
("mandatory_links", mandatory_links, "global_base_opts", global_base_opts),
87-
("optional_links", optional_links, "global_base_opts", global_base_opts),
88+
("mandatory_links", mandatory_links, "global_base_opts", global_opts),
89+
("optional_links", optional_links, "global_base_opts", global_opts),
8890
]
8991
errors: list[str] = []
9092
for a_name, a, b_name, b in overlap_checks:
@@ -99,8 +101,8 @@ def _parse_need_type(
99101
"prefix": yaml_data.get("prefix", f"{directive_name}__"),
100102
"tags": yaml_data.get("tags", []),
101103
"parts": yaml_data.get("parts", 3),
102-
"mandatory_options": mandatory_options,
103-
"optional_options": optional_options | global_base_opts,
104+
"mandatory_options": mandatory_options | global_base_mandatory_opts,
105+
"optional_options": optional_options | global_base_optional_opts,
104106
"mandatory_links_str": mandatory_links,
105107
"mandatory_links": None,
106108
"optional_links_str": optional_links,
@@ -123,6 +125,7 @@ def _parse_need_type(
123125
def _parse_needs_types(
124126
types_dict: dict[str, Any],
125127
global_base_options_optional_opts: dict[str, Any],
128+
global_base_mandatory_options: dict[str, Any],
126129
) -> dict[str, ScoreNeedType]:
127130
"""Parse the 'needs_types' section of the metamodel.yaml."""
128131

@@ -133,7 +136,10 @@ def _parse_needs_types(
133136
assert isinstance(directive_data, dict)
134137

135138
needs_types[directive_name], parsing_errors = _parse_need_type(
136-
directive_name, directive_data, global_base_options_optional_opts
139+
directive_name,
140+
directive_data,
141+
global_base_options_optional_opts,
142+
global_base_mandatory_options,
137143
)
138144
all_errors.extend(parsing_errors)
139145

@@ -218,6 +224,9 @@ def load_metamodel_data(yaml_path: Path | None = None) -> MetaModelData:
218224
global_base_options_optional_opts = data.get("needs_types_base_options", {}).get(
219225
"optional_options", {}
220226
)
227+
global_base_options_mandatory_opts = data.get("needs_types_base_options", {}).get(
228+
"mandatory_options", {}
229+
)
221230

222231
# Get the stop_words and weak_words as separate lists
223232
prohibited_words_checks = _parse_prohibited_words(
@@ -226,7 +235,9 @@ def load_metamodel_data(yaml_path: Path | None = None) -> MetaModelData:
226235

227236
# Convert "types" from {directive_name: {...}, ...} to a list of dicts
228237
needs_types = _parse_needs_types(
229-
data.get("needs_types", {}), global_base_options_optional_opts
238+
data.get("needs_types", {}),
239+
global_base_options_optional_opts,
240+
global_base_options_mandatory_opts,
230241
)
231242

232243
return MetaModelData(

0 commit comments

Comments
 (0)