Skip to content
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

fix: ensure all BlobWriteSession types conform to the semantics specified in BlobWriteSession #2482

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

BenWhitehead
Copy link
Collaborator

  • Improve error handling to cover more cases where errors should be converted to StorageException
  • Enforce BlobWriteSession#open only being able to be called once, subsequent calls will error
  • Make JsonResumableSessionPutTask more graceful when attempting to determine object size (testbench can omit .size from its response when the value is 0, possibly due to protobuf to json conversion where protobuf won't explicitly include a 0 value.)
  • Update com.google.cloud.storage.StorageException#coalesce to look for ApiException in causes the same way it does for BaseServiceException
  • Add com.google.cloud.storage.StorageOptions.Builder#setBlobWriteSessionConfig now that both Http and Grpc support these, having it on the base class is convenient
  • Add new integration test ITBlobWriteSessionCommonSemanticsTest which forces certain failure modes and ensures expected handling in accordance with the semantics outlined in BlobWriteSession

@BenWhitehead BenWhitehead added the owlbot:ignore instruct owl-bot to ignore a PR label Apr 1, 2024
@BenWhitehead BenWhitehead requested review from a team as code owners April 1, 2024 19:29
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: storage Issues related to the googleapis/java-storage API. labels Apr 1, 2024
…fied in BlobWriteSession

* Improve error handling to cover more cases where errors should be converted to StorageException
* Enforce BlobWriteSession#open only being able to be called once, subsequent calls will error
* Make JsonResumableSessionPutTask more graceful when attempting to determine object size (testbench can omit `.size` from its response when the value is 0, possibly due to protobuf to json conversion where protobuf won't explicitly include a 0 value.)
* Update com.google.cloud.storage.StorageException#coalesce to look for ApiException in causes the same way it does for BaseServiceException
* Add com.google.cloud.storage.StorageOptions.Builder#setBlobWriteSessionConfig now that both Http and Grpc support these, having it on the base class is convenient
* Add new integration test ITBlobWriteSessionCommonSemanticsTest which forces certain failure modes and ensures expected handling in accordance with the semantics outlined in BlobWriteSession
@BenWhitehead BenWhitehead merged commit d47afcf into main Apr 11, 2024
22 checks passed
@BenWhitehead BenWhitehead deleted the bws-semantic-test branch April 11, 2024 20:46
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. owlbot:ignore instruct owl-bot to ignore a PR size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants