Skip to content

feat(storage): add dotnet deleteFolderRecursive sample - #3340

Merged
nidhiii-27 merged 7 commits into
mainfrom
add-delete-folder-recursive-sample
Sep 7, 2026
Merged

feat(storage): add dotnet deleteFolderRecursive sample#3340
nidhiii-27 merged 7 commits into
mainfrom
add-delete-folder-recursive-sample

Conversation

@nidhiii-27

Copy link
Copy Markdown
Contributor

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
Contributor 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]
krishnamd-jkp
krishnamd-jkp previously approved these changes Jul 6, 2026
…ests

Re-enable recursive delete folder integration tests and resolve GCS billing project limitations.

[Generated-by: AI]
@LAV-IDER33

Copy link
Copy Markdown

Private 🛠️⚡🧩👻U

This was referenced Aug 22, 2026
@@ -1,4 +1,4 @@
// Copyright 2020 Google Inc.
// Copyright 2020 Google Inc.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Might have added a space here. Check and remove it if not necessary.

Copy link
Copy Markdown
Contributor 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

@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same here. Check if it is unnecessary.

Copy link
Copy Markdown
Contributor 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

Comment on lines +23 to +27
StorageControlClientBuilder builder = new StorageControlClientBuilder
{
QuotaProject = ""
};
StorageControlClient storageControl = builder.Build();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Any reason we are using storage builder instead of simple StorageControlClient storageControl = StorageControlClient.Create();

Copy link
Copy Markdown
Contributor 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

Comment on lines +24 to +28
StorageControlClientBuilder builder = new StorageControlClientBuilder
{
QuotaProject = ""
};
StorageControlClient storageControl = builder.Build();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this needed and relevant?

Copy link
Copy Markdown
Contributor 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

@nidhiii-27
nidhiii-27 merged commit 55b6f7a into main Sep 7, 2026
16 checks passed
@nidhiii-27
nidhiii-27 deleted the add-delete-folder-recursive-sample branch September 7, 2026 17:02
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.

4 participants