feat: add support for partial success in ListBuckets for json#3404
feat: add support for partial success in ListBuckets for json#3404nidhiii-27 wants to merge 12 commits into
Conversation
| @CrossRun( | ||
| backends = {Backend.TEST_BENCH}, | ||
| transports = {Transport.HTTP}) | ||
| public class ITListBucketTest { |
There was a problem hiding this comment.
Can you add a testcase with multiple unreachable buckets
| ifNonNull(from.getIpFilter(), ipFilterCodec::decode, to::setIpFilter); | ||
| if (from.containsKey("isUnreachable")) { | ||
| to.setIsUnreachable(Boolean.TRUE); | ||
| } |
There was a problem hiding this comment.
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
Even in grpc we don't expose projects/_/buckets/ everything is normalized to json style bucket names.
There was a problem hiding this comment.
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.
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").