Skip to content

fix(gax): widen port to number | string in GrpcClientOptions - #9542

Merged
shivanee-p merged 2 commits into
mainfrom
shivaneep-pubsub-port
Oct 6, 2026
Merged

shivanee-p merged 2 commits into
mainfrom
shivaneep-pubsub-port

Conversation

@shivanee-p

@shivanee-p shivanee-p commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Widens port from number to number | string on GrpcClientOptions and ClientStubOptions in google-gax to restore type compatibility with downstream client libraries (such as @google-cloud/pubsub, whose ClientConfig extends gax.GrpcClientOptions with port?: string | number)

#9496 added port?: number to GrpcClientOptions (released in [email protected]). Because @google-cloud/pubsub's ClientConfig interface extends gax.GrpcClientOptions and declares port?: string | number, TypeScript compilation with skipLibCheck: false (such as in @google-cloud/pubsub's system-test/install.ts) fails

@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 updates the gax package to support string values for port configurations across fallback, gRPC, metadata resolver, and resumable upload modules. The feedback suggests using parseInt(rawPort, 10) instead of Number(rawPort) in metadataResolver.ts to maintain consistency with other modules and prevent parsing failures on strings with trailing non-numeric characters.

Comment thread core/packages/gax/src/observability/metadataResolver.ts Outdated
@shivanee-p
shivanee-p force-pushed the shivaneep-pubsub-port branch from 7025e51 to e53f1ed Compare October 6, 2026 19:44
@shivanee-p
shivanee-p marked this pull request as ready for review October 6, 2026 19:44
@shivanee-p
shivanee-p requested a review from a team as a code owner October 6, 2026 19:44
@github-actions
github-actions Bot requested a review from feywind October 6, 2026 19:44
@shivanee-p
shivanee-p merged commit 17978e7 into main Oct 6, 2026
47 checks passed
@shivanee-p
shivanee-p deleted the shivaneep-pubsub-port branch October 6, 2026 19:53
@release-please release-please Bot mentioned this pull request Oct 6, 2026
shivanee-p pushed a commit that referenced this pull request Oct 6, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>google-gax: 6.11.1</summary>

##
[6.11.1](google-gax-v6.11.0...google-gax-v6.11.1)
(2026-10-06)


### Bug Fixes

* **gax:** Only set resend_count on T4 attempt spans
([#9540](#9540))
([3b3f600](3b3f600))
* **gax:** Widen port to number | string in GrpcClientOptions
([#9542](#9542))
([17978e7](17978e7))
</details>

<details><summary>pubsub: 6.1.1</summary>

##
[6.1.1](pubsub-v6.1.0...pubsub-v6.1.1)
(2026-10-06)


### Bug Fixes

* **pubsub:** Align ClientConfig.port type with gax.GrpcClientOptions
([#9539](#9539))
([4443d6d](4443d6d))
* **test-utils:** Make google-test-utils a private workspace package
([#9525](#9525))
([be25b6f](be25b6f))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants