fix(storage): refactor userProject metadata propagation in ListObjects #14533
Open
cpriti-os wants to merge 5 commits intogoogleapis:mainfrom
Open
fix(storage): refactor userProject metadata propagation in ListObjects #14533cpriti-os wants to merge 5 commits intogoogleapis:mainfrom
cpriti-os wants to merge 5 commits intogoogleapis:mainfrom
Conversation
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
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.