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 samples for soft-delete and restore buckets #2067

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thiyaguk09
Copy link
Contributor

Added Storage Samples:

  1. Get a Soft Deleted Bucket
  2. List Soft Deleted Buckets
  3. Restore a Soft Deleted Bucket

initial commit for bucket restore samples
@product-auto-label product-auto-label bot added api: storage Issues related to the Cloud Storage API. samples Issues that are directly related to samples. labels Dec 24, 2024
@thiyaguk09 thiyaguk09 marked this pull request as ready for review January 6, 2025 16:28
@thiyaguk09 thiyaguk09 requested review from a team as code owners January 6, 2025 16:28
Copy link

snippet-bot bot commented Jan 6, 2025

Here is the summary of changes.

You are about to add 3 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@danielduhh danielduhh removed the request for review from a team January 21, 2025 04:53
@danielduhh danielduhh added the kokoro:run Add this label to force Kokoro to re-run the tests. label Jan 21, 2025
@danielduhh danielduhh requested a review from bshaffer January 21, 2025 04:54
@danielduhh danielduhh added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 3, 2025
@danielduhh
Copy link

Hi @bshaffer, this should be ready for review when you get a second!

Copy link
Contributor

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

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

I ran these tests locally and received the following errors:

1) Google\Cloud\Samples\Storage\storageTest::testGetRestoreSoftDeletedBucket
Google\Cloud\Core\Exception\ServiceException: {"error":{"code":403,"message":"[email protected] does not have storage.buckets.get access to the Google Cloud Storage bucket. Permission 'storage.buckets.get' denied on resource (or it may not exist).","errors":[{"message":"[email protected] does not have storage.buckets.get access to the Google Cloud Storage bucket. Permission 'storage.buckets.get' denied on resource (or it may not exist).","domain":"global","reason":"forbidden"}]}}

vendor/google/cloud-core/src/RequestWrapper.php:434
vendor/google/cloud-core/src/RequestWrapper.php:230
vendor/google/cloud-core/src/RestTrait.php:103
vendor/google/cloud-storage/src/Connection/Rest.php:777
vendor/google/cloud-storage/src/Connection/Rest.php:202
vendor/google/cloud-storage/src/Bucket.php:1234
test/storageTest.php:959
--

There was 1 failure:

1) Google\Cloud\Samples\Storage\storageTest::testListSoftDeletedBuckets
Failed asserting that '' contains "Bucket:".

test/storageTest.php:153

Is it possible I need to enable something on the test project php-docs-samples-kokoro for these tests to pass?

@thiyaguk09
Copy link
Contributor Author

Is it possible I need to enable something on the test project php-docs-samples-kokoro for these tests to pass?

Could you try giving the storage.legacyBucketOwner permission (roles/storage.legacyBucketOwner)?

@thiyaguk09 thiyaguk09 requested a review from bshaffer February 10, 2025 05:10
@glasnt glasnt added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Feb 13, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 13, 2025
@glasnt glasnt added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 13, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 13, 2025
@danielduhh
Copy link

@thiyaguk09 this is not the first test that creates a bucket, so I don't think permissions is an issue here

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. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants