GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: delete bucket OLM rules by athakor · Pull Request #352 · googleapis/java-storage

This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Conversation

@athakor

@athakor athakor commented Jun 5, 2020

Copy link
Copy Markdown
Contributor

Fixes #344

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
athakor added 4 commits June 2, 2020 15:34
@athakor
feat: delete bucket OLM rules
b4e9fdb
@athakor
feat: update javadoc
b06b4a5
@athakor
feat: restructure the code and add more tests
731d1c9
@athakor
feat: return empty instead of null to remove all the lifecycle rule o…
248f9c8
…f bucket
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 5, 2020
@athakor
athakor requested a review from frankyn June 5, 2020 15:54
@codecov

codecov Bot commented Jun 5, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #352 into master will increase coverage by 0.40%.
The diff coverage is 88.88%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #352      +/-   ##
============================================
+ Coverage     62.73%   63.13%   +0.40%     
- Complexity      554      601      +47     
============================================
  Files            31       32       +1     
  Lines          5023     5078      +55     
  Branches        480      481       +1     
============================================
+ Hits           3151     3206      +55     
- Misses         1707     1708       +1     
+ Partials        165      164       -1     
Impacted Files Coverage Δ Complexity Δ
...rc/main/java/com/google/cloud/storage/Storage.java 80.90% <ø> (ø) 0.00 <0.00> (ø)
...main/java/com/google/cloud/storage/BucketInfo.java 81.34% <85.71%> (+0.29%) 83.00 <2.00> (-1.00) ⬆️
...src/main/java/com/google/cloud/storage/Bucket.java 81.36% <100.00%> (+0.13%) 34.00 <0.00> (ø)
...ogle/cloud/storage/testing/StorageRpcTestBase.java 97.95% <0.00%> (ø) 48.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 a3b04dd...0a574ba. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dmitry-fa
dmitry-fa reviewed Jun 8, 2020
View reviewed changes

@dmitry-fa dmitry-fa left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

List<LifecycleRule> deleteLifecycleRules(String bucket, LifecycleRule... rulesToDelete);

Neither Storage nor Bucket defines methods to deal with LifecycleRules. Adding a method to them to delete that rules doesn't look logical. Would it make sense to implement this functionality in the BucketInfo class next to List<? extends BucketInfo.LifecycleRule> getLifecycleRules() method?

cc: @frankyn

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@athakor athakor added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 8, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 8, 2020
@frankyn

frankyn commented Jun 8, 2020

Copy link
Copy Markdown
Contributor

+1 to @dmitry-fa, it would be better to define this in the BlobInfo builder because that's how metadata is mutated.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

athakor added 2 commits June 10, 2020 21:38
@athakor
feat: moved deleteLifecycleRules inside bucketInfo
252f315
@athakor
feat: rollback commented code
5b881c4
@athakor

athakor commented Jun 10, 2020

Copy link
Copy Markdown
Contributor Author

@frankyn @dmitry-fa PTAL

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dmitry-fa
dmitry-fa reviewed Jun 10, 2020
View reviewed changes
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

dmitry-fa
dmitry-fa suggested changes Jun 10, 2020
View reviewed changes
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

frankyn
frankyn suggested changes Jun 11, 2020
View reviewed changes
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@athakor
feat: delete all LifecycleRules instead of individual rules
334c6fe
@athakor

athakor commented Jun 15, 2020

Copy link
Copy Markdown
Contributor Author

@frankyn PTAL

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dmitry-fa
dmitry-fa suggested changes Jun 15, 2020
View reviewed changes

@dmitry-fa dmitry-fa left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The new implementation is much better than the previous one. Could you fix a few nits, please.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/BucketInfoTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

dmitry-fa
dmitry-fa reviewed Jun 15, 2020
View reviewed changes
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@athakor
feat: updated the code and change the method signature
2f118f7
dmitry-fa
dmitry-fa reviewed Jun 15, 2020
View reviewed changes
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

frankyn
frankyn suggested changes Jun 15, 2020
View reviewed changes

@frankyn frankyn left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I think you're super close, but I may have been too short on my surface expectations. Provided an example of what I would expect.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Outdated
* boolean rulesDeleted = bucket.deleteLifecycleRules();
* if (rulesDeleted) {
* // the lifecycle rules were deleted
* }

@frankyn frankyn Jun 15, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'm expecting the following surface:

String bucketName = "my-unique-bucket";
Bucket bucket = storage.get(bucketName);

updatedBucketMetdata = bucket.toBuilder().deleteLifecycleRules().build().update();
if (updatedBucketMetadata.getLifecycleRules().size() == 0) {
    // the lifecycle rules were deleted
}

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@athakor athakor Jun 16, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@athakor
feat: implemented in the same manner as other methods updating Bucket…
8a2206c
…s properties
@athakor athakor added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 16, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 16, 2020
@athakor

athakor commented Jun 16, 2020

Copy link
Copy Markdown
Contributor Author

@frankyn @dmitry-fa implemented in the same manner as other methods updating Bucket's properties. PTAL when you get chance

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dmitry-fa
dmitry-fa suggested changes Jun 16, 2020
View reviewed changes

@dmitry-fa dmitry-fa left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Overall looks good to me. A few nits to address just left.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/Bucket.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/BucketTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@athakor
feat: fix review changes
0742e52
@athakor

athakor commented Jun 16, 2020

Copy link
Copy Markdown
Contributor Author

@dmitry-fa all the comments have been addressed PTAL

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dmitry-fa
dmitry-fa approved these changes Jun 16, 2020
View reviewed changes

@dmitry-fa dmitry-fa left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good to me know, thanks for addressing my comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@athakor
build: fix clirr checks
0a574ba
frankyn
frankyn approved these changes Jun 16, 2020
View reviewed changes
@frankyn
frankyn merged commit 0a528c6 into googleapis:master Jun 16, 2020
@athakor athakor mentioned this pull request Jun 16, 2020
Cloud Storage: Removing lifecyclerules from bucket is not working #20
Closed
gcf-merge-on-green Bot pushed a commit that referenced this pull request Jun 18, 2020
@release-please
chore: release 1.110.0 (#373)
34d1633
🤖 I have created a release \*beep\* \*boop\* 
---
## [1.110.0](https://www.github.com/googleapis/java-storage/compare/v1.109.1...v1.110.0) (2020-06-18)


### Features

* delete bucket OLM rules ([#352](https://www.github.com/googleapis/java-storage/issues/352)) ([0a528c6](https://www.github.com/googleapis/java-storage/commit/0a528c6916f8b031916a4c6ecc96ce5e49ea99c7))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@frankyn frankyn frankyn approved these changes
@dmitry-fa dmitry-fa dmitry-fa approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Deleting the bucket OLM rules

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@athakor @frankyn @dmitry-fa @googlebot @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.