Split coverage features into `coverage_enabled` and `coverage_instrumented` #842
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 180 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.311
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #842"
general
weight: 0.35
lilygorsheneva
Before this change, rules_cc only enabled a single coverage feature when building with coverage, which doesn't directly allow toolchains to distinguish between targets that are instrumented for coverage and those which are not. The default toolchain thus ends up instrumenting everything even with a narrow
--instrumentation_filter, which is wasteful. Blaze relies on the presence of thegcov_gcno_filevariable to avoid this, but that's really more of a hack and undocumented (and also undocumentable).This change lets rules_cc request two new coverage-related features:
coverage_enabledis requested whenever coverage is generally enabled (matchingcoverage), whereascoverage_instrumentedis only requested when the current target is instrumented. This provides a clean way for toolchains to instrument only those targets that require it (see https://github.com/bazelbuild/rules_cc/pull/424 for an example of such a toolchain).Along the way, implementation_deps is added to the check for an instrumented dependency, which apparently wasn't updated when this attribute was added.
Older versions of rules_cc only request
coverage, so toolchains that want to support them as well can keep their existingcoverageflag sets and guard them withwith_feature_set(not_features = ["coverage_enabled"]).Fixes https://github.com/bazelbuild/bazel/issues/15627
Fixes https://github.com/bazelbuild/bazel/issues/21911