feat(storage): add sample for hierarchical namespace recursive delete - #16402
feat(storage): add sample for hierarchical namespace recursive delete#16402nidhiii-27 wants to merge 3 commits into
Conversation
Adds a C++ code sample demonstrating hierarchical namespace recursive folder delete. Fixes: b/530058946 [Generated-by: AI]
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
- Reject Obscured Domain & Return Types: Flag and reject auto when it hides StatusOr, domain objects, protobuf messages/fields, or function return types. (link)
There was a problem hiding this comment.
Done
Co-authored by AI Agent
[Generated-by: AI]
[Generated-by: AI]
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Draft PR for hierarchical namespace recursive delete folder sample.
[Generated-by: AI]