Skip to content

Conversation

@shubhangi-google
Copy link
Owner

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea.
  • Follow the instructions in CONTRIBUTING. Most importantly, ensure the tests and linter pass by running bundle exec rake ci in the gem subdirectory.
  • Update code documentation if necessary.

closes: #<issue_number_goes_here>

@gemini-code-assist
Copy link

Summary of Changes

Hello @shubhangi-google, 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 significantly enhances the Google Cloud Storage Control Ruby client by adding new samples and an acceptance test for the Anywhere Cache feature. The changes provide developers with clear, executable examples for managing Anywhere Caches, covering all primary operations from creation to disabling. This ensures the feature is well-documented with practical use cases and rigorously tested for reliability.

Highlights

  • New Anywhere Cache Samples: Introduced a comprehensive set of Ruby samples demonstrating the full lifecycle of Google Cloud Storage Anywhere Caches, including creation, listing, retrieval, updating, pausing, resuming, and disabling.
  • Acceptance Test for Anywhere Cache: Added a new acceptance test file (storage_control_anywhere_cache_test.rb) to validate the end-to-end functionality of Anywhere Cache operations, ensuring proper integration and behavior.
  • Helper Method Refactoring and New Utility: Refactored the storage_client initialization in helper.rb for better reusability and added a count_anywhere_caches helper method with exponential backoff, crucial for robust test cleanup by waiting for caches to be fully deleted.
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

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 a comprehensive set of samples and acceptance tests for the Storage Control Anywhere Cache feature. The changes are well-structured, adding new sample files for the entire lifecycle of a cache (create, list, get, update, pause, resume, disable) and a corresponding acceptance test to validate them. My review identifies a few critical issues where tests would fail due to mismatched output, a high-severity issue with incorrect handling of API pagination, and several medium-severity suggestions to refactor polling logic for better readability and to reduce code duplication. Addressing these points will improve the correctness and maintainability of the new samples.

@shubhangi-google shubhangi-google force-pushed the anywhere_cache_samples_v4_test branch from 1bb5b24 to e7300d5 Compare September 22, 2025 13:29
@shubhangi-google
Copy link
Owner Author

/gemini review

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 a comprehensive set of samples and acceptance tests for the Anywhere Cache feature in Storage Control. The changes are well-structured, with a dedicated test file exercising the lifecycle of a cache through the new sample scripts.

My review includes a few suggestions:

  • Refactoring the polling loops in the helper and sample files to be more idiomatic and readable.
  • Correcting the output format for the cache state in several samples to align with test expectations and provide more user-friendly messages.

These changes will improve the maintainability of the new code and ensure the tests pass as expected. Overall, this is a great addition.

@shubhangi-google shubhangi-google changed the base branch from main to anywhere_cache_samples_v4 October 1, 2025 20:47
@shubhangi-google
Copy link
Owner Author

/gemini review

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 the Anywhere Cache samples by adding documentation, improving polling logic, and standardizing output messages. While these are good improvements, there are several critical issues that will cause the acceptance tests to fail due to mismatched output strings. Additionally, all updated samples now rescue StandardError, which is overly broad and should be changed to a more specific exception type like Google::Cloud::Error to avoid masking potential bugs. I've left detailed comments with suggestions to address these points.

@shubhangi-google
Copy link
Owner Author

/gemini review

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 the Anywhere Cache samples by adding documentation, standardizing output messages, and refining the polling logic. The changes are generally positive, improving clarity and robustness. My review identifies a few key areas for improvement: there are critical logic issues in the polling loops for cache creation and updates that could lead to infinite loops, a potential error-handling bug in one of the scripts, and a minor inconsistency in an error message. Addressing these points will make the samples more reliable.

@shubhangi-google
Copy link
Owner Author

/gemini review

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 improves the Anywhere Cache samples by adding documentation, more user-friendly output messages, and polling for long-running operations. While these are great enhancements, I've identified a few issues. There are some inconsistencies in the output messages that should be standardized. More importantly, there are critical bugs in the polling logic for create and update operations that could cause the samples to fail incorrectly or hang. My review includes suggestions to fix these issues.

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