Skip to content

feat(storage): add support for bucket metadata call in async client#16262

Open
bajajneha27 wants to merge 8 commits into
googleapis:mainfrom
bajajneha27:async-bucket-metadata
Open

feat(storage): add support for bucket metadata call in async client#16262
bajajneha27 wants to merge 8 commits into
googleapis:mainfrom
bajajneha27:async-bucket-metadata

Conversation

@bajajneha27

Copy link
Copy Markdown
Contributor

No description provided.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Jul 15, 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 implements the asynchronous GetBucket API across the Google Cloud Storage C++ SDK, including client interfaces, connection implementations, decorators, stubs, mocks, and tests. A review of the changes identified an issue in the integration tests where BucketName is constructed with an already-prefixed string, which would result in a double-prefixed bucket name.


auto bucket =
async
.GetBucket(BucketName("projects/_/buckets/" + MakeRandomObjectName()))

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

The BucketName constructor expects the simple bucket name (e.g., my-bucket), and its FullName() method automatically prepends the projects/_/buckets/ prefix. Passing a string that already contains the prefix will result in a double-prefixed name like projects/_/buckets/projects/_/buckets/.... You should pass only the random name to BucketName.

          .GetBucket(BucketName(MakeRandomObjectName()))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems like a valid finding. Please fix.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.64162% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.27%. Comparing base (6fd3745) to head (e1e499a).

Files with missing lines Patch % Lines
...gle/cloud/storage/internal/storage_tracing_stub.cc 0.00% 7 Missing ⚠️
.../storage/internal/storage_round_robin_decorator.cc 0.00% 3 Missing ⚠️
google/cloud/storage/async/client_test.cc 98.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16262      +/-   ##
==========================================
- Coverage   92.27%   92.27%   -0.01%     
==========================================
  Files        2214     2214              
  Lines      206537   206710     +173     
==========================================
+ Hits       190589   190745     +156     
- Misses      15948    15965      +17     

☔ 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.

@bajajneha27
bajajneha27 force-pushed the async-bucket-metadata branch from d6a54d9 to aff7403 Compare July 16, 2026 03:50
@bajajneha27
bajajneha27 marked this pull request as ready for review July 16, 2026 07:04
@bajajneha27
bajajneha27 requested review from a team as code owners July 16, 2026 07:04
@bajajneha27
bajajneha27 requested a review from scotthart July 16, 2026 08:45

auto bucket =
async
.GetBucket(BucketName("projects/_/buckets/" + MakeRandomObjectName()))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems like a valid finding. Please fix.

std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::storage::v2::GetBucketRequest const& request) {
AddIdempotencyToken(*context, id);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These tokens are intended for mutating operations (like WriteObject, DeleteObject) to prevent duplicate execution on the server side. Read operations are naturally idempotent and do not need to generate or send this token.

Comment thread google/cloud/storage/async/idempotency_policy.cc
@bajajneha27
bajajneha27 force-pushed the async-bucket-metadata branch from 0f51cbd to 23ec33e Compare July 17, 2026 07:22
@bajajneha27
bajajneha27 requested a review from kalragauri July 17, 2026 10:13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

missed this the last time: pls add a unit test for changes in this file.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants