Skip to content

fix(core): discovery url handling, error code review helper, and pack-n-play test timeouts - #9061

Merged
bshaffer merged 6 commits into
mainfrom
core-ci-fixes
Aug 5, 2026
Merged

fix(core): discovery url handling, error code review helper, and pack-n-play test timeouts#9061
bshaffer merged 6 commits into
mainfrom
core-ci-fixes

Conversation

@bshaffer

@bshaffer bshaffer commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Separated from #9058 to isolate Core library and pack-n-play CI fixes:

  • Resolves url.parse deprecations and Node 22+ URL discovery handling in nodejs-googleapis-common
  • Adds getErrorCode helper to gcp-metadata to properly unwrap AggregateError / cause hierarchies
  • Increases Windows CI timeout to 120s and adds --no-audit --no-fund flags in pack-n-play test fixtures

@bshaffer
bshaffer requested a review from a team as a code owner August 3, 2026 19:11

@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 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.

Comment thread core/packages/gcp-metadata/src/index.ts Outdated
Comment thread core/dev-packages/pack-n-play/test/test.ts
'Content-Type': 'application/json',
});
const disco = new Discovery({});
const makeEndpoint = await disco.discoverAPI(discoUrl);

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.

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?!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it must have been a hallucination 😦 I've reverted it.

Comment thread core/packages/nodejs-googleapis-common/test/test.discovery.ts Outdated
Comment thread core/packages/gcp-metadata/src/index.ts
@bshaffer
bshaffer merged commit 340364f into main Aug 5, 2026
34 checks passed
@bshaffer
bshaffer deleted the core-ci-fixes branch August 5, 2026 18:30
@release-please release-please Bot mentioned this pull request Aug 5, 2026
shivanee-p pushed a commit that referenced this pull request Aug 6, 2026
🤖 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>
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