)]}'
{
  "commit": "386a1651b86c94b7a89dd55494b3a5d320fa9dcf",
  "tree": "4cdedb1ba1a3ed50f8e8d87d2e4391c394c65704",
  "parents": [
    "d8389959c3529e679517d70bc2c6275af371eef5"
  ],
  "author": {
    "name": "Yun Peng",
    "email": "pcloudy@google.com",
    "time": "Wed Sep 23 14:15:57 2026 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Sep 23 14:15:57 2026 +0200"
  },
  "message": "Allow overriding GITHUB_REF via BAZELCI_GITHUB_REF in bazel-testing (#2878)\n\nAllow overriding the CI script branch/ref (`GITHUB_REF`) via the\n`BAZELCI_GITHUB_REF` environment variable when running in the\n`bazel-testing` Buildkite organization (`THIS_IS_TESTING \u003d\u003d True`).\n\n### Motivation\nCurrently, pipelines in `bazel-testing` share a single `testing` branch\nin `bazelbuild/continuous-integration` (`get_ci_script_ref()` falls back\nto `\"testing\"` whenever `BUILDKITE_REPO` is not\n`bazelbuild/continuous-integration`). When multiple engineers test CI\nchanges concurrently, pushing to `testing` risks overwriting in-flight\nexperiments.\n\n### Summary of Changes\n- **`buildkite/bazelci.py` (`get_ci_script_ref`)**: Check\n`os.environ.get(\"BAZELCI_GITHUB_REF\")` when `THIS_IS_TESTING` is `True`\n(matching existing testing override conventions like\n`BAZELCI_AGENT_REPO` and `BAZELCI_AGENT_VERSION`). Production and\ntrusted orgs (`THIS_IS_TESTING \u003d\u003d False`) continue to unconditionally\nreturn `\"master\"`.\n- **`buildkite/culprit_finder.py`**: Use `bazelci.GITHUB_REF` when\nconstructing `SCRIPT_URL` so `culprit_finder.py` also respects\n`BAZELCI_GITHUB_REF` (consistent with `bcr_presubmit.py` and\n`bcr_compatibility.py`).\n- **`buildkite/bazelci_test.py` (`GetCiScriptRefTest`)**: Add unit tests\nverifying that `BAZELCI_GITHUB_REF` overrides the script ref in\n`bazel-testing` and is ignored when `THIS_IS_TESTING` is `False`.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ab9fe4de774074b1832c996c9346644ec01293e3",
      "old_mode": 33261,
      "old_path": "buildkite/bazelci.py",
      "new_id": "deb7a2b31ce5a75c60be1a2bad507756021b7821",
      "new_mode": 33261,
      "new_path": "buildkite/bazelci.py"
    },
    {
      "type": "modify",
      "old_id": "5f9bf5e862eb824d521168d0024e1afcf25ec6fb",
      "old_mode": 33261,
      "old_path": "buildkite/bazelci_test.py",
      "new_id": "d766125ac7ab4ec2ea6bf6dd5fba483819a35ae6",
      "new_mode": 33261,
      "new_path": "buildkite/bazelci_test.py"
    },
    {
      "type": "modify",
      "old_id": "1b739444afc267105bf76550e755385f10327617",
      "old_mode": 33261,
      "old_path": "buildkite/culprit_finder.py",
      "new_id": "f47ef5b7ff7740c3072f7b339942b89bd583d6c8",
      "new_mode": 33261,
      "new_path": "buildkite/culprit_finder.py"
    }
  ]
}
