-
Notifications
You must be signed in to change notification settings - Fork 553
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
feat(storage): Soft deleted Bucket Restore #28138
base: main
Are you sure you want to change the base?
feat(storage): Soft deleted Bucket Restore #28138
Conversation
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.
Mark the PR ready for review once you're ready for it to be reviewed. Also please check the CI job failures.
def object_retention_param enable_object_retention | ||
enable_object_retention ? Google::Apis::StorageV1::Bucket::ObjectRetention.new(mode: "Enabled") : nil | ||
end | ||
end |
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.
You probably want to revert this change back and add the newline character back.
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.
did not understand your concerns here
Here is the summary of changes. You are about to add 3 region tags.
This comment is generated by snippet-bot.
|
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 LGTM. Please fix the CI issues.
@@ -223,6 +232,10 @@ def buckets prefix: nil, token: nil, max: nil, user_project: nil | |||
# account, transit costs will be billed to the given project. This | |||
# parameter is required with requester pays-enabled buckets. The | |||
# default is `nil`. | |||
# @param [Integer] generation generation no of bucket |
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.
# @param [Integer] generation generation no of bucket | |
# @param [Integer] generation Generation of the bucket |
Hi @bajajneha27 @JesseLovelace can you please take a look at the sample failure
|
require "google/cloud/storage" | ||
|
||
storage = Google::Cloud::Storage.new | ||
bucket_name = bucket_name.gsub(/[^a-zA-Z0-9\- ]/, "") |
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.
We shouldn't do validation like this in a sample, remove this line
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 this may have something to do with the PermissionDenied error you're getting, this may be causing you to check two different bucket names
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.
hi @bajajneha27 @JesseLovelace
I have removed the suspected line of code but still getting same failure
@shubhangi-google Does the yard / rubocop ci work in your local? |
bucket_name = bucket_name.gsub(/[^a-zA-Z0-9\- ]/, "") | ||
|
||
# fetching soft deleted bucket with soft_delete_time and hard_delete_time | ||
deleted_bucket_fetch = storage.bucket bucket_name, generation: generation, soft_deleted: true |
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.
Error occurs at this line. This could be because the bucket_name is modified in the previous line and the new bucket doesn't exist.
Like Jesse said, try removing the above line. We shouldn't be modifying the bucket_name passed.
Can you please double check that the APIARY i.e. google-apis-storage_v1 has soft delete changes? We might have to bump the storage_v1 version in storage gemspec |
Add support for restoring soft deleted bucket.
Operation Supported: