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

feat(storage): add support for soft delete #25340

Merged
merged 8 commits into from
Apr 4, 2024

Conversation

bajajneha27
Copy link
Contributor

Add support for soft delete.

The operations we need are:

  • Set a soft delete policy on a existing bucket
  • Get a bucket's soft delete policy
  • Get a soft deleted object by doing an object get call with the soft deleted parameter set to true
  • Get the soft delete time and hard delete time metadata fields from a soft deleted object
  • List soft deleted objects by doing an object list call with the soft deleted parameter set to true
  • Restore a soft deleted object

closes: #24793

@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Mar 8, 2024
@bajajneha27 bajajneha27 force-pushed the b/324502549 branch 2 times, most recently from eab9373 to edd38d5 Compare March 13, 2024 11:06
@bajajneha27
Copy link
Contributor Author

The acceptance test failures are not related to this PR. I'll fix them in separate PR.

Copy link
Contributor

@SandeepTuniki SandeepTuniki left a comment

Choose a reason for hiding this comment

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

Left a couple of suggestions in tests, but LGTM.

enable_object_retention: nil
enable_object_retention: nil,
effective_time: DateTime.now,
retention_duration_seconds: 604800
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming this number indicates a 7 day retention period? Maybe append a comment like you did for acceptance tests:

retention_duration_seconds: 604800 # 7 days

}.delete_if { |_, v| v.nil? }
end

def soft_delete_policy_object retention_duration_seconds: 604800
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as mentioned previously about documenting it as 7 days.

@bajajneha27 bajajneha27 merged commit 28b3bd1 into googleapis:main Apr 4, 2024
14 checks passed
@yoshi-approver yoshi-approver added the release-please:force-run To run release-please label Apr 4, 2024
@release-please release-please bot removed the release-please:force-run To run release-please label Apr 4, 2024
@yoshi-approver yoshi-approver added the release-please:force-run To run release-please label Apr 5, 2024
@release-please release-please bot removed the release-please:force-run To run release-please label Apr 5, 2024
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 Cloud Storage API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

storage: implement soft delete
4 participants