-
-
Notifications
You must be signed in to change notification settings - Fork 630
feat(runfiles): support for --incompatible_compact_repo_mapping_manifest #3277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(runfiles): support for --incompatible_compact_repo_mapping_manifest #3277
Conversation
Summary of ChangesHello @jklukas, 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 integrates support for Bazel's Highlights
Using Gemini Code AssistThe 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
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 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
|
cc @fmeum for review |
There was a problem hiding this 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 adds support for Bazel's --incompatible_compact_repo_mapping_manifest
flag, which is a great feature for improving performance with bzlmod. The implementation is solid and includes a comprehensive set of tests. My review includes suggestions for a performance optimization in the new mapping logic, a fix for an outdated docstring, and some refactoring opportunities in both the implementation and the tests to improve maintainability and readability.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to push some changes, but noticed that "maintainer can modify" isn't set.
Mostly LGTM, but please remove all the Mapping API compatibility code. As an internal class, there's no need for it to support the wide range of dict operations.
Co-authored-by: Richard Levasseur <[email protected]>
Thank you for the quick review! I believe all comments are now addressed. I removed the |
/gemini review |
There was a problem hiding this 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 adds support for Bazel's --incompatible_compact_repo_mapping_manifest
flag, which uses prefix-based repository mappings. The implementation introduces a _RepositoryMapping
class to handle both exact and new prefix-based mappings, which is a clean way to encapsulate the logic. The accompanying tests are thorough and cover various scenarios including precedence and ordering.
I've found a couple of areas for improvement. First, in Rlocation
, there's an opportunity to refactor the logic to avoid a redundant lookup and remove some unreachable code, making it more efficient and maintainable. Second, in _RepositoryMapping.create_from_file
, adding a check for empty lines in the manifest file would make the parsing more robust.
Overall, this is a great addition that addresses an important performance issue with large dependency graphs in Bazel.
Gentle ping for reviewers to take another look after pushing fixes. |
Thanks for implementing this! |
Thanks for the review and getting this landed! |
Under bzlmod, the repo mapping can become quite large (i.e. tens of megabytes)
because its size scales as a factor of the number of repos in the transitive
dependencies.
To address this, the --incompatible_compact_repo_mapping_manifest flag was introduced.
This changes the repo mapping formation to use prefixes (instead of exact repo names)
for mapping things.
To make this work with the runfiles library, the code has to be updated to handle
these prefixes instead of just exact strings.
Fixes #3022.