Samples(Storage): Add sample and test for ListBuckets With Partial Success#19
Samples(Storage): Add sample and test for ListBuckets With Partial Success#19mahendra-google wants to merge 1 commit intomainfrom
Conversation
Summary of ChangesHello @mahendra-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 introduces a new C# sample for the Google Cloud Storage client library, focusing on the 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.
Code Review
The pull request adds a new sample and corresponding test for listing storage buckets with returnPartialSuccess. My review focuses on improving the efficiency and clarity of both the sample code and the test. The current implementation in both files leads to redundant API calls by enumerating the paged results multiple times. I've provided suggestions to refactor the code to fetch and process the API responses efficiently in a single pass. This involves changing the sample method to return the processed lists of reachable and unreachable buckets, and updating the test to use this new, more efficient interface. These changes will ensure the sample demonstrates best practices and the test is both correct and performant.
|
/Gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new sample and test for listing buckets with partial success, which is a useful feature for handling transient regional outages. The changes are well-structured, with a new sample, a corresponding test, and necessary modifications to the test fixture and project dependencies. My review includes one suggestion to improve the efficiency of the new sample code by optimizing how paged results are processed.
|
/Gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new code sample and a corresponding test for listing buckets with partial success, which is a useful feature. The implementation is correct and the test validates the primary success path. I've added a few suggestions to improve code conciseness and efficiency in both the sample and the test file by making better use of LINQ and avoiding unnecessary collection copying. Overall, this is a good addition.
|
/Gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new code sample demonstrating the ReturnPartialSuccess option for listing buckets, which is a valuable addition. The implementation is straightforward and effectively shows how to handle both reachable and unreachable buckets. My review includes a suggestion to make the sample more intuitive for users by adjusting a default parameter. I've also highlighted the need for unit tests to ensure the new sample's functionality is covered. The package version update is appropriate for the new feature.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new code sample demonstrating the ReturnPartialSuccess option for listing buckets in Google Cloud Storage. The changes are well-structured, including the sample itself, a unit test to verify its functionality, and necessary updates to the test fixture and project dependencies. The code is correct and effectively illustrates how to handle partially successful responses. I've provided one minor suggestion to improve the code documentation for better clarity and to fix a potential compiler warning.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new code sample demonstrating the ReturnPartialSuccess option for listing buckets in Google Cloud Storage. The changes include the sample code itself, a corresponding test, a minor modification to the test fixture, and a necessary dependency update. The code is clear and effectively illustrates the feature. I've provided a couple of minor suggestions to enhance code style and documentation consistency.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new code sample and corresponding test for listing buckets with partial success, using the ReturnPartialSuccess option. The changes are well-implemented: the sample code in ListBucketsWithPartialSuccess.cs is clear and demonstrates how to handle both reachable and unreachable buckets. The accompanying test in ListBucketsWithPartialSuccessTest.cs effectively validates the sample's functionality. The necessary modifications to StorageFixture.cs and the project file to support the new sample are also correct. I have one minor suggestion to improve code conciseness in the test file.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new code sample and a corresponding test to demonstrate listing buckets with partial success using the ReturnPartialSuccess option. The implementation is clear and effectively showcases the feature. The test correctly verifies the happy path while prudently avoiding flakiness from potential real-world partial failures. I have one minor suggestion to improve code style consistency.
ef03f67 to
7c0bb19
Compare
… return partial success
7b10968 to
2c982dc
Compare
This PR adds a new code sample for the
ListBucketsoperation using theReturnPartialSuccessparameter inListBucketOptions.The
ReturnPartialSuccessflag allows the API to return a list of buckets even if specific regions are temporarily unavailable, rather than failing the entire request. This sample demonstrates how to consume the resulting Reachable and Unreachable collections. Please see b/459649174.