Skip to content

Conversation

@cpriti-os
Copy link
Contributor

@cpriti-os cpriti-os commented Nov 6, 2025

This change adds support for the returnPartialSuccess parameter in ListBuckets calls for both JSON and gRPC client.

When this option is enabled by setting ReturnPartialSuccess = true on the BucketIterator, the GCS API will return a list of reachable buckets even if some are temporarily unavailable. The resource names of any unreachable buckets are returned in a new Unreachable field in the ListBucketsResponse

Integration and unit tests added.

@cpriti-os cpriti-os requested review from a team as code owners November 6, 2025 08:34
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Nov 6, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @cpriti-os, 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 enhances the ListBuckets functionality by introducing a ReturnPartialSuccess option. When enabled, this feature allows the Google Cloud Storage API to return a list of accessible buckets alongside a separate list of any buckets that were unreachable during the operation, providing more robust error handling and user feedback for bucket listing operations.

Highlights

  • Partial Success for ListBuckets: Introduced the ReturnPartialSuccess option for ListBuckets calls, allowing the API to return reachable buckets even if some are temporarily unavailable.
  • Unreachable Buckets Reporting: Added a new Unreachable field to the ListBucketsResponse and a corresponding Unreachable() method to the BucketIterator to expose the names of any buckets that could not be reached.
  • Client-side Implementation: Updated http_client.go to correctly send the returnPartialSuccess query parameter and parse the unreachable field from the JSON API response.
  • Comprehensive Testing: Included new unit and integration tests to ensure the correct functionality of the partial success feature and the reporting of unreachable buckets.
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
Contributor

@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 adds support for returnPartialSuccess when listing buckets, which is a valuable feature. The changes are well-structured, and I appreciate the inclusion of both unit and integration tests. I've found one potential bug related to handling paginated responses with unreachable buckets, where the list of unreachable buckets might be overwritten. I've also left a minor suggestion to simplify the code in the new integration test. Overall, great work on this feature.

@cpriti-os cpriti-os marked this pull request as draft November 6, 2025 08:40
@cpriti-os cpriti-os marked this pull request as ready for review November 8, 2025 04:10
@krishnamd-jkp
Copy link
Contributor

Seems like the build is failing because the underlying apiary is not updated yet with new fields. Are you planning to update it?

@cpriti-os cpriti-os merged commit d91e47f into googleapis:main Nov 17, 2025
11 checks passed
krishnamd-jkp added a commit that referenced this pull request Dec 5, 2025
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.7.0
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-go@sha256:718167d5c23ed389b41f617b3a00ac839bdd938a6bd2d48ae0c2f1fa51ab1c3d
<details><summary>storage: 1.58.0</summary>

##
[1.58.0](storage/v1.57.2...storage/v1.58.0)
(2025-12-03)

### Features

* add object contexts in Go GCS SDK (#13390)
([079c4d9](079c4d96))

* calculate crc32c by default and pass checksum in trailing and
per-chunk request (#13205)
([2ab1c77](2ab1c778))

* add support for partial success in ListBuckets (#13320)
([d91e47f](d91e47f2))

### Bug Fixes

* omit empty filter in http list object request (#13434)
([377eb13](377eb13b))

</details>

---------

Co-authored-by: Priti Chattopadhyay <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants