Repository navigation
test: normalize compressed IPv6 addresses in dev server output - #4878
Conversation
The IPv6 pattern only matched the full eight-group form, so a unique local address such as [fdb2:2c26:f4e4::1] reached the serve snapshots unchanged, and a full address would have kept its brackets twice. Match the bracketed host in any form, except the [::1] loopback, and replace it with its brackets.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe test utility now validates bracketed full or compressed IPv6 hosts, including optional zone identifiers, before normalizing stderr output. Valid non-loopback IPv6 hosts become Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
0bc5b63e-f617-4966-a177-7344c4640650
📒 Files selected for processing: 1
test/utils/test-utils.js
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
The pattern also matched tokens such as [1:2] or [dead:beef]. Check the bracket contents with net.isIPv6 before replacing them, and cover normalizeStderr's IPv6 handling with unit tests.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4878 +/- ##
=======================================
Coverage 94.85% 94.85%
=======================================
Files 14 14
Lines 5637 5637
Branches 846 846
=======================================
Hits 5347 5347
Misses 289 289
Partials 1 1 Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
This PR is packaged and the instant preview is available (eefa89c). Install it locally:
npm i -D create-webpack-app@https://pkg.pr.new/create-webpack-app@eefa89c webpack-cli@https://pkg.pr.new/webpack-cli@eefa89c
yarn add -D create-webpack-app@https://pkg.pr.new/create-webpack-app@eefa89c webpack-cli@https://pkg.pr.new/webpack-cli@eefa89c
pnpm add -D create-webpack-app@https://pkg.pr.new/create-webpack-app@eefa89c webpack-cli@https://pkg.pr.new/webpack-cli@eefa89c |
Fixes #4877
normalizeStderrreplaced IPv6 addresses with a pattern that only matched the full eight-group form. A unique local address likefdb2:2c26:f4e4::1is compressed, so it reached the serve snapshots as-is. A full address would have come out ashttp://[[x:x:x:x:x:x:x:x]]:…, since the replacement adds brackets around a match that was already inside brackets. The pattern now matches the bracketed host in any form and replaces it, brackets included. The[::1]loopback that the snapshots keep is left alone. The synthetic IPv6 line for runners without IPv6 is unchanged.Testing:
test/serve/basicin a Node 24 container on three podman networks.eth0(fd22:5ef7:fe09:7596::/64)On Your Network (IPv6): http://[fd22:…::6]:<port>/In every run,
should not start dev server when supplied false #1hits its 180 s timeout, and it does that without this change too. It looks environmental (a watch run that never ends in my container), not related to the output normalization.Note: I used Claude Code while working on this.
Summary by CodeRabbit
[::1]and unchanged bracketed text that is not an IPv6 address.