Skip to content

fix(storage): pass transport factory to StorageClient in GrpcClient - #19263

Open
nidhiii-27 wants to merge 2 commits into
mainfrom
fix/storage-grpc-client-transport-factory
Open

nidhiii-27 wants to merge 2 commits into
mainfrom
fix/storage-grpc-client-transport-factory

Conversation

@nidhiii-27

Copy link
Copy Markdown
Contributor

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.

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]

@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 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]
@nidhiii-27
nidhiii-27 marked this pull request as ready for review November 29, 2026 17:01
@nidhiii-27
nidhiii-27 requested review from a team as code owners November 29, 2026 17:01
@nidhiii-27
nidhiii-27 removed request for a team November 29, 2026 17:01

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants