Skip to content

Conversation

@fmeum
Copy link
Collaborator

@fmeum fmeum commented Dec 5, 2025

Get the target path from the InputMetadataProvider instead and avoid I/O that way.

Instead, get the target path from the `InputMetadataProvider` instead.
@gemini-code-assist
Copy link

Summary of Changes

Hello @fmeum, 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 introduces a significant optimization in how symlink targets are resolved within the system. By integrating an InputMetadataProvider into key areas like SourceManifestAction and MerkleTreeComputer, the system can now efficiently retrieve symlink target paths from cached metadata. This change is designed to enhance performance by minimizing direct file system interactions and ensuring a more consistent approach to handling symbolic links.

Highlights

  • Optimized Symlink Resolution: The pull request modifies how symlink targets are resolved by prioritizing the use of an InputMetadataProvider to retrieve the unresolved symlink target, rather than performing direct file system reads.
  • Reduced I/O Operations: By leveraging cached metadata from the InputMetadataProvider, the change aims to prevent unnecessary and potentially costly file system reads, especially for unresolved symlinks.
  • Refactoring SourceManifestAction: The writeFile method in SourceManifestAction has been updated to accept an InputMetadataProvider, and its call sites now pass the provider when available, enabling the optimized symlink resolution.
  • Merkle Tree Generation Improvement: The process of building Merkle trees now also utilizes the InputMetadataProvider to obtain symlink targets, ensuring consistency and efficiency across different components.
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 introduces an optimization to avoid unnecessary filesystem reads for unresolved symlinks. Instead of reading the symlink target from the filesystem, the change leverages the InputMetadataProvider to get the cached target path. This is applied in SourceManifestAction and MerkleTreeComputer.

The changes look good and align with the goal of improving performance. However, I've found a potential NullPointerException in SourceManifestAction where the result of getInputMetadata is not checked for null before being used. I've added a comment with a suggestion to fix this, making the code more robust and consistent with the changes in MerkleTreeComputer.

@fmeum fmeum marked this pull request as ready for review December 5, 2025 20:12
@fmeum fmeum requested review from a team as code owners December 5, 2025 20:12
@fmeum fmeum requested review from dabanki and tjgq and removed request for a team December 5, 2025 20:12
@github-actions github-actions bot added team-Performance Issues for Performance teams team-Configurability platforms, toolchains, cquery, select(), config transitions team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Dec 5, 2025
@fmeum fmeum removed the request for review from a team December 5, 2025 20:42
@fmeum
Copy link
Collaborator Author

fmeum commented Dec 5, 2025

@bazel-io fork 9.0.0

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

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-Configurability platforms, toolchains, cquery, select(), config transitions team-Performance Issues for Performance teams team-Remote-Exec Issues and PRs for the Execution (Remote) team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant