← Back to Pull requests

Allow overriding GITHUB_REF via BAZELCI_GITHUB_REF in bazel-testing #2878

Closed
unknown closed this pull request without merging on Sep 23, 2026 12:15 UTC
View on GitHub
unknown unknown commented on Sep 23, 2026 10:30 UTC
Author

Allow overriding the CI script branch/ref (GITHUB_REF) via the BAZELCI_GITHUB_REF environment variable when running in the bazel-testing Buildkite organization (THIS_IS_TESTING == True).

Motivation


Currently, pipelines in bazel-testing share a single testing branch in bazelbuild/continuous-integration (get_ci_script_ref() falls back to "testing" whenever BUILDKITE_REPO is not bazelbuild/continuous-integration). When multiple engineers test CI changes concurrently, pushing to testing risks overwriting in-flight experiments.

Summary of Changes


  • buildkite/bazelci.py (get_ci_script_ref): Check os.environ.get("BAZELCI_GITHUB_REF") when THIS_IS_TESTING is True (matching existing testing override conventions like BAZELCI_AGENT_REPO and BAZELCI_AGENT_VERSION). Production and trusted orgs (THIS_IS_TESTING == False) continue to unconditionally return "master".

  • buildkite/culprit_finder.py: Use bazelci.GITHUB_REF when constructing SCRIPT_URL so culprit_finder.py also respects BAZELCI_GITHUB_REF (consistent with bcr_presubmit.py and bcr_compatibility.py).

  • buildkite/bazelci_test.py (GetCiScriptRefTest): Add unit tests verifying that BAZELCI_GITHUB_REF overrides the script ref in bazel-testing and is ignored when THIS_IS_TESTING is False.
  • Diff: 168 lines (+126 / -42) across 2 files Reviewer: fweikert Review duration: 105m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 168 lines diff across 2 files
    0.35
    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.307
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2878"
    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: 35.1% (MEDIUM) · Higher = larger blast radius
    35.1%
    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: 13.9% · Safe to merge
    13.9%