Skip to content

Remove test-only helper export from host-iptables-network API surface#3879

Merged
lpcox merged 3 commits into
mainfrom
copilot/export-iptables-network-test-helper
May 27, 2026
Merged

Remove test-only helper export from host-iptables-network API surface#3879
lpcox merged 3 commits into
mainfrom
copilot/export-iptables-network-test-helper

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 26, 2026

src/host-iptables-network.ts was exporting iptablesNetworkTestHelpers, a test-only wrapper used exclusively by the co-located unit test. This leaked internal cleanup behavior from a security-critical module into its production API without any production callers.

  • API surface cleanup

    • Removed iptablesNetworkTestHelpers export from host-iptables-network.ts.
    • Kept cleanupFirewallNetwork as the explicit export used by tests, eliminating the unnecessary wrapper object.
  • Test alignment

    • Updated host-iptables-network.test.ts to import cleanupFirewallNetwork directly from ./host-iptables-network.
    • Removed destructuring of cleanupFirewallNetwork from the deleted helper object.
  • Resulting module shape

    • Production module no longer exposes a test-helper namespace.
    • Test behavior remains unchanged while the exported interface is narrower and clearer.
// before
import { iptablesNetworkTestHelpers } from './host-iptables-network';
const { cleanupFirewallNetwork } = iptablesNetworkTestHelpers;

// after
import { cleanupFirewallNetwork } from './host-iptables-network';

Copilot AI changed the title [WIP] Remove unused export of iptablesNetworkTestHelpers from production module Remove test-only helper export from host-iptables-network API surface May 26, 2026
Copilot finished work on behalf of lpcox May 26, 2026 22:37
Copilot AI requested a review from lpcox May 26, 2026 22:37
@lpcox lpcox marked this pull request as ready for review May 26, 2026 22:41
Copilot AI review requested due to automatic review settings May 26, 2026 22:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 96.57% 96.62% 📈 +0.05%
Statements 96.44% 96.48% 📈 +0.04%
Functions 98.22% 98.23% 📈 +0.01%
Branches 90.66% 90.70% 📈 +0.04%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/config-writer.ts 89.3% → 90.9% (+1.65%) 89.3% → 90.9% (+1.65%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the host-iptables-network module’s exported surface by removing the iptablesNetworkTestHelpers test-only export and updating the co-located unit test to call the cleanup function directly.

Changes:

  • Removed iptablesNetworkTestHelpers export from src/host-iptables-network.ts.
  • Promoted cleanupFirewallNetwork to a direct named export for test usage.
  • Updated src/host-iptables-network.test.ts to import cleanupFirewallNetwork directly.
Show a summary per file
File Description
src/host-iptables-network.ts Removes the test-helper export and directly exports the cleanup function.
src/host-iptables-network.test.ts Updates imports to use cleanupFirewallNetwork directly.

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: 1

Comment thread src/host-iptables-network.ts Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine

  • ✅ GitHub API: 2 recent PRs fetched
  • ✅ GitHub check: playwright_check PASS
  • ✅ File verify: smoke-test-claude-26482377687.txt exists

Result: PASS

💥 [THE END] — Illustrated by Smoke Claude

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Offline) Mode

  • ✅ GitHub MCP: PR Remove test-only helper export from host-iptables-network API surface #3879 "Remove test-only helper export from host-iptables-network API surface" found
  • ⚠️ HTTP connectivity: pre-step data unavailable (template vars not expanded)
  • ⚠️ File write/read: pre-step data unavailable (template vars not expanded)
  • ✅ BYOK inference: working — prompt received and response generated via api-proxy → api.githubcopilot.com

Running in BYOK offline mode (COPILOT_OFFLINE=true) via api-proxy → api.githubcopilot.com

PR author: @Copilot | Assignees: @lpcox, @Copilot

Overall: PARTIAL (BYOK path ✅, pre-step data missing ⚠️)

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions
Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

Test Result
GitHub MCP connectivity ✅ PASS
GitHub.com HTTP connectivity ⚠️ N/A (template vars unresolved)
File write/read ⚠️ N/A (template vars unresolved)

PR: "Remove test-only helper export from host-iptables-network API surface"
Author: @Copilot | Assignees: @lpcox, @Copilot

Overall: PARTIAL — MCP test passed; pre-step data unavailable due to unresolved workflow template expressions.

📰 BREAKING: Report filed by Smoke Copilot

@github-actions
Copy link
Copy Markdown
Contributor

Deduplicate OIDC getToken() across token providers via base-class implementation: ✅
refactor(oidc): extract duplicate cache-update/refresh-scheduling into base class: ✅
GitHub title check: ✅
Smoke file creation: ✅
Build AWF: ✅
Overall: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions
Copy link
Copy Markdown
Contributor

Gemini Engine Smoke Test Results

Overall Status: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini

@github-actions
Copy link
Copy Markdown
Contributor

Chroot Version Comparison — Smoke Test Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3 ❌ No
Node.js v24.15.0 v22.22.3 ❌ No
Go go1.22.12 go1.22.12 ✅ Yes

Result: ❌ FAILED — Python and Node.js versions differ between host and chroot.

Tested by Smoke Chroot

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results — FAIL

Check Result
Redis PING ❌ Timeout
PostgreSQL pg_isready ❌ No response
PostgreSQL SELECT 1 ❌ Not attempted (pg_isready failed)

host.docker.internal is not reachable on ports 6379 or 5432. Service containers may not be running or host networking is not available in this environment.

🔌 Service connectivity validated by Smoke Services

@github-actions
Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak 1/1 passed ✅ PASS
Deno std 1/1 passed ✅ PASS
.NET hello-world N/A (ran: Hello, World!) ✅ PASS
.NET json-parse N/A (ran: JSON parsed successfully) ✅ PASS
Go color all passed ✅ PASS
Go env all passed ✅ PASS
Go uuid all passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx all passed ✅ PASS
Node.js execa all passed ✅ PASS
Node.js p-limit all passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for issue #3879 · sonnet46 2.9M ·

@lpcox lpcox merged commit 6b5a94a into main May 27, 2026
61 of 64 checks passed
@lpcox lpcox deleted the copilot/export-iptables-network-test-helper branch May 27, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Export Audit] Test helper iptablesNetworkTestHelpers exported from security-critical production module

3 participants