Repository navigation
fix(storage): pass transport factory to StorageClient in GrpcClient - #19263
Open
nidhiii-27 wants to merge 2 commits into
Open
nidhiii-27 wants to merge 2 commits into
nidhiii-27 wants to merge 2 commits into
Conversation
GrpcClient._create_gapic_client now passes transport and channel factory callables to storage_v2.StorageClient so transport initialization uses the standard GAPIC client pipeline. Public GrpcClient initialization signatures remain unchanged, and DirectPath is attempted in the default universe when no client certificate is in use. Updated unit tests in packages/google-cloud-storage/tests/unit/test_grpc_client.py to cover factory-based transport and channel initialization. [Generated-by: AI]
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the initialization of GrpcClient and the creation of the underlying GAPIC StorageClient to dynamically configure transport and channel factories. It improves the handling of credentials, API keys, and scopes, and ensures mTLS is correctly configured. Extensive unit tests have been added to verify these behaviors. A review comment suggests removing the _resolve_grpc_config helper function, as it has become dead code following the refactoring.
test_init_propagates_client_options_and_default_client_info in packages/google-cloud-storage/tests/unit/test_grpc_client.py now verifies DEFAULT_CLIENT_INFO propagation through StorageClient.get_bucket call metadata. Existing GrpcClient runtime behavior and remaining test coverage remain unchanged. [Generated-by: AI]
This branch has not been deployed
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.
GrpcClient._create_gapic_client now passes transport and channel factory callables to storage_v2.StorageClient so transport initialization uses the standard GAPIC client pipeline. Public GrpcClient initialization signatures remain unchanged, and DirectPath is attempted in the default universe when no client certificate is in use. Updated unit tests in packages/google-cloud-storage/tests/unit/test_grpc_client.py to cover factory-based transport and channel initialization.