From 0b933eb75fd5cfaf37919e4d30ec78c1259e1946 Mon Sep 17 00:00:00 2001 From: Jan Ehrensperger Date: Thu, 24 Sep 2026 11:01:56 +0200 Subject: [PATCH] [rules score] Add Rules_Score Aspect for simpler result CI-upload Exports every dependable_element's doc/report artifacts as an opt-in output group, so CI can collect them across a whole workspace without a dedicated build step. --- bazel/aspects/rules_score/BUILD | 14 +++ bazel/aspects/rules_score/README.md | 75 +++++++++++++ .../rules_score/dependable_element_export.bzl | 102 ++++++++++++++++++ 3 files changed, 191 insertions(+) create mode 100644 bazel/aspects/rules_score/BUILD create mode 100644 bazel/aspects/rules_score/README.md create mode 100644 bazel/aspects/rules_score/dependable_element_export.bzl diff --git a/bazel/aspects/rules_score/BUILD b/bazel/aspects/rules_score/BUILD new file mode 100644 index 00000000..e2bcbd07 --- /dev/null +++ b/bazel/aspects/rules_score/BUILD @@ -0,0 +1,14 @@ +# ******************************************************************************* +# 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 +# ******************************************************************************* + +exports_files(["dependable_element_export.bzl"]) diff --git a/bazel/aspects/rules_score/README.md b/bazel/aspects/rules_score/README.md new file mode 100644 index 00000000..0c47b96e --- /dev/null +++ b/bazel/aspects/rules_score/README.md @@ -0,0 +1,75 @@ + + +# `dependable_element_export` aspect + +Collects the doc/report artifacts of every `dependable_element()` (rules_score SEooC) reached by +a build and republishes them under a uniform `_dependable_element_export/` path segment, as a +dedicated, explicitly requestable output group. + +It is designed to be added to an **existing** build invocation without changing what that build +produces for any other target: the aspect no-ops for every target that does not carry the +`DependableElementInfo` provider, and its outputs are only built when you ask for the +`dependable_element_export` output group. + +## Usage + +```sh +bazel build // \ + --aspects=@score_tooling//bazel/aspects/rules_score:dependable_element_export.bzl%dependable_element_export_aspect \ + --output_groups=+dependable_element_export \ + --remote_download_regex=".*/_dependable_element_export/.*" +``` + +The three flags are independent and all required: + +| Flag | Why | +| --- | --- | +| `--aspects=` | Attaches the aspect. Note the value is `