Deduplicate Docker bridge gateway resolution in setupHostIptables#3821
Deduplicate Docker bridge gateway resolution in setupHostIptables#3821Copilot wants to merge 3 commits into
setupHostIptables#3821Conversation
setupHostIptables
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
Refactors setupHostIptables() to avoid redundant docker network inspect bridge calls by resolving the Docker bridge gateway once and sharing the resulting gatewayIps across both the CLI-proxy and host-access rule paths.
Changes:
- Hoists Docker bridge gateway resolution behind a single
needsGatewayIpsguard and builds one sharedgatewayIpsarray. - Updates both
cliProxyConfigandhostAccess.enabledrule generation to reuse the shared gateway IP list. - Adds a unit test asserting the Docker bridge gateway is queried exactly once when both features are enabled.
Show a summary per file
| File | Description |
|---|---|
| src/host-iptables-rules.ts | Deduplicates Docker bridge gateway lookup and shares gatewayIps between CLI-proxy and host-access rule branches. |
| src/host-iptables-setup.test.ts | Adds regression test ensuring only one Docker bridge gateway lookup occurs when both branches are active. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
Smoke Test: Claude Engine
Result: PASS
|
🔥 Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Overall: PASS | PR by
|
🔬 Smoke Test Results
PR: Deduplicate Docker bridge gateway resolution in Overall: PASS ✅
|
|
Merged PRs:
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.
|
|
Smoke Test Result: FAIL. PR titles: [Unable to retrieve]. Connectivity: FAIL (SSL Error). File/Bash: PASS. 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.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Chroot Version Comparison — Smoke Test Results
Result: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.
|
Smoke Test Results — FAIL
|
|
@copilot adddress review feedback |
Added a test covering the |
setupHostIptables()was resolving the Docker bridge gateway and constructinggatewayIpstwice in separate branches (cliProxyConfigandhostAccess.enabled). When both paths were active, this triggered redundantdocker network inspect bridgecalls for the same value.Refactor: shared gateway resolution
cliProxyConfig || hostAccess?.enabled)gatewayIpsarrayBehavior guardrail
cliProxyConfigandhostAccessare enabled.