fix: check iptables availability before host firewall setup#5136
Conversation
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 97.27% | 97.28% | 📈 +0.01% |
| Statements | 97.15% | 97.15% | ➡️ +0.00% |
| Functions | 98.81% | 98.82% | ➡️ +0.01% |
| Branches | 91.94% | 91.90% | 📉 -0.04% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/host-iptables-rules.ts |
100.0% → 98.7% (-1.34%) | 100.0% → 98.7% (-1.32%) |
src/workdir-setup.ts |
92.6% → 94.4% (+1.85%) | 92.6% → 94.4% (+1.85%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
There was a problem hiding this comment.
Pull request overview
This PR improves host firewall setup diagnostics by explicitly checking that iptables is installed before probing/creating the DOCKER-USER chain, and it updates/extends Jest coverage to exercise the new dependency-check path.
Changes:
- Add an
iptables --versionpreflight incheckPermissionsAndSetupChain()and convert missing-command failures into a clear “install iptables” error. - Extend test helpers and update existing iptables-mocking sequences to account for the new preflight call.
- Add a focused unit test asserting the missing-iptables behavior and ensuring no
DOCKER-USERchain operations are attempted.
Show a summary per file
| File | Description |
|---|---|
| src/host-iptables-rules.ts | Adds iptables availability preflight + helper utilities used during host firewall setup. |
| src/test-helpers/host-iptables-test-setup.ts | Adds an ENOENT/missing-command mock helper and updates default execa mock sequencing. |
| src/host-iptables-setup.test.ts | Adds coverage for missing iptables and updates other tests’ mock call order for --version. |
| src/host-iptables-doh.test.ts | Updates mock sequencing to include the new iptables --version call. |
| src/host-iptables-coverage.test.ts | Updates targeted branch-coverage test setup to include the new preflight call. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 1
|
✅ Copilot review passed with no inline comments. @copilot Add the |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (7 files)
✨ New Files (4 files)
Coverage comparison generated by |
|
❌ Smoke Claude failed Smoke test invocation received with no specific task in the user prompt. No GitHub action required — workflow context loaded successfully (skills, CLAUDE.md project guidance, and safe-outputs MCP server all available). |
|
✅ Contribution Check completed successfully! |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🔌 Smoke Services — Service connectivity was cancelled |
|
✅ Build Test Suite completed successfully! |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
🔥 Smoke Test ResultsPR: fix: check iptables availability before host firewall setup
Overall: PASS
|
|
Add comprehensive gVisor firewall comparison workflow ✅ 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 Results — Auth mode: PAT (COPILOT_GITHUB_TOKEN)
Overall: FAIL — file test unverifiable due to unresolved
|
🔍 Smoke Test: API Proxy OpenTelemetry Tracing
All 5 scenarios passed.
|
|
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra Status: PASS
|
Copilot BYOK Smoke Test: PASS ✅
Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY) → api-proxy sidecar → api.githubcopilot.com Assignees:
|
|
docs: sync schemas and specs with source changes: ✅ PASS
|
Chroot Version Comparison Results
Overall: ❌ FAILED — Python and Node.js versions differ between host and chroot environments.
|
Smoke Test Results
PR Titles:
Overall Status: PASS (Workaround used for GitHub reads) 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
|
Host firewall setup could report misleading
DOCKER-USERchain errors wheniptableswas not installed at all. This adds an explicit availability check so missing dependencies fail with the actionable root cause.Dependency check
iptables --versionbefore inspectingDOCKER-USER.ENOENT/ missing-command failures and returns a clear install message.Error handling
DOCKER-USERchain creation when theiptablesbinary is absent.Test coverage
iptables.Example failure message: