diff --git a/.github/scripts/run_bazel_query_ci.py b/.github/scripts/run_bazel_query_ci.py index 9ad7047025..2f88edc77f 100755 --- a/.github/scripts/run_bazel_query_ci.py +++ b/.github/scripts/run_bazel_query_ci.py @@ -28,11 +28,7 @@ def query_command(args: Sequence[str], env: Mapping[str, str]) -> list[str]: query_args.extend(args[:-2]) query_args.append(args[-1]) - return bazel_command( - *query_args, - env=env, - enable_remote_config=False, - ) + return bazel_command(*query_args, env=env) def main(argv: Sequence[str] | None = None, env: Mapping[str, str] | None = None) -> int: diff --git a/.github/scripts/run_bazel_with_buildbuddy.py b/.github/scripts/run_bazel_with_buildbuddy.py index 281e414200..4503b4fda3 100755 --- a/.github/scripts/run_bazel_with_buildbuddy.py +++ b/.github/scripts/run_bazel_with_buildbuddy.py @@ -152,15 +152,10 @@ def bazel_args_with_remote_config( return [*args[:insertion_idx], *remote_args, *args[insertion_idx:]] -def bazel_command( - *args: str, - env: Mapping[str, str] | None = None, - enable_remote_config: bool = True, -) -> list[str]: +def bazel_command(*args: str, env: Mapping[str, str] | None = None) -> list[str]: env = os.environ if env is None else env bazel = env.get("CODEX_BAZEL_BIN", "bazel") - bazel_args = bazel_args_with_remote_config(args, env) if enable_remote_config else args - return [bazel, *startup_args(args, env), *bazel_args] + return [bazel, *startup_args(args, env), *bazel_args_with_remote_config(args, env)] def main() -> None: diff --git a/.github/scripts/test_run_bazel_query_ci.py b/.github/scripts/test_run_bazel_query_ci.py index a1b465e27a..8f74358441 100644 --- a/.github/scripts/test_run_bazel_query_ci.py +++ b/.github/scripts/test_run_bazel_query_ci.py @@ -33,6 +33,8 @@ class RunBazelQueryCiTest(unittest.TestCase): "--output_user_root=/tmp/output", "--noexperimental_remote_repo_contents_cache", "query", + "--config=buildbuddy-generic", + "--remote_header=x-buildbuddy-api-key=token", "--repo_contents_cache=/tmp/contents", "--repository_cache=/tmp/repository", "--keep_going", @@ -47,7 +49,7 @@ class RunBazelQueryCiTest(unittest.TestCase): with self.assertRaisesRegex(ValueError, "Usage:"): run_bazel_query_ci.query_command(args, {}) - def test_main_runs_query_without_buildbuddy_configuration(self) -> None: + def test_main_runs_query_with_buildbuddy_configuration(self) -> None: with TemporaryDirectory() as temp_dir: temp = Path(temp_dir) args_path = temp / "args.json" @@ -91,6 +93,8 @@ class RunBazelQueryCiTest(unittest.TestCase): [ "--noexperimental_remote_repo_contents_cache", "query", + "--config=buildbuddy-generic", + "--remote_header=x-buildbuddy-api-key=token", "--output=label", "//codex-rs/...", ], diff --git a/.github/scripts/test_run_bazel_with_buildbuddy.py b/.github/scripts/test_run_bazel_with_buildbuddy.py index 0c5d7b11b7..f06e34b895 100644 --- a/.github/scripts/test_run_bazel_with_buildbuddy.py +++ b/.github/scripts/test_run_bazel_with_buildbuddy.py @@ -214,20 +214,6 @@ class RunBazelWithBuildBuddyTest(unittest.TestCase): ], ) - def test_bazel_command_can_explicitly_disable_remote_configuration(self) -> None: - self.assertEqual( - run_bazel_with_buildbuddy.bazel_command( - "query", - "//codex-rs/...", - env={ - "BUILDBUDDY_API_KEY": "token", - "CODEX_BAZEL_BIN": "fake-bazel", - }, - enable_remote_config=False, - ), - ["fake-bazel", "query", "//codex-rs/..."], - ) - def test_main_preserves_spaced_argument_and_child_exit_status(self) -> None: spaced_arg = ( r"--test_env=PATH=C:\Program Files\PowerShell\7;C:\Program Files\Git\bin"