Conversation

JesseLovelace and others added 4 commits September 1, 2021 14:45
* Remove client side vaildation for lifecycle conditions

* fix lint and suggest updating

(cherry picked from commit 5ec84cc)
… state (#846)

Add new checks to ensure a more informative error than NullPointerException is thrown if the StorageObject or it's size are unable to be resolved on the last chunk.

Fixes #839

(cherry picked from commit d0f2184)
Add new method StorageRpc#queryResumableUpload which allows getting a shallow StorageObject for a resumable upload session which is complete.

Update BlobWriteChannel to use StoageRpc#queryResumableUpload instead of StorageRpc#get when attempting to validate the upload size of an object when it determines the upload is complete and is on the last chunk.

If a BlobWriteChannel is opened with a conditional like IfGenerationMatch it is not possible to simply get the object, as the object can drift generationally while the resumable upload is being performed.

Related to #839

(cherry picked from commit ab0228c)
@BenWhiteheadBenWhitehead requested a review from a team September 1, 2021 18:56
@BenWhiteheadBenWhitehead requested a review from a team as a code owner September 1, 2021 18:56
@product-auto-labelproduct-auto-label bot added the api: storageIssues related to the googleapis/java-storage API.label Sep 1, 2021
@google-clagoogle-cla bot added the cla: yesThis human has signed the Contributor License Agreement.label Sep 1, 2021
@codecov

Codecov Report

Merging #993 (42e1f6e) into 1.113.14-sp (8614975) will decrease coverage by 0.12%.
The diff coverage is 48.27%.

Impacted file tree graph

@@                Coverage Diff                @@
##             1.113.14-sp     #993      +/-   ##
=================================================
- Coverage          64.61%   64.48%   -0.13%     
+ Complexity           634      633       -1     
=================================================
  Files                 32       32              
  Lines               5313     5336      +23     
  Branches             519      527       +8     
=================================================
+ Hits                3433     3441       +8     
- Misses              1718     1730      +12     
- Partials             162      165       +3     
Impacted FilesCoverage Δ
...om/google/cloud/storage/spi/v1/HttpStorageRpc.java1.55% <0.00%> (-0.01%)⬇️
...va/com/google/cloud/storage/spi/v1/StorageRpc.java66.23% <ø> (ø)
...ogle/cloud/storage/testing/StorageRpcTestBase.java92.30% <0.00%> (-1.81%)⬇️
...ava/com/google/cloud/storage/BlobWriteChannel.java75.00% <55.00%> (-5.20%)⬇️
...main/java/com/google/cloud/storage/BucketInfo.java83.96% <85.00%> (-0.01%)⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8614975...42e1f6e. Read the comment docs.

It looks like the text for this error on the backend has changed
(sometimes) from "Precondition Failed" to "At least one of the
pre-conditions you specified did not hold". I don't think it's
really necessary to check the exact message in any case given
that we do check for a code of 412, which implies a precondition
failure. I added a check of the error Reason instead,  which is more
standardized.

Fixes #853

(cherry picked from commit 146a3d3)
@BenWhiteheadBenWhitehead changed the title fix: backport critical bug fixes fix: backport critical bug fixes for 1.113.14-sp Sep 1, 2021
@BenWhiteheadBenWhitehead changed the title fix: backport critical bug fixes for 1.113.14-sp fix(1.113.14-sp): backport critical bug fixes Sep 1, 2021
@BenWhiteheadBenWhitehead added the do not mergeIndicates a pull request not ready for merge, due to either quality or timing.label Sep 2, 2021
@BenWhiteheadBenWhitehead removed the do not mergeIndicates a pull request not ready for merge, due to either quality or timing.label Sep 28, 2021
@BenWhiteheadBenWhitehead merged commit 447d35d into googleapis:1.113.14-sp Sep 28, 2021
@BenWhiteheadBenWhitehead deleted the backports branch September 28, 2021 20:50
Sign up for free to join this conversation on . Already have an account? Sign in to comment
api: storageIssues related to the googleapis/java-storage API.cla: yesThis human has signed the Contributor License Agreement.
None yet

Successfully merging this pull request may close these issues.