← Back to Pull requests

Avoid unnecessary versioned library checks in cc_helper #871

Open
dzbarsky opened this pull request with 13 lines diff across 1 files
View on GitHub
dzbarsky dzbarsky commented on Sep 08, 2026 19:30 UTC
Author

_get_public_hdrs now checks extensions.DISALLOWED_HDRS_FILES through a dictionary, avoiding repeated linear membership scans. _check_file_extension calls is_versioned_shared_library_extension_valid only when file.extension begins with a digit, as required by versioned .so and .dylib names.

Validation: buildifier -mode=check cc/common/cc_helper.bzl; bazel test //tests/cc/common:cc_library_configured_target_tests //tests/cc/common:cc_import_configured_target_tests (19 tests passed).

Diff: 13 lines (+9 / -4) across 1 files Reviewer: lilygorsheneva Review duration: 30682m
All Vouch review confidence checks passed
Residual risk 0.02 = Change Risk (0.19) × (1 − Review Confidence (0.89)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.19 · 13 lines diff across 1 files
0.19
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 1 substantive comment(s)
0.89
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
89%
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.158
Real PR Conversation Timeline
3 items
lilygorsheneva lilygorsheneva commented on code on Sep 11, 2026 16:57 UTC
Code Review
cc/common/cc_helper.bzl:1
@@ -362,9 +363,13 @@ def _build_precompiled_files(ctx):
     )
 
 def _check_file_extension(file, allowed_extensions, allow_versioned_shared_libraries):
-    extension = "." + file.extension
-    return extension in allowed_extensions or \
-           (allow_versioned_shared_libraries and is_versioned_shared_library_extension_valid(file.path))
+    extension = file.extension
+
+    # The final extension of a versioned .so or .dylib starts with a digit.
+    return "." + extension in allowed_extensions or \
+           (allow_versioned_shared_libraries and len(extension) > 0 and
+            extension[0].isdigit() and

is_versioned_shared_library_extension_valid already checks for isdigit. Same, probably, with length.

lilygorsheneva lilygorsheneva requested changes on Sep 11, 2026 16:57 UTC
Changes Requested Reviewer

Requested changes.

Assignees
dzbarsky dzbarsky
Labels
risk: low confidence: 89.1% 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: 18.8% (LOW) · Higher = larger blast radius
18.8%
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: 89.1% · Lower = rushed or shallow review
89.1%
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: 2.1% · Safe to merge
2.1%