Skip to content

feat: Remove client side vaildation for lifecycle conditions - #816

Merged
JesseLovelace merged 2 commits into
masterfrom
fixolm
May 11, 2021
Merged

feat: Remove client side vaildation for lifecycle conditions#816
JesseLovelace merged 2 commits into
masterfrom
fixolm

Conversation

@JesseLovelace

Copy link
Copy Markdown
Contributor

Replaces exception for empty lifecycle condition with a warning.

@JesseLovelace
JesseLovelace requested review from a team and BenWhiteheadMay 11, 2021 16:07
@product-auto-labelproduct-auto-labelBot added the api: storage Issues related to the googleapis/java-storage API. label May 11, 2021
@google-clagoogle-claBot added the cla: yes This human has signed the Contributor License Agreement. label May 11, 2021
@JesseLovelaceJesseLovelace changed the title Remove client side vaildation for lifecycle conditionsfeat: Remove client side vaildation for lifecycle conditionsMay 11, 2021
@codecov

codecovBot commented May 11, 2021

Copy link
Copy Markdown

Codecov Report

Merging #816 (4c70db9) into master (8e24594) will increase coverage by 0.00%.
The diff coverage is 50.00%.

Impacted file tree graph

@@ Coverage Diff @@## master #816 +/- ##
=========================================
Coverage 64.61% 64.62% + Complexity 634 625 -9 
=========================================
Files 32 32 Lines 5313 5314 +1 Branches 519 520 +1 =========================================
+ Hits 3433 3434 +1 
Misses 1718 1718 Partials 162 162 
Impacted FilesCoverage ΔComplexity Δ
...main/java/com/google/cloud/storage/BucketInfo.java84.00% <50.00%> (+0.02%)86.00 <0.00> (ø)

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 8e24594...4c70db9. Read the comment docs.

+ "management. Please see https://cloud.google.com/storage/docs/lifecycle for details.");
log.warning("Creating a lifecycle condition with no supported conditions:\n"
+ this
+ "\nAttempting to update with this rule may cause errors.");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would suggest updating the client version, maybe a similar message to what we have in python: googleapis/python-storage#437

@BenWhiteheadBenWhitehead left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lint build needs to be fixed, but merge away once that's taken care of.

@JesseLovelace
JesseLovelace merged commit 5ec84cc into masterMay 11, 2021
@JesseLovelace
JesseLovelace deleted the fixolm branch May 11, 2021 22:06
gcf-merge-on-greenBot pushed a commit that referenced this pull request May 13, 2021
🤖 I have created a release \*beep\* \*boop\*
---
## [1.114.0](https://www.github.com/googleapis/java-storage/compare/v1.113.16...v1.114.0) (2021-05-13)
### Features
* Remove client side vaildation for lifecycle conditions ([#816](https://www.github.com/googleapis/java-storage/issues/816)) ([5ec84cc](https://www.github.com/googleapis/java-storage/commit/5ec84cc2935a4787dd14a207d27501878f5849d5))
### Bug Fixes
* **test:** update blob paths used in storage.it.ITStorageTest#testDownloadPublicBlobWithoutAuthentication ([#759](https://www.github.com/googleapis/java-storage/issues/759)) ([#817](https://www.github.com/googleapis/java-storage/issues/817)) ([1a576ca](https://www.github.com/googleapis/java-storage/commit/1a576ca3945b51d7a678aa2414be91b3c6b2d55e))
### Dependencies
* update dependency com.google.api-client:google-api-client to v1.31.5 ([#820](https://www.github.com/googleapis/java-storage/issues/820)) ([9e1bc0b](https://www.github.com/googleapis/java-storage/commit/9e1bc0b42abdaab0b11d761ecdbb92f6116aacd2))
* update dependency com.google.api.grpc:grpc-google-cloud-kms-v1 to v0.88.3 ([#797](https://www.github.com/googleapis/java-storage/issues/797)) ([747e7e4](https://www.github.com/googleapis/java-storage/commit/747e7e463c028b9cf8a406b7536b1916c1d52c01))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#815](https://www.github.com/googleapis/java-storage/issues/815)) ([e210de9](https://www.github.com/googleapis/java-storage/commit/e210de93452243242be7d3d719d00da723632335))
---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
@danielduhh

Copy link
Copy Markdown
Contributor

Super late comment here but can we add tests for this? @JesseLovelace

BenWhitehead added a commit that referenced this pull request Sep 28, 2021
* feat: Remove client side vaildation for lifecycle conditions (#816)
* Remove client side vaildation for lifecycle conditions
* fix lint and suggest updating
(cherry picked from commit 5ec84cc)
* fix: update BucketInfo translation code to properly handle lifecycle rules (#852)
Fixes#850
(cherry picked from commit 3b1df1d)
* fix: improve error detection and reporting for BlobWriteChannel retry 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)
* fix: correct lastChunk retry logic in BlobWriteChannel (#918)
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)
* test: remove error string matching (#861)
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)
Co-authored-by: JesseLovelace <43148100+JesseLovelace@users.noreply.github.com>
Co-authored-by: Chris Cotter <cjcotter@google.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storageIssues related to the googleapis/java-storage API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@JesseLovelace@danielduhh@BenWhitehead@tritone