Skip to content

feat(storage): add sample for hierarchical namespace recursive delete - #16402

Draft
nidhiii-27 wants to merge 3 commits into
mainfrom
feat/add-cpp-delete-folder-recursive
Draft

feat(storage): add sample for hierarchical namespace recursive delete#16402
nidhiii-27 wants to merge 3 commits into
mainfrom
feat/add-cpp-delete-folder-recursive

Conversation

@nidhiii-27

Copy link
Copy Markdown
Contributor

Draft PR for hierarchical namespace recursive delete folder sample.

[Generated-by: AI]

Adds a C++ code sample demonstrating hierarchical namespace recursive folder delete.

Fixes: b/530058946

[Generated-by: AI]
@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 Aug 29, 2026
@nidhiii-27 nidhiii-27 added the storage-sample-architect Generated by storage-sample-architect skill label Aug 29, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new sample function DeleteFolderRecursive to demonstrate and test recursive folder deletion in the Storage Control service. It also updates the AutoRun integration test and the command-line entry points to include this new functionality. Feedback on the code suggests explicitly declaring the return type instead of using auto when calling DeleteFolderRecursive().get(), in accordance with the repository's style guide regarding obscured return types.

std::string const& bucket_name, std::string const& folder_id) {
auto const name = std::string{"projects/_/buckets/"} + bucket_name +
"/folders/" + folder_id;
auto status = client.DeleteFolderRecursive(name).get();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

According to the repository style guide, using auto is disallowed when it obscures StatusOr<T> or other return types. Please explicitly specify the return type google::cloud::StatusOr<google::protobuf::Empty>.

    google::cloud::StatusOr<google::protobuf::Empty> status =
        client.DeleteFolderRecursive(name).get();
References
  1. Reject Obscured Domain & Return Types: Flag and reject auto when it hides StatusOr, domain objects, protobuf messages/fields, or function return types. (link)

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

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.24%. Comparing base (559b727) to head (b13e3b9).
⚠️ Report is 143 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16402   +/-   ##
=======================================
  Coverage   92.23%   92.24%           
=======================================
  Files        2265     2265           
  Lines      210210   210210           
=======================================
+ Hits       193894   193898    +4     
+ Misses      16316    16312    -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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. storage-sample-architect Generated by storage-sample-architect skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant