{{ message }}
Repository navigation
fix(pubsub): align ClientConfig.port type with gax.GrpcClientOptions - #9539
Merged
danieljbruce merged 2 commits intoOct 6, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the ClientConfig interface in handwritten/pubsub/src/pubsub.ts to restrict the port property to only accept a number instead of string or number. There are no review comments, and I have no feedback to provide.
danieljbruce
marked this pull request as draft
October 6, 2026 17:15
danieljbruce
marked this pull request as ready for review
October 6, 2026 18:01
quirogas
reviewed
Oct 6, 2026
Contributor
There was a problem hiding this comment.
Nit: We should probably look more into this callback instead of disabling it.
Contributor
Author
There was a problem hiding this comment.
Sounds good. I put this in our backlog (https://b.corp.google.com/issues/570625459).
quirogas
approved these changes
Oct 6, 2026
Merged
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>
This was referenced Oct 6, 2026
shivanee-p
added a commit
that referenced
this pull request
Oct 6, 2026
Reverts PR #9539 as to not break customers. The `port` type definition was expanded in PR#3542 as a non-breaking change. --------- Co-authored-by: Santiago Quiroga <22756465+quirogas@users.noreply.github.com>
danieljbruce
added a commit
that referenced
this pull request
Oct 7, 2026
…ent_ (#9544) ## Description Replaces the `.then().catch()` promise chain and `promise/no-callback-in-promise` ESLint disable comments in `PubSub.prototype.getClient_` with an `async` IIFE and `try / catch` block. ## Impact Prevents synchronous errors thrown inside the `getClient_` callback from being caught by `.catch(callback)` and invoking the callback a second time, while satisfying `eslint-plugin-promise` rules without lint suppressions (follow-up to #9539). ## Changes - Refactored `PubSub.prototype.getClient_` in `handwritten/pubsub/src/pubsub.ts` to `await this.getClientAsync_(config)` inside a `try / catch` block within a `void (async () => { ... })()` IIFE and invoke `callback(null, client)` outside the `try / catch` block. - Removed the two `// eslint-disable-next-line promise/no-callback-in-promise` comments in `handwritten/pubsub/src/pubsub.ts`. ## Testing - Verified existing `getClient_` and `request` unit tests in `handwritten/pubsub/test/pubsub.ts` pass (`105 passing`). - Verified `GIT_DIFF_ARG=upstream/main node ./bin/linter.mjs --strict` passes with zero ESLint errors or warnings and passes TypeScript type checking. ## Alternatives - Keep the `.then().catch()` chain with `eslint-disable-next-line promise/no-callback-in-promise` comments: rejected because if `callback(null, client)` throws synchronously, `.catch(callback)` catches that error and invokes `callback` a second time.
This was referenced Oct 8, 2026
danieljbruce
added a commit
that referenced
this pull request
Oct 15, 2026
## Description This PR adds a lightweight, `pnpm`-based breaking-change check workflow as an alternative to the 1,764-line custom TypeScript AST/TypeChecker script in #9583, without adding any custom script files in `bin/`: 1. **Workspace dependent compilation via `pnpm --filter "...[HEAD^1...HEAD]"`**: Passes `--config.link-workspace-packages=deep --config.prefer-workspace-packages=true` to `pnpm` so modified `core/*` and `handwritten/*` packages are linked and compiled alongside their downstream workspace dependents (catching cross-package breakages like #9496 where a `google-gax` change broke `@google-cloud/pubsub`). 2. **Declaration comparison via `pnpm dlx @api-extractor-tools/change-detector`**: Emits `.d.ts` declarations for modified TypeScript files (`HEAD^1` vs `HEAD`) and runs `pnpm dlx @api-extractor-tools/change-detector /tmp/base.d.ts /tmp/head.d.ts --json`, flagging any removed exports/members (`action === 'removed'`) or narrowed types (`impact === 'narrowing'`). ## Impact - **CI / Pull Requests**: Automatically checks `core/*` and `handwritten/*` TypeScript changes for breaking public API changes and cross-package compilation regressions. - **Maintainability**: Only adds `.github/workflows/breaking-change-check.yaml` (113 lines) with zero custom `bin/breaking-change-check.mjs` code to maintain. ## Changes - [`.github/workflows/breaking-change-check.yaml`](.github/workflows/breaking-change-check.yaml): Compiles affected packages and workspace dependents via `pnpm --filter "...[HEAD^1...HEAD]"` and checks modified declarations using `pnpm dlx @api-extractor-tools/change-detector`. ## Testing - Verified against #9539 (`4443d6d6b1`) that `pnpm dlx @api-extractor-tools/change-detector` detects `Narrowed type of 'ClientConfig.port' from 'string | number' to 'number'` (`impact: "narrowing"`). - Verified against the revert in #9549 (`d62a64f338`) that widening `ClientConfig.port` back to `string | number` is classified as `impact: "widening"` and passes with zero errors. - Verified `pnpm --config.link-workspace-packages=deep --config.prefer-workspace-packages=true --filter "...[17978e7^1...17978e7]" --filter "!./packages/*"` discovers `@google-cloud/pubsub` and all other `core/*` and `handwritten/*` dependents of `google-gax` (#9496). ## Alternatives - **1,764-line custom AST/TypeChecker script in `bin/breaking-change-check.mjs` (#9583)**: Requires maintaining custom AST transformation passes, custom module resolution, and undocumented internal TypeScript `TypeChecker` calls inside this repository.
This was referenced Oct 19, 2026
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.

Summary
Fixes the
@google-cloud/pubsubpack-and-install system test failure (should be able to use the d.ts):Root Cause
In #9496 (released in
google-gax@6.11.0),GrpcClientOptionsaddedport?: number;. In@google-cloud/pubsub,ClientConfigextendsgax.GrpcClientOptionsbut declaredport?: string | number;, causing TypeScript compilation withskipLibCheck: falseto fail when resolvinggoogle-gax@6.11.0+.Internally,
PubSub#determineBaseUrl_already parsesportas anumber(orundefined), matchinggax.GrpcClientOptionsandgax.ClientOptions.Changes
ClientConfig.portinhandwritten/pubsub/src/pubsub.tsfromstring | numbertonumber.