Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

bazel-*
MODULE.bazel.lock
external
.vscode/

__pycache__
6 changes: 6 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module(
###############################################################################
# Core Dependencies
###############################################################################
bazel_dep(name = "rules_cc", version = "0.2.14")
bazel_dep(name = "rules_python", version = "1.4.1")
bazel_dep(name = "aspect_rules_py", version = "1.4.0")
bazel_dep(name = "platforms", version = "1.0.0")
Expand Down Expand Up @@ -98,3 +99,8 @@ use_repo(multitool, "yamlfmt_hub")
register_toolchains(
"//bazel/rules/rules_score:sphinx_default_toolchain",
)

###############################################################################
# Dev Dependencies (for testing)
###############################################################################
bazel_dep(name = "score_docs_as_code", version = "3.0.1", dev_dependency = True)
6 changes: 6 additions & 0 deletions bazel/rules/rules_score/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,12 @@ The macro automatically:
- Delegates to ``sphinx_module`` for actual Sphinx build and HTML generation
- Integrates dependencies for cross-module referencing and HTML merging

**Overview and interrelations:**

.. uml:: rules_score_overview.puml
:align: center
:alt: Overview of rules_score architecture
:width: 100%

Complete Example
----------------
Expand Down
77 changes: 77 additions & 0 deletions bazel/rules/rules_score/docs/rules_score_overview.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
' *******************************************************************************
' Copyright (c) 2026 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
' *******************************************************************************

@startuml

skinparam linetype ortho
skinparam ArrowFontSize 10
skinparam ArrowFontStyle italic
skinparam messageAlign center

skinparam component {
BackgroundColor<<design>> #D7E8F7
BorderColor<<design>> #0066B1
BackgroundColor<<requirements>> #F1887D
BorderColor<<requirements>> #E22718
BackgroundColor<<implementation>> #B5A99B
BorderColor<<implementation>> #533F24
BackgroundColor<<analysis>> #B2B2B2
BorderColor<<analysis>> #494949
BackgroundColor<<docs>> #F2F2F2
BorderColor<<docs>> #929292
}

' ── Design / Diagram rules ────────────────────────────────────────────────────
component "unit_design" <<design>> as unit_design
component "architectural_design" <<design>> as arch

' ── Requirements rules ────────────────────────────────────────────────────────
component "feature_requirements" <<requirements>> as feat_req
component "component_requirements" <<requirements>> as comp_req
component "assumptions_of_use" <<requirements>> as aou

' ── Implementation rules ──────────────────────────────────────────────────────
component "unit" <<implementation>> as unit
component "component" <<implementation>> as comp

' ── Safety Analysis rules ─────────────────────────────────────────────────────
component "fmea" <<analysis>> as fmea
component "dependability_analysis" <<analysis>> as da

' ── Documentation rules ───────────────────────────────────────────────────────
component "sphinx_module" <<docs>> as sphinx

' ── Top-level assembly rule ───────────────────────────────────────────────────
component "dependable_element" as de

unit_design --> unit : <<UnitDesignInfo>>

arch --> fmea : <<ArchitecturalDesignInfo>>
arch --> de : <<ArchitecturalDesignInfo>>

feat_req --> aou : <<FeatureRequirementsInfo>>
feat_req --> de : <<FeatureRequirementsInfo>>

comp_req --> comp : <<ComponentRequirementsInfo>>
comp_req --> aou : <<ComponentRequirementsInfo>>

fmea --> da : <<AnalysisInfo>>
da --> de : <<DependabilityAnalysisInfo>>

aou --> de : <<AssumptionsOfUseInfo>>
unit --> comp : <<UnitInfo>>
comp --> de : <<ComponentInfo>>

sphinx --> de : <<SphinxModuleInfo>>\n<<SphinxNeedsInfo>>

@enduml
15 changes: 2 additions & 13 deletions bazel/rules/rules_score/private/architectural_design.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,9 @@ documentation following S-CORE process guidelines. Architectural design
documents describe the software architecture including static and dynamic views.
"""

load("//bazel/rules/rules_score:providers.bzl", "SphinxSourcesInfo")
load("//bazel/rules/rules_score:providers.bzl", "ArchitecturalDesignInfo", "SphinxSourcesInfo")

# ============================================================================
# Provider Definition
# ============================================================================

ArchitecturalDesignInfo = provider(
doc = "Provider for architectural design artifacts",
fields = {
"static": "Depset of static architecture diagram files (e.g., class diagrams, component diagrams)",
"dynamic": "Depset of dynamic architecture diagram files (e.g., sequence diagrams, activity diagrams)",
"name": "Name of the architectural design target",
},
)
# ArchitecturalDesignInfo is re-exported from providers.bzl for backward compatibility.

# ============================================================================
# Private Rule Implementation
Expand Down
17 changes: 2 additions & 15 deletions bazel/rules/rules_score/private/assumptions_of_use.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,9 @@ following S-CORE process guidelines. Assumptions of Use define the safety-releva
operating conditions and constraints for a Safety Element out of Context (SEooC).
"""

load("//bazel/rules/rules_score:providers.bzl", "SphinxSourcesInfo")
load("//bazel/rules/rules_score/private:component_requirements.bzl", "ComponentRequirementsInfo")
load("//bazel/rules/rules_score/private:feature_requirements.bzl", "FeatureRequirementsInfo")
load("//bazel/rules/rules_score:providers.bzl", "AssumptionsOfUseInfo", "ComponentRequirementsInfo", "FeatureRequirementsInfo", "SphinxSourcesInfo")

# ============================================================================
# Provider Definition
# ============================================================================

AssumptionsOfUseInfo = provider(
doc = "Provider for assumptions of use artifacts",
fields = {
"srcs": "Depset of source files containing assumptions of use",
"feature_requirements": "List of FeatureRequirementsInfo providers this AoU traces to",
"name": "Name of the assumptions of use target",
},
)
# AssumptionsOfUseInfo is re-exported from providers.bzl for backward compatibility.

# ============================================================================
# Private Rule Implementation
Expand Down
16 changes: 2 additions & 14 deletions bazel/rules/rules_score/private/component_requirements.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,9 @@ following S-CORE process guidelines. Component requirements are derived from
feature requirements and define the specific requirements for a software component.
"""

load("//bazel/rules/rules_score:providers.bzl", "SphinxSourcesInfo")
load("//bazel/rules/rules_score/private:feature_requirements.bzl", "FeatureRequirementsInfo")
load("//bazel/rules/rules_score:providers.bzl", "ComponentRequirementsInfo", "SphinxSourcesInfo")

# ============================================================================
# Provider Definition
# ============================================================================

ComponentRequirementsInfo = provider(
doc = "Provider for component requirements artifacts",
fields = {
"srcs": "Depset of source files containing component requirements",
"requirements": "List of FeatureRequirementsInfo providers this component traces to",
"name": "Name of the component requirements target",
},
)
# ComponentRequirementsInfo and FeatureRequirementsInfo are re-exported from providers.bzl for backward compatibility.

# ============================================================================
# Private Rule Implementation
Expand Down
18 changes: 2 additions & 16 deletions bazel/rules/rules_score/private/dependability_analysis.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,9 @@ combines safety analysis with dependent failure analysis (DFA) to provide
a comprehensive view of component reliability and safety.
"""

load("//bazel/rules/rules_score:providers.bzl", "SphinxSourcesInfo")
load("//bazel/rules/rules_score/private:architectural_design.bzl", "ArchitecturalDesignInfo")
load("//bazel/rules/rules_score/private:safety_analysis.bzl", "AnalysisInfo")
load("//bazel/rules/rules_score:providers.bzl", "AnalysisInfo", "ArchitecturalDesignInfo", "DependabilityAnalysisInfo", "SphinxSourcesInfo")

# ============================================================================
# Provider Definition
# ============================================================================

DependabilityAnalysisInfo = provider(
doc = "Provider for dependability analysis artifacts",
fields = {
"safety_analysis": "List of AnalysisInfo providers",
"security_analysis": "List of AnalysisInfo providers",
"arch_design": "ArchitecturalDesignInfo provider for linked architectural design",
"name": "Name of the dependability analysis target",
},
)
# DependabilityAnalysisInfo is re-exported from providers.bzl for backward compatibility.

# ============================================================================
# Private Rule Implementation
Expand Down
14 changes: 2 additions & 12 deletions bazel/rules/rules_score/private/feature_requirements.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,9 @@ following S-CORE process guidelines. Feature requirements describe the
high-level features that a software component must implement.
"""

load("//bazel/rules/rules_score:providers.bzl", "SphinxSourcesInfo")
load("//bazel/rules/rules_score:providers.bzl", "FeatureRequirementsInfo", "SphinxSourcesInfo")

# ============================================================================
# Provider Definition
# ============================================================================

FeatureRequirementsInfo = provider(
doc = "Provider for feature requirements artifacts",
fields = {
"srcs": "Depset of source files containing feature requirements",
"name": "Name of the feature requirements target",
},
)
# FeatureRequirementsInfo is re-exported from providers.bzl for backward compatibility.

# ============================================================================
# Private Rule Implementation
Expand Down
Loading
Loading