Skip to content

renovate: update undici to v7 - #8583

Open
schaable wants to merge 3 commits into
mainfrom
update-undici
Open

renovate: update undici to v7#8583
schaable wants to merge 3 commits into
mainfrom
update-undici

Conversation

@schaable

@schaable schaable commented Aug 27, 2026

Copy link
Copy Markdown
Member
  • v7 removes the throwOnError request option and the maxRedirections dispatcher option, so both are replaced with the responseError and redirect interceptors.
  • The responseError interceptor throws a generic "Response Error" message. We replace it with Response status code <code>: <reason> to preserve the error messages currently exposed to consumers.
  • Tests now pass the mock agent directly as the dispatcher instead of composing the interceptor onto a mock pool, which hangs silently in v7.

Closes #8561

@schaable
schaable requested a lite review from Copilot August 27, 2026 15:22
@schaable schaable self-assigned this Aug 27, 2026
@schaable schaable added no docs needed This PR doesn't require links to documentation no peer bump needed labels Aug 27, 2026
@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b54b6b6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nomicfoundation/hardhat-utils Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@socket-security

socket-security Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedundici@​7.29.09310010096100

View full report

@github-actions

Copy link
Copy Markdown
Contributor

hardhat

Total size of the bundle: 38M
Total number of dependencies (including transitive): 37

List of dependencies (sorted by size)
30M	total
7.3M	@sentry/core
5.2M	zod
2.7M	micro-eth-signer
2.2M	undici
1.9M	@noble/curves
1.3M	@nomicfoundation/hardhat-utils
1.2M	@noble/hashes
884K	@nomicfoundation/hardhat-vendored
864K	@streamparser/json
692K	tsx
656K	@nomicfoundation/hardhat-errors
624K	micro-packed
492K	@scure/bip39
408K	json-stream-stringify
368K	ethereum-cryptography
332K	@streamparser/json-node
320K	enquirer
320K	@nomicfoundation/hardhat-zod-utils
292K	semver
204K	ws
204K	adm-zip
168K	esbuild
168K	@scure/base
152K	@nomicfoundation/edr
136K	fast-equals
100K	chokidar
96K	@scure/bip32
72K	@nomicfoundation/solidity-analyzer
56K	rfdc
48K	ansi-colors
44K	resolve.exports
44K	readdirp
36K	p-map
24K	strip-ansi
24K	is-safe-filename
24K	env-paths
24K	ansi-regex

Copilot AI 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.

Pull request overview

Updates Hardhat’s request utilities and related tests to be compatible with undici v7, replacing removed throwOnError/maxRedirections options with the responseError and redirect interceptors while preserving the error messaging that consumers rely on.

Changes:

  • Bump undici to ^7.29.0 (lockfile + @nomicfoundation/hardhat-utils dependency) and add a changeset for the hardhat-utils release.
  • Update the request utility to compose redirect + responseError interceptors and restore actionable status-code error messages.
  • Refactor multiple test suites to pass the MockAgent as the dispatcher (keeping intercept declaration separate), and add/adjust tests for redirects and error causes.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm-lock.yaml Locks undici to v7.29.0 across the workspace.
packages/hardhat/test/utils.ts Updates test dispatcher helper to return both interceptable + dispatcher (MockAgent).
packages/hardhat/test/internal/cli/banner-manager.ts Passes MockAgent as testDispatcher instead of the interceptable.
packages/hardhat/test/internal/builtin-plugins/network-manager/http-provider.ts Uses { interceptor, dispatcher } and passes the dispatcher to HttpProvider.
packages/hardhat-verify/test/verification.ts Uses ETHERSCAN_API_URL constant and passes the dispatcher through to verification flows.
packages/hardhat-verify/test/utils.ts Exposes dispatcher alongside interceptable for undici v7-compatible mocking.
packages/hardhat-verify/test/sourcify.ts Passes the dispatcher (MockAgent) into Sourcify instead of the interceptable.
packages/hardhat-verify/test/etherscan.ts Passes the dispatcher (MockAgent) into Etherscan instead of the interceptable.
packages/hardhat-verify/test/blockscout.ts Passes the dispatcher (MockAgent) into Blockscout instead of the interceptable.
packages/hardhat-utils/test/request.ts Updates expectations for removed undici options; adds redirect + error-cause coverage for v7 behavior.
packages/hardhat-utils/test/helpers/request.ts Returns { interceptor, dispatcher } from the test helper for v7-safe usage.
packages/hardhat-utils/src/internal/request.ts Composes redirect + responseError interceptors and restores status-code error messages.
packages/hardhat-utils/package.json Bumps undici dependency to ^7.29.0.
packages/hardhat-slang-solx/test/downloader.ts Updates downloader tests to pass MockAgent as dispatcher and keep intercept setup separate.
.changeset/quiet-donkeys-tickle.md Declares a minor release for @nomicfoundation/hardhat-utils due to the undici update.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/hardhat-utils/test/helpers/request.ts Outdated
Copilot AI review requested due to automatic review settings August 27, 2026 15:39

Copilot AI 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.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread packages/hardhat-slang-solx/test/downloader.ts
Copilot AI review requested due to automatic review settings August 27, 2026 15:54

Copilot AI 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.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

.changeset/quiet-donkeys-tickle.md:5

  • This changeset note doesn’t mention that undici v7 now requires Node.js >=20.18.1 (see pnpm-lock.yaml:7169). That’s a consumer-visible constraint change, so it should be called out in the release notes (and potentially affects whether a minor bump is sufficient).
Updated undici to v7.

@kanej
kanej self-requested a review August 27, 2026 16:21
@kanej kanej changed the title feat: update undici to v7 renovate: update undici to v7 Aug 31, 2026
Copilot AI review requested due to automatic review settings August 31, 2026 10:17

Copilot AI 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.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

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

Labels

no docs needed This PR doesn't require links to documentation no peer bump needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update undici to latest major

2 participants