Skip to content

Conversation

@agluszak
Copy link
Collaborator

Checklist

  • I have filed an issue about this change and discussed potential changes with the maintainers.
  • I have received the approval from the maintainers to make this change.
  • This is not a stylistic, refactoring, or cleanup change.

Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See
the Contributions section in the README for more
details.

Discussion thread for this change

Issue number: <please reference the issue number or url here>

Description of this change

LeFrosch and others added 6 commits December 1, 2025 10:49
# Conflicts:
#	MODULE.bazel.lock
…54e3d5aeae301c22283042852c

# Conflicts:
#	.bazelversion
#	MODULE.bazel
#	MODULE.bazel.lock
#	testing/src/com/google/idea/testing/headless/HeadlessTestCase.java
@gemini-code-assist
Copy link

Summary of Changes

Hello @agluszak, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on upgrading the project's build system to Bazel 9.0.0rc3. This upgrade involved a cascading set of changes, including updating module dependencies, applying specific compatibility patches for rules_android and rules_kotlin to resolve versioning and platform-specific issues, and adjusting internal test infrastructure to reflect new Bazel API behaviors. The overall goal is to ensure the project remains compatible with the latest Bazel features and improvements.

Highlights

  • Bazel Version Upgrade: The core Bazel version has been updated from "8.5.0" to "9.0.0rc3" in the .bazelversion file.
  • Module Dependency Updates: Numerous module dependencies in MODULE.bazel and MODULE.bazel.lock have been updated to ensure compatibility with Bazel 9, including new entries for aspect_bazel_lib and rules_android, and version bumps for rules_kotlin, protobuf, and various other rules and libraries.
  • Rules_Android Compatibility Fix: A new patch (remove_sdk_check.patch) was added to rules_android to bypass a minimum SDK version check, facilitating its use with Bazel 9.
  • Rules_Kotlin Bazel 9 & Windows Fixes: Multiple patches were introduced for rules_kotlin (bazel_9.patch, jarjar.patch, win_classpath.patch) to address Bazel 9 compatibility, update protobuf versions, resolve a jarjar issue, and fix classpath problems on Windows when using bzlmod.
  • Internal API & Test Adjustments: Several test files and internal utility functions were modified to align with changes in Bazel's C++ rule API, external artifact paths, Python rule introspection, and the handling of Bazel info in headless tests.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates Bazel to version 9.0.0rc3 and makes the necessary adjustments to dependencies and test code. The changes are mostly correct, but there are a few issues to address.

Most importantly, the refactoring in HeadlessTestCase.java has introduced several compilation errors. I've provided a critical-severity comment with a suggested fix. Please also note that there appears to be another compilation error in the new getTestBazelInfo method where an args variable is used but not defined in an abort call; this was not part of the diff, so I couldn't comment directly on it.

Additionally, I've left a couple of medium-severity comments in MODULE.bazel to fix a typo and remove some commented-out code to improve maintainability.

Comment on lines 166 to 169
final var bazelBinary = getTestBazelPath();
BlazeUserSettings.getInstance().setBazelBinaryPath(bazelBinary.toString());

myBazelInfo = BazelInfo.parse(exec(bazelBinary.toString(), "info"));
myBazelInfo = getTestBazelInfo(bazelBinary);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces several compilation errors. The field myBazelInfo has been removed, but it's still being assigned to. The getTestBazelInfo method is called with an argument, but it's declared with no parameters. Additionally, the new myBazelBinary field is not initialized, which would cause a NullPointerException inside getTestBazelInfo. The following change should fix these issues.

    myBazelBinary = getTestBazelPath();
    BlazeUserSettings.getInstance().setBazelBinaryPath(myBazelBinary.toString());

    getTestBazelInfo();

bazel_dep(name = "rules_pkg", version = "1.1.0")
bazel_dep(name = "rules_jvm_external", version = "6.9")

# temporary to bump version of the transitve dependency (drop wit Bazel 9 release)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There are a couple of typos in this comment. transitve should be transitive and wit should be with.

Suggested change
# temporary to bump version of the transitve dependency (drop wit Bazel 9 release)
# temporary to bump version of the transitive dependency (drop with Bazel 9 release)

Comment on lines +49 to +60
# git_override(
# module_name = "rules_kotlin",
# commit = "89fd270f1e77766ee6afa2f658c327771b90a3ce",
# patch_strip = 1,
# patches = [
# "//third_party/kotlin/patches:strip_stdlib.patch",
# "//third_party/kotlin/patches:win_classpath.patch",
# "//third_party/kotlin/patches:bazel_9.patch",
# "//third_party/kotlin/patches:jarjar.patch",
# ],
# remote = "https://github.com/bazelbuild/rules_kotlin.git",
# )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This git_override is commented out. If it's no longer needed, it should be removed to avoid cluttering the build file. If it's for reference, consider adding a comment explaining its purpose and when it might be needed again, although removing it is generally preferred for better maintainability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review Awaiting review from Bazel team on PRs product: CLion CLion plugin

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

4 participants