Skip to content

Conversation

@nidhiii-27
Copy link
Contributor

This PR adds support for the returnPartialSuccess parameter in ListBuckets calls for JSON.
A new Storage.BucketListOption.returnPartialSuccess(true) is introduced. When set, the list operation returns a set containing both reachable buckets and unreachable buckets. Unreachable buckets are distinguished by having the isUnreachable=true flag set and are named using their full resource form (e.g., "projects/_/buckets/bucket1").

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/java-storage API. labels Nov 17, 2025
@nidhiii-27 nidhiii-27 marked this pull request as ready for review November 17, 2025 18:21
@nidhiii-27 nidhiii-27 requested a review from a team as a code owner November 17, 2025 18:21
@nidhiii-27 nidhiii-27 marked this pull request as draft November 18, 2025 05:24
@nidhiii-27 nidhiii-27 marked this pull request as ready for review November 18, 2025 07:16
@nidhiii-27 nidhiii-27 requested a review from a team as a code owner November 24, 2025 13:17
@Dhriti07 Dhriti07 self-requested a review November 24, 2025 19:09
Dhriti07
Dhriti07 previously approved these changes Nov 25, 2025
@ShreyasSinha ShreyasSinha added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 2, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 2, 2025
@CrossRun(
backends = {Backend.TEST_BENCH},
transports = {Transport.HTTP})
public class ITListBucketTest {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a testcase with multiple unreachable buckets

ifNonNull(from.getIpFilter(), ipFilterCodec::decode, to::setIpFilter);
if (from.containsKey("isUnreachable")) {
to.setIsUnreachable(Boolean.TRUE);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spoke about this offline as well, but we need to update the logic here to handle the bucket resource names the same way grpc does.

On line https://github.com/googleapis/java-storage/pull/3404/files#diff-02854c6353038f671563a52b22658f9dcb49e66d8eb45a822439e90aa60b11f6R612 we need to add change the first line to be BucketInfo.Builder to = new BucketInfo.BuilderImpl(bucketNameCodec.decode(from.getName())); like in

BucketInfo.Builder to = new BucketInfo.BuilderImpl(bucketNameCodec.decode(from.getName()));

Even in grpc we don't expose projects/_/buckets/ everything is normalized to json style bucket names.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this does deviate from how the API returns the value, and possibly how other languages have exposed things. This change does mean that the Storage sdk here is internally consistent, and customers can reliably use bucket names regardless of unavailability.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in PR #3415

@nidhiii-27 nidhiii-27 closed this Dec 7, 2025
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 googleapis/java-storage API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants