Skip to content

Conversation

@rickeylev
Copy link
Collaborator

This is because the --override_module flag in BCR presubmit configs can't affect local_path_override in MODULE.bazel.

Per bazelbuild/bazel-central-registry#6241 (comment)

This is because the `--override_module` flag in BCR presubmit configs
can't affect local_path_override in MODULE.bazel.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @rickeylev, 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 refactors how the rules_python module is overridden within the build system. The primary goal is to ensure proper module resolution, particularly in environments like Bazel Central Registry presubmits, by moving the override configuration from the MODULE.bazel file to the .bazelrc file. This change resolves a compatibility limitation and streamlines the module override process.

Highlights

  • Override Mechanism Change: The method for overriding the rules_python module has been changed from using local_path_override in MODULE.bazel to using a common --override_module flag in .bazelrc.
  • Compatibility Fix: This change addresses an issue where the --override_module flag in Bazel Central Registry (BCR) presubmit configurations could not correctly affect local_path_override entries in MODULE.bazel.
  • Configuration Centralization: The override logic is now consolidated within the .bazelrc file, providing a more robust and environment-agnostic way to manage module overrides for rules_python.
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
Contributor

@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 correctly moves the rules_python module override from MODULE.bazel to .bazelrc for the bzlmod_build_file_generation example. This change is necessary for compatibility with Bazel Central Registry (BCR) presubmits, which cannot override local_path_override directives. My feedback includes a suggestion to improve the clarity of the new comment in .bazelrc to make the reasoning more explicit for future maintainers.

Comment on lines 11 to 13
# NOTE: rules_python MUST be overridden using bazelrc config.
# This is because the BCR presubmits run with a different directory
# structure, so override this to remove the override.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The comment explaining the need for this override is a bit confusing, especially the phrase 'so override this to remove the override'. For better clarity and maintainability, I suggest rephrasing it to more directly explain how this change helps with BCR presubmits.

# NOTE: rules_python MUST be overridden using bazelrc config.
# This is because BCR presubmits cannot override a `local_path_override`
# in MODULE.bazel. This allows BCR presubmits to disable the override
# by passing `--override_module=rules_python=`.

@rickeylev rickeylev enabled auto-merge October 28, 2025 05:48
@rickeylev rickeylev mentioned this pull request Oct 28, 2025
17 tasks
@rickeylev rickeylev added this pull request to the merge queue Oct 28, 2025
Merged via the queue into bazel-contrib:main with commit caab0fa Oct 28, 2025
4 checks passed
@rickeylev rickeylev deleted the fix.bcr.gazelle.presubmit branch October 28, 2025 06:07
rickeylev added a commit that referenced this pull request Oct 29, 2025
This is because the `--override_module` flag in BCR presubmit configs
can't affect local_path_override in MODULE.bazel.

Per
bazelbuild/bazel-central-registry#6241 (comment)

(cherry picked from commit caab0fa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants