Skip to content

coverage: adopt the LLVM coverage pipeline from score_tooling 2.2.1 - #62

Open
dcalavrezo-qorix wants to merge 1 commit into
mainfrom
dcalavrezo_coverage
Open

dcalavrezo-qorix wants to merge 1 commit into
mainfrom
dcalavrezo_coverage

Conversation

@dcalavrezo-qorix

@dcalavrezo-qorix dcalavrezo-qorix commented Sep 3, 2026

Copy link
Copy Markdown

What

Replaces the gcov/genhtml coverage flow with the shared LLVM source-based pipeline from @score_tooling//coverage (adoption guide), bumping score_tooling to 2.2.1 and collapsing the old git_override (2.2.1 contains the sphinx features it existed for; its svglib patch is obsolete and deleted). One bazel coverage --config=llvm_cov run over the acceptlist test targets produces line and branch coverage, exact 0% entries for untested in-scope files, a justification mechanism and a threshold gate (report-only, COVERAGE_THRESHOLD: "0").

Validation (local, x86_64-linux)

  • 15/15 acceptlist tests pass
  • 93.68% lines (608/649), 97.66% branches (167/171)
  • 22 files in the report; 3 at exact 0% (the untested json_helper implementation — invisible to the old flow)
  • Gate verified at thresholds 0 / 100; format.check, copyright.check and the PlantUML parse of static_design.puml (architectural_design under 2.x) all green

Scope: anchored to deps_acceptlist.json

The public repository builds only the acceptlist surface — the full //score tree references targets that exist only in the internal overlay (factory:factory_socal_r20_11 via the custom.bzl stub, @score_persistency//:kvs_cpp consumers). The coverage scope therefore lists the production libraries from buildable_targets, and .github/tools/check_coverage_scope.sh (first workflow step, same mechanism as eclipse-score/baselibs#533) fails CI when an acceptlist library is neither in scope nor justified in tools/coverage/scope_exclusions.txt — adding a library to the acceptlist forces the scope decision.

Four 2.x-bump fixes bundled (each would break the build on any future renovate bump)

Fix Cause
bazel/toolchains libclang migrated to the 2.x API old cxx_builtin_include/extra_config_site attrs removed; cc_toolchain now mandatory (mirrors score_tooling's own instance)
new override patch for score_persistency 0.3.2 its root BUILD loads rust_coverage_report, removed in 2.x → the whole external package failed to evaluate ("no such target kvs_cpp")
stdlib = "stdc++" pinned on the default LLVM 19.1.0 instance toolchains_llvm 1.6.0→1.8.0 (needed for the coverage instance) switches to bundled libc++ and emits -stdlib=libc++, an unused-argument error under warnings-as-errors in plain builds
--check_visibility=false in the coverage config only scope deps hit visibility walls that CI never sees (acceptlist targets are built top-level, bypassing visibility). Chosen over visibility grants in a dozen team-owned BUILD files; all regular jobs still enforce visibility

Pre-existing failure, not this PR

The build-docs / Build Documentation job fails on this PR with config_provider_impl_test.cpp: error: no matching function for call to 'async' — the identical error (same file, same lines) fails every docs.yml run on main since at least 2026-08-12 (runs on e0489b1, f0d4f67, c7fd075), long before this change. Locally, bazel build //:docs succeeds on this branch. Fixing that test's std::async usage under the docs job's clang compile is a separate, pre-existing issue.

Notes

  • Coverage-only Clang 22.1.7 instance (llvm_toolchain_coverage); regular builds keep the default 19.1.0 toolchain untouched.
  • coverage_report.yml keeps its name and artifact name (*_cpp_coverage_report); lcov/genhtml steps dropped; scope check added as the first step.
  • trlc/lobster git_overrides (pinned to an old tooling era) are compatible with 2.2.1 — docs, PlantUML and copyright paths all build; left untouched.
  • No Bazel Rust targets exist yet; the coverage config documents what to add when Rust lands.

Replace the gcov/genhtml flow with the shared LLVM source-based
pipeline from @score_tooling//coverage: line + branch coverage, exact
0% baselines for untested in-scope files, a justification mechanism
and a threshold gate (report-only at introduction).

The score_tooling 1.2.0-era git_override is collapsed into a plain
2.2.1 dep (2.2.1 contains the sphinx features the override existed
for, and no longer uses svglib - that patch is deleted). The bump
surfaced four issues, all fixed here:

- bazel/toolchains: the repo-local libclang_toolchain used the removed
  cxx_builtin_include/extra_config_site attrs; migrated to the 2.x API
  (cc_toolchain attr, mirroring score_tooling's own instance).
- score_persistency 0.3.2's root BUILD loads rust_coverage_report,
  which 2.x removed - the whole external package failed to evaluate
  (manifesting as 'no such target kvs_cpp'). A second override patch
  strips the dead load/target.
- toolchains_llvm 1.6.0 -> 1.8.0 (needed for the coverage instance)
  changes the default 19.1.0 instance to bundled libc++, breaking
  plain builds under warnings-as-errors; stdlib is pinned to stdc++
  to preserve the 1.6.0 behavior.
- The scope's direct deps hit visibility walls (CI builds acceptlist
  targets as top-level, bypassing visibility; deps edges do not).
  Instead of granting visibility in a dozen team-owned BUILD files,
  the coverage config sets --check_visibility=false (coverage-only;
  every regular job still enforces visibility).

Scope and completeness checker are anchored to deps_acceptlist.json -
the public repo builds only that surface (the full //score tree
references internal-overlay-only targets such as factory_socal_r20_11).

Validation (local): 15/15 acceptlist tests pass, 93.68% lines
(608/649), 97.66% branches (167/171), 22 files in the report, 3 at
exact 0% (untested json_helper impl), gate verified at thresholds 0
and 100; format.check, copyright.check, the scope checker and the
architectural_design PlantUML parse all green under 2.2.1.
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: 2b2dfe09-baae-4799-8574-e0fb4c4ec6c4
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'platforms', the root module requires module version platforms@1.0.0, but got platforms@1.1.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_rust', the root module requires module version rules_rust@0.68.1-score, but got rules_rust@0.68.2-score in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'aspect_rules_lint', the root module requires module version aspect_rules_lint@2.3.0, but got aspect_rules_lint@2.5.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'grpc-java', the root module requires module version grpc-java@1.70.0, but got grpc-java@1.78.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 3 packages loaded
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Loading: 3 packages loaded
    currently loading: 
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)
Analyzing: target //:license-check (4 packages loaded, 0 targets configured)

Analyzing: target //:license-check (65 packages loaded, 10 targets configured)

Analyzing: target //:license-check (93 packages loaded, 10 targets configured)

Analyzing: target //:license-check (93 packages loaded, 10 targets configured)

Analyzing: target //:license-check (153 packages loaded, 3083 targets configured)

Analyzing: target //:license-check (175 packages loaded, 6531 targets configured)

Analyzing: target //:license-check (175 packages loaded, 6531 targets configured)

Analyzing: target //:license-check (182 packages loaded, 11655 targets configured)

Analyzing: target //:license-check (182 packages loaded, 11655 targets configured)

Analyzing: target //:license-check (182 packages loaded, 11655 targets configured)

Analyzing: target //:license-check (183 packages loaded, 11775 targets configured)

Analyzing: target //:license-check (183 packages loaded, 11775 targets configured)

INFO: Analyzed target //:license-check (184 packages loaded, 19242 targets configured).
[12 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 2 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 184.310s, Critical Path: 2.07s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant