-
Notifications
You must be signed in to change notification settings - Fork 0
Anywhere cache samples v4 test #43
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
base: anywhere_cache_samples_v4
Are you sure you want to change the base?
Anywhere cache samples v4 test #43
Conversation
Summary of ChangesHello @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
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
|
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 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.
google-cloud-storage-control/samples/storage_control_disable_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_pause_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_resume_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_list_anywhere_caches.rb
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_create_anywhere_cache.rb
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_update_anywhere_cache.rb
Show resolved
Hide resolved
1bb5b24 to
e7300d5
Compare
|
/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 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.
google-cloud-storage-control/samples/storage_control_disable_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_pause_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_resume_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_create_anywhere_cache.rb
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_update_anywhere_cache.rb
Show resolved
Hide resolved
|
/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 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.
google-cloud-storage-control/samples/acceptance/storage_control_anywhere_cache_test.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/acceptance/storage_control_anywhere_cache_test.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_disable_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_create_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_disable_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_get_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_pause_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_resume_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_update_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
|
/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 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.
google-cloud-storage-control/samples/storage_control_create_anywhere_cache.rb
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_update_anywhere_cache.rb
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_create_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
google-cloud-storage-control/samples/storage_control_get_anywhere_cache.rb
Outdated
Show resolved
Hide resolved
|
/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 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.
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:
bundle exec rake ciin the gem subdirectory.closes: #<issue_number_goes_here>