Skip to content

fix(storage): refactor userProject metadata propagation in ListObjects #14533

Open
cpriti-os wants to merge 5 commits intogoogleapis:mainfrom
cpriti-os:bill
Open

fix(storage): refactor userProject metadata propagation in ListObjects #14533
cpriti-os wants to merge 5 commits intogoogleapis:mainfrom
cpriti-os:bill

Conversation

@cpriti-os
Copy link
Copy Markdown
Contributor

@cpriti-os cpriti-os commented May 6, 2026

b/441095735

Refactor userProject metadata propagation in ListObjects

Moved the userProject metadata assignment so that it executes before initializing the ObjectIterator, following the robust pattern seen in ListHMACKeys. Also removed a redundant and potentially unsafe manual update of it.ctx inside the closure passed to run.

google-labs-jules Bot and others added 3 commits May 6, 2026 05:05
Moved the userProject metadata assignment so that it executes before initializing the ObjectIterator, following the robust pattern seen in ListHMACKeys. Also removed a redundant and potentially unsafe manual update of `it.ctx` inside the closure passed to `run`.

Co-authored-by: cpriti-os <202586561+cpriti-os@users.noreply.github.com>
Refactored `ListObjects` in `storage/grpc_client.go` to properly apply `userProject` metadata.
The metadata assignment is moved before initializing the `ObjectIterator` so the properly
populated context is passed down. The redundant update of `it.ctx` inside the `run`
closure has been removed, making it robust and consistent with other methods like
`ListHMACKeys`.

Co-authored-by: cpriti-os <202586561+cpriti-os@users.noreply.github.com>
Refactor userProject metadata propagation in ListObjects
fixes: b/503582409
@cpriti-os cpriti-os requested review from a team as code owners May 6, 2026 05:39
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label May 6, 2026
@cpriti-os cpriti-os requested a review from krishnamd-jkp May 6, 2026 05:40
Copy link
Copy Markdown
Contributor

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

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 refactors the ListObjects method in the gRPC storage client to ensure the userProject metadata is set on the context before the iterator is initialized. Additionally, it removes an unnecessary context assignment within the retry loop. I have no feedback to provide.

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.

1 participant