fix(core): discovery url handling, error code review helper, and pack-n-play test timeouts - #9061
Conversation
…-n-play test timeouts
There was a problem hiding this comment.
Code Review
This pull request updates test timeouts and npm install flags in pack-n-play, replaces the deprecated url.parse with the modern URL API in nodejs-googleapis-common, and introduces a helper to extract error codes from nested errors in gcp-metadata. The review feedback highlights a potential issue in gcp-metadata where a wrapper error containing an AggregateError as its cause would fail to resolve properly and return 'UNKNOWN'. A recursive unwrapping function is suggested to handle this robustly.
| 'Content-Type': 'application/json', | ||
| }); | ||
| const disco = new Discovery({}); | ||
| const makeEndpoint = await disco.discoverAPI(discoUrl); |
There was a problem hiding this comment.
I think discoverAPI used to handle URLs without ports, so we should keep that part of the test (even if we need to pass the port to nock.)
Unless the test never passed?!
There was a problem hiding this comment.
the reason we added the port is we switched to using new URL() API from the deprecated url.parse(), and the new URL() API requires a port.
There was a problem hiding this comment.
I'm not sure new URL() requires a port: https://nodejs.org/api/url.html#new-urlinput-base
If it did, I think we would need to update discoverAPI to infer a port based on the scheme (or modify the callers to make sure they pass a port)
I do think nock might need one. So it might be more correct to pass a port to nock and skip the port for discoverAPI.
There was a problem hiding this comment.
You're right, it must have been a hallucination 😦 I've reverted it.
🤖 I have created a release *beep* *boop* --- <details><summary>pack-n-play: 5.0.1</summary> ## [5.0.1](pack-n-play-v5.0.0...pack-n-play-v5.0.1) (2026-08-05) ### Bug Fixes * **core:** Discovery url handling, error code review helper, and pack-n-play test timeouts ([#9061](#9061)) ([340364f](340364f)) </details> <details><summary>gcp-metadata: 9.0.1</summary> ## [9.0.1](gcp-metadata-v9.0.0...gcp-metadata-v9.0.1) (2026-08-05) ### Bug Fixes * **core:** Discovery url handling, error code review helper, and pack-n-play test timeouts ([#9061](#9061)) ([340364f](340364f)) </details> <details><summary>googleapis-common: 9.0.1</summary> ## [9.0.1](googleapis-common-v9.0.0...googleapis-common-v9.0.1) (2026-08-05) ### Bug Fixes * **core:** Discovery url handling, error code review helper, and pack-n-play test timeouts ([#9061](#9061)) ([340364f](340364f)) </details> <details><summary>bigquery: 9.0.1</summary> ## [9.0.1](bigquery-v9.0.0...bigquery-v9.0.1) (2026-08-05) ### Bug Fixes * **bigquery:** Remove owlbot configs ([#8936](#8936)) ([7f8e23c](7f8e23c)) </details> <details><summary>bigtable: 7.1.0</summary> ## [7.1.0](bigtable-v7.0.0...bigtable-v7.1.0) (2026-08-05) ### Features * **bigtable:** Split gapic and proto usage from the handwritten library into bigtable-api ([#8934](#8934)) ([f63f914](f63f914)) </details> <details><summary>databasecenter: 0.4.1</summary> ## [0.4.1](databasecenter-v0.4.0...databasecenter-v0.4.1) (2026-08-05) ### Bug Fixes * Upgrade types sinon for databasecenter ([#9098](#9098)) ([23aee11](23aee11)) </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>
Separated from #9058 to isolate Core library and pack-n-play CI fixes: