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): support object retention lock #6829

Merged
merged 8 commits into from
Dec 8, 2023

Conversation

vishwarajanand
Copy link
Contributor

@vishwarajanand vishwarajanand commented Nov 29, 2023

This adds support for object retention lock

Fixes #6741
PRD: go/gcs-object-retention-client-request

Tests

System tests pass in my local which were run on an allowlisted project:

➜  Storage git:(main) ✗ vendor/bin/phpunit  -c phpunit-system.xml.dist --filter="ManageObjectsTest::testObjectRetentionLock"
PHPUnit 9.6.13 by Sebastian Bergmann and contributors.

.                                                                   1 / 1 (100%)

Time: 00:04.678, Memory: 14.00 MB

OK (1 test, 3 assertions)
➜  Storage git:(main) ✗

@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Nov 29, 2023
@vishwarajanand vishwarajanand marked this pull request as ready for review November 29, 2023 16:53
@vishwarajanand vishwarajanand requested review from a team as code owners November 29, 2023 16:53
@vishwarajanand vishwarajanand added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 30, 2023
@JesseLovelace JesseLovelace removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 1, 2023
@vishwarajanand vishwarajanand added the next release PRs to be included in the next release label Dec 7, 2023
Storage/src/Bucket.php Outdated Show resolved Hide resolved
Storage/src/Connection/Rest.php Show resolved Hide resolved
Storage/src/Bucket.php Outdated Show resolved Hide resolved
Storage/src/StorageObject.php Show resolved Hide resolved
Storage/src/Bucket.php Show resolved Hide resolved
Copy link
Contributor

@yash30201 yash30201 left a comment

Choose a reason for hiding this comment

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

Also, we should test to check the case where we upload an object in locked retention mode and then try to change the retention:

  1. Decrease / Remove it => It should throw an exception from backend.
  2. Increase it => This should be possible.

Ref: User Guide (go/object-lock-user-guide)

Storage/src/Bucket.php Show resolved Hide resolved
Storage/src/Connection/Rest.php Show resolved Hide resolved
Storage/tests/System/ManageObjectsTest.php Outdated Show resolved Hide resolved
@vishwarajanand
Copy link
Contributor Author

Also, we should test to check the case where we upload an object in locked retention mode and then try to change the retention:

  1. Decrease / Remove it => It should throw an exception from backend.
  2. Increase it => This should be possible.

Ref: User Guide (go/object-lock-user-guide)

I added testObjectRetentionLockedMode, but it needs more changes in tests side which I will do later. Filed a bug for that: b/315469910

Copy link
Contributor

@yash30201 yash30201 left a comment

Choose a reason for hiding this comment

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

Lgtm

@bshaffer bshaffer added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 8, 2023
Storage/src/Bucket.php Show resolved Hide resolved
Storage/src/Bucket.php Outdated Show resolved Hide resolved
Storage/src/Connection/Rest.php Outdated Show resolved Hide resolved
Storage/src/StorageObject.php Outdated Show resolved Hide resolved
Storage/src/Connection/Rest.php Show resolved Hide resolved
@bshaffer bshaffer enabled auto-merge (squash) December 8, 2023 16:52
@bshaffer bshaffer removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 8, 2023
@bshaffer bshaffer merged commit b92c658 into googleapis:main Dec 8, 2023
22 checks passed
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. next release PRs to be included in the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

storage: add support for object retention
5 participants