fix: run bazel-diff in cquery mode under bazelci#3839
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a custom java wrapper script (.bazelci/bin/java and .bazelci/bin/java.bat) to intercept bazel-diff invocations in CI, enabling the injection of cquery options and upgrading to bazel-diff v25.0.0. It also updates .bazelci/presubmit.yml to download the required jar and configure the environment path across various platforms. The review feedback highlights a critical issue in the wrapper script where executing a separate bazel query and joining all discovered test targets with + can exceed the Windows command-line length limit and introduce unnecessary overhead. The reviewer suggests passing the query expression directly to --cqueryExpression instead.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
ai got pretty creative in figuring out how to call bazel-diff in cquery mode 😆 ignore this for now |
We fix the CI breakage on main where bazel-diff target filtering attempted to run platform-incompatible tests. To resolve this cleanly without wrappers or upstream patches: 1. We set EXP_USE_CQUERY=true in the environment of .reusable_config. This natively forces bazelci.py to use 'bazel cquery' instead of 'bazel query' when expanding wildcard targets, which automatically filters out all platform-incompatible tests. 2. We re-apply the visibility fix in tests/uv/lock/pyproject_toml/BUILD.bazel to ensure the cquery analysis phase succeeds without errors.
2bf2438 to
feece6e
Compare
|
there we go, much more sane |
|
since CI is broken and changes to presubmit.yml will cause bazel-diff to be skipped entirely, i'm going to force submit this. |
This PR fixes the CI breakage on main where bazel-diff ran in plain query
mode, ignoring target_compatible_with and attempting to run
platform-incompatible tests.
BazelCI has an
EXP_USE_CQUERYenv variable that uses cquery to identifytargets instead. Try that, which should respect TCW and filter out
targets that would be passed to bazel-diff.