Skip to content

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

Merged
cpriti-os merged 7 commits into
googleapis:mainfrom
cpriti-os:bill
May 13, 2026
Merged

fix(storage): refactor userProject metadata propagation in ListObjects #14533
cpriti-os merged 7 commits into
googleapis:mainfrom
cpriti-os:bill

Conversation

@cpriti-os

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

Copy link
Copy Markdown
Contributor

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

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

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.

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.

Comment thread storage/grpc_client_test.go
@cpriti-os cpriti-os merged commit fbb543e into googleapis:main May 13, 2026
11 checks passed
@cpriti-os cpriti-os deleted the bill branch May 13, 2026 05:09
cpriti-os added a commit that referenced this pull request May 18, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.13.2-0.20260514223035-a22d6b5a1329
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-go@sha256:b04b076f5eedbb5546bd6fc1404969dd3698c8b19c0f34ae815a84ae735a606a
<details><summary>storage: v1.62.2</summary>

##
[v1.62.2](storage/v1.62.1...storage/v1.62.2)
(2026-05-18)

### Features

* enable open telemetry attrs (#14426)
([74eab64](74eab64d))

### Bug Fixes

* restore metadata operations timeout in gRPC (#14575)
([275ff56](275ff562))

* Set default chunkRetryDeadline to 32s in NewWriterFromAppendableObject
(#14458)
([ec7c7d6](ec7c7d66))

* refactor userProject metadata propagation in ListObjects (#14533)
([fbb543e](fbb543e3))

</details>
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