From 95471e0e10c07ac445bbb0e855c72cf38461032a Mon Sep 17 00:00:00 2001 From: Arkadiusz Jedrzejewski Date: Mon, 26 Oct 2026 14:42:13 +0100 Subject: [PATCH] build: drop root check aliases and call //tools targets - Remove the root aliases copyright.check, copyright.fix, format.fix, license-check and the root format.check test_suite. - on-pr.yml passes format-target and copyright-target with the //tools labels, as baselibs does. - license_check.yml runs //tools:license-check. - Drop the //:__pkg__ default visibility in tools/BUILD. Only the root test_suite needed it. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/license_check.yml | 2 +- .github/workflows/on-pr.yml | 3 +++ BUILD | 40 ----------------------------- tools/BUILD | 4 --- 4 files changed, 4 insertions(+), 45 deletions(-) diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml index 432f3c843..ef3db3c62 100644 --- a/.github/workflows/license_check.yml +++ b/.github/workflows/license_check.yml @@ -32,6 +32,6 @@ jobs: uses: eclipse-score/cicd-workflows/.github/workflows/license-check.yml@7e8ea4c61756b931622ff979835469b93b162920 # v0.0.3-43-7e8ea4c with: repo-url: "${{ github.server_url }}/${{ github.repository }}" - bazel-target: "run --lockfile_mode=error //:license-check" + bazel-target: "run --lockfile_mode=error //tools:license-check" secrets: dash-api-token: ${{ secrets.ECLIPSE_GITLAB_API_TOKEN }} diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml index e2ee33631..f27ca3074 100644 --- a/.github/workflows/on-pr.yml +++ b/.github/workflows/on-pr.yml @@ -22,5 +22,8 @@ on: jobs: common: uses: eclipse-score/cicd-workflows/.github/workflows/on-pr.yml@7e8ea4c61756b931622ff979835469b93b162920 # v0.0.3-43-7e8ea4c + with: + format-target: "//tools:format.check" + copyright-target: "//tools:copyright.check" permissions: contents: read diff --git a/BUILD b/BUILD index de008693b..74ed22573 100644 --- a/BUILD +++ b/BUILD @@ -49,46 +49,6 @@ exports_files( visibility = ["//tools:__pkg__"], ) -# cicd on-pr.yml detects these root labels with `bazel query`. -# It skips a check when its root label is missing. -# The targets live in //tools. -alias( - name = "copyright.check", - actual = "//tools:copyright.check", - visibility = ["//visibility:public"], -) - -alias( - name = "copyright.fix", - actual = "//tools:copyright.fix", - visibility = ["//visibility:public"], -) - -# This is not an alias on purpose. -# `bazel test` does not expand a test_suite behind an alias. -# The cicd `bazel test //:format.check` would find no tests. -# Tagged manual so that `bazel test //...` skips the format check. -test_suite( - name = "format.check", - tags = ["manual"], - tests = ["//tools:format.check"], - visibility = ["//visibility:public"], -) - -alias( - name = "format.fix", - actual = "//tools:format.fix", - visibility = ["//visibility:public"], -) - -# cicd license-check.yml runs `bazel run //:license-check` (see .github/workflows/license_check.yml). -# The target lives in //tools. -alias( - name = "license-check", - actual = "//tools:license-check", - visibility = ["//visibility:public"], -) - # Generates the product SBOM (SPDX 2.3 + CycloneDX 1.6) for the KVS library. # - Rust crate licenses/suppliers come from the crates.io API via # auto_crates_cache (network access required at build time). diff --git a/tools/BUILD b/tools/BUILD index 5cee46010..7a1ec306b 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -17,10 +17,6 @@ load("@score_tooling//:defs.bzl", "dash_license_checker") load("@score_tooling//third_party/format:macros.bzl", "use_format_targets") load("@score_tools//cr_checker:cr_checker.bzl", "copyright_checker") -# The inner format.check test_suite is generated without a visibility. -# The root test_suite //:format.check needs to see it. -package(default_visibility = ["//:__pkg__"]) - copyright_checker( name = "copyright", exclusion = "copyright_exclusions.txt",