Remove dead __testing export from host-iptables public API#3080
Conversation
__testing export from host-iptables module__testing export from host-iptables public API
There was a problem hiding this comment.
Pull request overview
This PR hardens the host-iptables facade’s public API by removing the dead __testing export (which leaked IPv6 state mutation internals) and updates the unit tests to use the internal reset helper directly from the shared module.
Changes:
- Removed the unused
__testingexport (and its_resetIpv6Stateimport) fromsrc/host-iptables.ts. - Updated host-iptables unit tests to import
_resetIpv6Statefromsrc/host-iptables-shared.tsand pass it tosetupHostIptablesTestSuite.
Show a summary per file
| File | Description |
|---|---|
| src/host-iptables.ts | Removes __testing from the facade to avoid leaking internal IPv6 reset functionality on the module’s public surface. |
| src/host-iptables-setup.test.ts | Switches test reset wiring from __testing._resetIpv6State to direct _resetIpv6State import. |
| src/host-iptables-network.test.ts | Same test boundary change: imports _resetIpv6State from host-iptables-shared. |
| src/host-iptables-host-access.test.ts | Same test boundary change: imports _resetIpv6State from host-iptables-shared. |
| src/host-iptables-doh.test.ts | Same test boundary change: imports _resetIpv6State from host-iptables-shared. |
| src/host-iptables-cleanup.test.ts | Same test boundary change: imports _resetIpv6State from host-iptables-shared. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 0
🔬 Smoke Test Results
Overall: FAIL — GitHub MCP auth unavailable in this environment; workflow template variables were not interpolated before reaching the agent.
|
Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Overall: PARTIAL — BYOK inference works; pre-step data (
|
Smoke Test Results✅ Playwright: Navigated to github.com, title confirmed Result: 2/3 tests passed
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Chroot Smoke Test Results
Overall: ❌ FAILED — Python and Node.js versions differ between host and chroot.
|
Gemini Engine Smoke Test Results
Overall Status: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Smoke Test Results
Overall: FAIL — service containers are not reachable via
|
|
Smoke Test: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Bug Fix
What was the bug?
src/host-iptables.tsexposed a dead__testingexport that leaked_resetIpv6Stateon a security-critical module’s public surface. The symbol had no non-test consumers and unnecessarily exposed IPv6 firewall state mutation internals.How did you fix it?
API surface hardening
__testingfromsrc/host-iptables.ts._resetIpv6Statetied only to that export.Test boundary cleanup
_resetIpv6Statedirectly fromsrc/host-iptables-shared.tsinstead of via__testingon the public facade.setupHostIptablesTestSuite(_resetIpv6State)), while eliminating the leaked public symbol.Example