← Back to Pull requests

Add BCR downstream test script and pipeline #2875

Closed
unknown closed this pull request without merging on Oct 05, 2026 11:45 UTC
View on GitHub
unknown unknown commented on Sep 22, 2026 11:36 UTC
Author

Adds bcr_downstream.py and the BCR Downstream Test pipeline. The pipeline tests whether a new BCR module version breaks the modules that directly depend on it.

  • Trigger: a BCR PR with the run-downstream-test label, or a manual build with TARGET_MODULE (e.g. protobuf@latest). A build tests one target module version. If a PR changes several, set TARGET_MODULE to pick one.

  • Downstream modules: the latest versions of the top 50 direct dependents of the target, ranked by BCR PageRank (//tools:module_analyzer --dependents_of).

  • Override: each job vendors the target with bazel vendor and adds --override_module=<target>=<vendored_path> to the downstream module's .bazelrc. This covers both anonymous module and bcr_test_module tasks.

  • Bazel versions: downstream tasks use the Bazel versions in their own presubmit.yml. Tasks on a major version that the target doesn't test are skipped. If USE_BAZEL_VERSION is set, all tasks run with that version instead. The target is vendored with each task's Bazel version, or 7.x for Bazel 6, which has no bazel vendor.

  • Options: SELECT_TOP_BCR_MODULES, MODULE_SELECTIONS, SMOKE_TEST_PERCENTAGE, EXCLUDE_DEV_DEPS and USE_BAZEL_VERSION can be set as environment variables, or in lowercase under bcr_downstream_test in the target's presubmit.yml. Environment variables take precedence.

  • CI usage: by default, jobs use up to 10% of machines per queue (CI_RESOURCE_PERCENTAGE), in a separate bcr-downstream-test-queue-<queue> concurrency group so they don't starve bcr-presubmit. Job priority is -50, or -100 with the low-ci-priority label.
  • The pipeline is added in terraform and documented in the README.

    Uses --dependents_of from https://github.com/bazelbuild/bazel-central-registry/pull/10649.

    Diff: 228 lines (+171 / -57) across 2 files Reviewer: Wyverald Review duration: 18728m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 228 lines diff across 2 files
    0.37
    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.325
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2875"
    general weight: 0.35
    Reviewers
    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: 37.0% (MEDIUM) · Higher = larger blast radius
    37.0%
    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.6% · Safe to merge
    14.6%