Skip to content

feat(storage): add dotnet deleteFolderRecursive sample#3340

Open
nidhiii-27 wants to merge 4 commits into
mainfrom
add-delete-folder-recursive-sample
Open

feat(storage): add dotnet deleteFolderRecursive sample#3340
nidhiii-27 wants to merge 4 commits into
mainfrom
add-delete-folder-recursive-sample

Conversation

@nidhiii-27

Copy link
Copy Markdown

Adds a .NET code sample demonstrating hierarchical namespace recursive folder delete.

Fixes: b/530059315

This adds a sample demonstrating how to recursively delete a folder in a hierarchical namespace bucket.

Fixes: b/521168740

[Generated-by: AI]
- Update Google.Cloud.Storage.Control.V2 to 1.8.0 to resolve DeleteFolderRecursive method
- Use fixture.GenerateName() instead of hardcoded folder name in tests
- Assert with predicate instead of on the full Folder object to prevent flaky tests

[Generated-by: AI]
@nidhiii-27 nidhiii-27 added ai-generated Generated by AI storage-sample-architect Generated by storage-sample-architect skill labels Jul 2, 2026
@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 Jul 2, 2026
@gemini-code-assist

Copy link
Copy Markdown

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

…iveTest

Add using System.Linq and replace invalid Assert.DoesNotContain predicate call with Assert.False(folders.Any(...)).

[Generated-by: AI]
@nidhiii-27
nidhiii-27 marked this pull request as ready for review July 2, 2026 09:39
@nidhiii-27
nidhiii-27 requested review from a team as code owners July 2, 2026 09:39
@snippet-bot

snippet-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

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

StorageControlCreateFolderSample createSample = new StorageControlCreateFolderSample();
var folder = createSample.StorageControlCreateFolder(_fixture.BucketNameHns, folderName);

StorageControlDeleteFolderRecursiveSample deleteSample = new StorageControlDeleteFolderRecursiveSample();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you create a subfolder also and check when deleting the sample deletes both of them?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Co-authored by AI Agent

Resolved PR review feedback on recursive folder delete test by adding subfolder check.

[Generated-by: AI]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Generated by AI api: storage Issues related to the Cloud Storage API. samples Issues that are directly related to samples. storage-sample-architect Generated by storage-sample-architect skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants