Deduplicate Docker bridge gateway resolution in setupHostIptables#3821
Conversation
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
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot adddress review feedback |
Added a test covering the |
Smoke Test: Claude
Total: PASS
|
🔍 Smoke Test Results
PR: "Deduplicate Docker bridge gateway resolution in Overall: PARTIAL — GitHub MCP confirmed working; pre-computed step outputs were not injected into this workflow run.
|
Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Author: Overall: PASS (core BYOK inference path confirmed working)
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Chroot Version Comparison — Smoke Test Results
Overall: ❌ Not all runtimes matched. Python and Node.js versions differ between host and chroot environment.
|
|
Refactor host-access port spec parsing to remove duplicate logic
|
|
Smoke Test: Gemini Engine - 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
|
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.