← Back to Pull requests

Split coverage features into `coverage_enabled` and `coverage_instrumented` #842

Closed
unknown closed this pull request without merging on Sep 18, 2026 23:30 UTC
View on GitHub
unknown unknown commented on Aug 11, 2026 09:00 UTC
Author

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 the gcov_gcno_file variable 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_enabled is requested whenever coverage is generally enabled (matching coverage), whereas coverage_instrumented is 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 existing coverage flag sets and guard them with with_feature_set(not_features = ["coverage_enabled"]).

Fixes https://github.com/bazelbuild/bazel/issues/15627
Fixes https://github.com/bazelbuild/bazel/issues/21911

Diff: 180 lines (+135 / -45) across 2 files Reviewer: lilygorsheneva Review duration: 55589m
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
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 35.5% (MEDIUM) · Higher = larger blast radius
35.5%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14% · Safe to merge
14%