magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

fix: (storage) delete non current version of objects

Open gurusai-voleti opened this issue 7 months ago • 19 comments

Release Note Template for Downstream PRs (will be copied) Fixes: See Write release notes for guidance.

storage: delete non current objects

gurusai-voleti avatar May 19 '25 12:05 gurusai-voleti

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 56 insertions(+), 14 deletions(-)) google-beta provider: Diff ( 2 files changed, 56 insertions(+), 14 deletions(-))

modular-magician avatar May 19 '25 12:05 modular-magician

Tests analytics

Total tests: 120 Passed tests: 109 Skipped tests: 10 Affected tests: 1

Click here to see the affected service packages
  • storage

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccStorageBucket_forceDestroyWithVersioning

Get to know how VCR tests work

modular-magician avatar May 19 '25 14:05 modular-magician

🟢 Tests passed during RECORDING mode: TestAccStorageBucket_forceDestroyWithVersioning [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

modular-magician avatar May 19 '25 14:05 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 71 insertions(+), 27 deletions(-)) google-beta provider: Diff ( 2 files changed, 71 insertions(+), 27 deletions(-))

Errors

google provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

google-beta provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

modular-magician avatar May 19 '25 16:05 modular-magician

Tests analytics

Total tests: 0 Passed tests: 0 Skipped tests: 0 Affected tests: 0

Click here to see the affected service packages
  • storage

🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR.

View the build log

modular-magician avatar May 19 '25 16:05 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 70 insertions(+), 27 deletions(-)) google-beta provider: Diff ( 2 files changed, 70 insertions(+), 27 deletions(-))

modular-magician avatar May 19 '25 16:05 modular-magician

Tests analytics

Total tests: 120 Passed tests: 110 Skipped tests: 10 Affected tests: 0

Click here to see the affected service packages
  • storage

🟢 All tests passed!

View the build log

modular-magician avatar May 19 '25 18:05 modular-magician

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@slevenick, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

github-actions[bot] avatar May 20 '25 07:05 github-actions[bot]

@kautikdk please review, I'll do a pass after you give approval

slevenick avatar May 20 '25 13:05 slevenick

Hi @gurusai-voleti, Can you please briefly explain what is the solution you are proposing?

kautikdk avatar May 20 '25 14:05 kautikdk

Hi @gurusai-voleti, Can you please briefly explain what is the solution you are proposing?

@kautikdk

Our current method for deleting objects from a bucket involves using the list object API. This API retrieves a maximum of 1000 objects at a time. If a bucket contains more than 1000 objects, the API response will include a nextPageToken. We then use this token to make subsequent calls to the list API, continuing to retrieve and delete objects until the nextPageToken is no longer present, ensuring all objects are removed from the bucket.

gurusai-voleti avatar May 20 '25 15:05 gurusai-voleti

@slevenick This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar May 23 '25 09:05 github-actions[bot]

Is your solution related to the deletion of non current version of object? I believe the original issue is about force_destroy is not working for buckets with versioning enabled.

yes the solution will delete all live and versioned objects

gurusai-voleti avatar May 26 '25 09:05 gurusai-voleti

@GoogleCloudPlatform/terraform-team @slevenick This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar May 27 '25 09:05 github-actions[bot]

@GoogleCloudPlatform/terraform-team @slevenick This PR has been waiting for review for 2 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Jun 03 '25 09:06 github-actions[bot]

@GoogleCloudPlatform/terraform-team @slevenick This PR has been waiting for review for 3 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Jun 10 '25 09:06 github-actions[bot]

What's the next step here? As far as I can tell we're waiting on review from @kautikdk

I am verifying whether the current logic is deleting all the objects or not even version objects, and it seems no need to update the logic, will confirm if existing logic working fine we need some more info from the bug reporter in which case customer faced the error

gurusai-voleti avatar Jun 11 '25 07:06 gurusai-voleti

@slevenick @kautikdk created a bucket with more than 1000 version objects and few live objects and tested the current code on main branch (latest tf version), no changes are required for delete functionality as current logic is working fine, until we get some info on the customer issue, we will keep this PR as draft

gurusai-voleti avatar Jun 11 '25 08:06 gurusai-voleti

@gurusai-voleti so that's what I was thinking. The PR code might not be completely related to the issue that was linked. If you think there is an separate bug that this PR is fixing, you can create one GitHub issue with storage tag and link that issue to this PR.

kautikdk avatar Jun 11 '25 09:06 kautikdk