Skip to content

Commit 58581ab

Browse files
authored
Update metamodell (#127)
* [rules_score] add unit_design rule and UnitDesignInfo provider * [rules_score] add fmea rule, remove safety_analysis * [rules_score] centralize all providers in providers.bzl Providers moved: - ArchitecturalDesignInfo (from private/architectural_design.bzl) - AnalysisInfo (from private/fmea.bzl) - DependabilityAnalysisInfo (from private/dependability_analysis.bzl) - FeatureRequirementsInfo (from private/feature_requirements.bzl) - ComponentRequirementsInfo (from private/component_requirements.bzl) - AssumptionsOfUseInfo (from private/assumptions_of_use.bzl) - SphinxModuleInfo (from private/sphinx_module.bzl) - SphinxNeedsInfo (from private/sphinx_module.bzl) * - ignore bazel external symlink and .vscode - apply buildifier - include overview figure
1 parent d8f3654 commit 58581ab

18 files changed

Lines changed: 358 additions & 164 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44

55
bazel-*
66
MODULE.bazel.lock
7+
external
8+
.vscode/
79

810
__pycache__

MODULE.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module(
2020
###############################################################################
2121
# Core Dependencies
2222
###############################################################################
23+
bazel_dep(name = "rules_cc", version = "0.2.14")
2324
bazel_dep(name = "rules_python", version = "1.4.1")
2425
bazel_dep(name = "aspect_rules_py", version = "1.4.0")
2526
bazel_dep(name = "platforms", version = "1.0.0")
@@ -98,3 +99,8 @@ use_repo(multitool, "yamlfmt_hub")
9899
register_toolchains(
99100
"//bazel/rules/rules_score:sphinx_default_toolchain",
100101
)
102+
103+
###############################################################################
104+
# Dev Dependencies (for testing)
105+
###############################################################################
106+
bazel_dep(name = "score_docs_as_code", version = "3.0.1", dev_dependency = True)

bazel/rules/rules_score/docs/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,12 @@ The macro automatically:
328328
- Delegates to ``sphinx_module`` for actual Sphinx build and HTML generation
329329
- Integrates dependencies for cross-module referencing and HTML merging
330330

331+
**Overview and interrelations:**
332+
333+
.. uml:: rules_score_overview.puml
334+
:align: center
335+
:alt: Overview of rules_score architecture
336+
:width: 100%
331337

332338
Complete Example
333339
----------------
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
' *******************************************************************************
2+
' Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
'
4+
' See the NOTICE file(s) distributed with this work for additional
5+
' information regarding copyright ownership.
6+
'
7+
' This program and the accompanying materials are made available under the
8+
' terms of the Apache License Version 2.0 which is available at
9+
' https://www.apache.org/licenses/LICENSE-2.0
10+
'
11+
' SPDX-License-Identifier: Apache-2.0
12+
' *******************************************************************************
13+
14+
@startuml
15+
16+
skinparam linetype ortho
17+
skinparam ArrowFontSize 10
18+
skinparam ArrowFontStyle italic
19+
skinparam messageAlign center
20+
21+
skinparam component {
22+
BackgroundColor<<design>> #D7E8F7
23+
BorderColor<<design>> #0066B1
24+
BackgroundColor<<requirements>> #F1887D
25+
BorderColor<<requirements>> #E22718
26+
BackgroundColor<<implementation>> #B5A99B
27+
BorderColor<<implementation>> #533F24
28+
BackgroundColor<<analysis>> #B2B2B2
29+
BorderColor<<analysis>> #494949
30+
BackgroundColor<<docs>> #F2F2F2
31+
BorderColor<<docs>> #929292
32+
}
33+
34+
' ── Design / Diagram rules ────────────────────────────────────────────────────
35+
component "unit_design" <<design>> as unit_design
36+
component "architectural_design" <<design>> as arch
37+
38+
' ── Requirements rules ────────────────────────────────────────────────────────
39+
component "feature_requirements" <<requirements>> as feat_req
40+
component "component_requirements" <<requirements>> as comp_req
41+
component "assumptions_of_use" <<requirements>> as aou
42+
43+
' ── Implementation rules ──────────────────────────────────────────────────────
44+
component "unit" <<implementation>> as unit
45+
component "component" <<implementation>> as comp
46+
47+
' ── Safety Analysis rules ─────────────────────────────────────────────────────
48+
component "fmea" <<analysis>> as fmea
49+
component "dependability_analysis" <<analysis>> as da
50+
51+
' ── Documentation rules ───────────────────────────────────────────────────────
52+
component "sphinx_module" <<docs>> as sphinx
53+
54+
' ── Top-level assembly rule ───────────────────────────────────────────────────
55+
component "dependable_element" as de
56+
57+
unit_design --> unit : <<UnitDesignInfo>>
58+
59+
arch --> fmea : <<ArchitecturalDesignInfo>>
60+
arch --> de : <<ArchitecturalDesignInfo>>
61+
62+
feat_req --> aou : <<FeatureRequirementsInfo>>
63+
feat_req --> de : <<FeatureRequirementsInfo>>
64+
65+
comp_req --> comp : <<ComponentRequirementsInfo>>
66+
comp_req --> aou : <<ComponentRequirementsInfo>>
67+
68+
fmea --> da : <<AnalysisInfo>>
69+
da --> de : <<DependabilityAnalysisInfo>>
70+
71+
aou --> de : <<AssumptionsOfUseInfo>>
72+
unit --> comp : <<UnitInfo>>
73+
comp --> de : <<ComponentInfo>>
74+
75+
sphinx --> de : <<SphinxModuleInfo>>\n<<SphinxNeedsInfo>>
76+
77+
@enduml

bazel/rules/rules_score/private/architectural_design.bzl

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,9 @@ documentation following S-CORE process guidelines. Architectural design
1919
documents describe the software architecture including static and dynamic views.
2020
"""
2121

22-
load("//bazel/rules/rules_score:providers.bzl", "SphinxSourcesInfo")
22+
load("//bazel/rules/rules_score:providers.bzl", "ArchitecturalDesignInfo", "SphinxSourcesInfo")
2323

24-
# ============================================================================
25-
# Provider Definition
26-
# ============================================================================
27-
28-
ArchitecturalDesignInfo = provider(
29-
doc = "Provider for architectural design artifacts",
30-
fields = {
31-
"static": "Depset of static architecture diagram files (e.g., class diagrams, component diagrams)",
32-
"dynamic": "Depset of dynamic architecture diagram files (e.g., sequence diagrams, activity diagrams)",
33-
"name": "Name of the architectural design target",
34-
},
35-
)
24+
# ArchitecturalDesignInfo is re-exported from providers.bzl for backward compatibility.
3625

3726
# ============================================================================
3827
# Private Rule Implementation

bazel/rules/rules_score/private/assumptions_of_use.bzl

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,9 @@ following S-CORE process guidelines. Assumptions of Use define the safety-releva
1919
operating conditions and constraints for a Safety Element out of Context (SEooC).
2020
"""
2121

22-
load("//bazel/rules/rules_score:providers.bzl", "SphinxSourcesInfo")
23-
load("//bazel/rules/rules_score/private:component_requirements.bzl", "ComponentRequirementsInfo")
24-
load("//bazel/rules/rules_score/private:feature_requirements.bzl", "FeatureRequirementsInfo")
22+
load("//bazel/rules/rules_score:providers.bzl", "AssumptionsOfUseInfo", "ComponentRequirementsInfo", "FeatureRequirementsInfo", "SphinxSourcesInfo")
2523

26-
# ============================================================================
27-
# Provider Definition
28-
# ============================================================================
29-
30-
AssumptionsOfUseInfo = provider(
31-
doc = "Provider for assumptions of use artifacts",
32-
fields = {
33-
"srcs": "Depset of source files containing assumptions of use",
34-
"feature_requirements": "List of FeatureRequirementsInfo providers this AoU traces to",
35-
"name": "Name of the assumptions of use target",
36-
},
37-
)
24+
# AssumptionsOfUseInfo is re-exported from providers.bzl for backward compatibility.
3825

3926
# ============================================================================
4027
# Private Rule Implementation

bazel/rules/rules_score/private/component_requirements.bzl

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,9 @@ following S-CORE process guidelines. Component requirements are derived from
1919
feature requirements and define the specific requirements for a software component.
2020
"""
2121

22-
load("//bazel/rules/rules_score:providers.bzl", "SphinxSourcesInfo")
23-
load("//bazel/rules/rules_score/private:feature_requirements.bzl", "FeatureRequirementsInfo")
22+
load("//bazel/rules/rules_score:providers.bzl", "ComponentRequirementsInfo", "SphinxSourcesInfo")
2423

25-
# ============================================================================
26-
# Provider Definition
27-
# ============================================================================
28-
29-
ComponentRequirementsInfo = provider(
30-
doc = "Provider for component requirements artifacts",
31-
fields = {
32-
"srcs": "Depset of source files containing component requirements",
33-
"requirements": "List of FeatureRequirementsInfo providers this component traces to",
34-
"name": "Name of the component requirements target",
35-
},
36-
)
24+
# ComponentRequirementsInfo and FeatureRequirementsInfo are re-exported from providers.bzl for backward compatibility.
3725

3826
# ============================================================================
3927
# Private Rule Implementation

bazel/rules/rules_score/private/dependability_analysis.bzl

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,9 @@ combines safety analysis with dependent failure analysis (DFA) to provide
2020
a comprehensive view of component reliability and safety.
2121
"""
2222

23-
load("//bazel/rules/rules_score:providers.bzl", "SphinxSourcesInfo")
24-
load("//bazel/rules/rules_score/private:architectural_design.bzl", "ArchitecturalDesignInfo")
25-
load("//bazel/rules/rules_score/private:safety_analysis.bzl", "AnalysisInfo")
23+
load("//bazel/rules/rules_score:providers.bzl", "AnalysisInfo", "ArchitecturalDesignInfo", "DependabilityAnalysisInfo", "SphinxSourcesInfo")
2624

27-
# ============================================================================
28-
# Provider Definition
29-
# ============================================================================
30-
31-
DependabilityAnalysisInfo = provider(
32-
doc = "Provider for dependability analysis artifacts",
33-
fields = {
34-
"safety_analysis": "List of AnalysisInfo providers",
35-
"security_analysis": "List of AnalysisInfo providers",
36-
"arch_design": "ArchitecturalDesignInfo provider for linked architectural design",
37-
"name": "Name of the dependability analysis target",
38-
},
39-
)
25+
# DependabilityAnalysisInfo is re-exported from providers.bzl for backward compatibility.
4026

4127
# ============================================================================
4228
# Private Rule Implementation

bazel/rules/rules_score/private/feature_requirements.bzl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,9 @@ following S-CORE process guidelines. Feature requirements describe the
1919
high-level features that a software component must implement.
2020
"""
2121

22-
load("//bazel/rules/rules_score:providers.bzl", "SphinxSourcesInfo")
22+
load("//bazel/rules/rules_score:providers.bzl", "FeatureRequirementsInfo", "SphinxSourcesInfo")
2323

24-
# ============================================================================
25-
# Provider Definition
26-
# ============================================================================
27-
28-
FeatureRequirementsInfo = provider(
29-
doc = "Provider for feature requirements artifacts",
30-
fields = {
31-
"srcs": "Depset of source files containing feature requirements",
32-
"name": "Name of the feature requirements target",
33-
},
34-
)
24+
# FeatureRequirementsInfo is re-exported from providers.bzl for backward compatibility.
3525

3626
# ============================================================================
3727
# Private Rule Implementation

0 commit comments

Comments
 (0)