refactor: [Export Audit] Remove test-only re-exports from barrel modules#3169
Conversation
Remove symbols from docker-manager.ts and host-iptables.ts barrels that are only consumed by test files. Test files now import directly from the source modules (host-env, compose-generator, container-lifecycle, host-iptables-rules, host-iptables-network). docker-manager.ts barrel: removed 19 test-only re-exports (AGENT_CONTAINER_NAME, ACT_PRESET_BASE_IMAGE, MIN_REGULAR_UID, validateIdNotInSystemRange, getSafeHostUid, getSafeHostGid, getRealUserHome, extractGhHostFromServerUrl, readGitHubPathEntries, readGitHubEnvEntries, parseGitHubEnvFile, mergeGitHubPathEntries, readEnvFile, subnetsOverlap, SslConfig, stripScheme, generateDockerCompose, isAgentExternallyKilled, resetAgentExternallyKilled). host-iptables.ts barrel: removed 2 test-only re-exports (isValidPortSpec, cleanupFirewallNetwork). Closes #3165 Closes #3166 Closes #3167 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Removes 21 test-only re-exports from the docker-manager.ts and host-iptables.ts barrel modules and updates the affected test files to import directly from the underlying source modules, narrowing the public API surface.
Changes:
- Trimmed
src/docker-manager.tsto re-export only production-consumed symbols (removed 19 host-env, compose-generator, container-lifecycle re-exports). - Trimmed
src/host-iptables.tsto dropisValidPortSpecandcleanupFirewallNetworkre-exports. - Updated five test files to import the removed symbols directly from their source modules.
Show a summary per file
| File | Description |
|---|---|
| src/docker-manager.ts | Removed 19 test-only re-exports; updated comment block. |
| src/host-iptables.ts | Removed isValidPortSpec/cleanupFirewallNetwork re-exports. |
| src/docker-manager-utils.test.ts | Re-pointed imports from ./docker-manager to ./host-env. |
| src/docker-manager-lifecycle.test.ts | Split imports across container-lifecycle, container-cleanup, host-env. |
| src/compose-generator.test.ts | Imports generateDockerCompose from ./compose-generator and ACT_PRESET_BASE_IMAGE from ./host-env. |
| src/host-iptables-setup.test.ts | Imports isValidPortSpec from ./host-iptables-rules. |
| src/host-iptables-network.test.ts | Imports cleanupFirewallNetwork from ./host-iptables-network. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 7/7 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.
|
@copilot please fix this failing ci check https://github.com/github/gh-aw-firewall/actions/runs/25889383307/job/76088950010?pr=3169 |
The test coverage failure was caused by missing The other CI failures are pre-existing and unrelated to this PR:
|
This comment has been minimized.
This comment has been minimized.
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 89.88% | 89.90% | 📈 +0.02% |
| Statements | 89.79% | 89.81% | 📈 +0.02% |
| Functions | 94.34% | 93.60% | 📉 -0.74% |
| Branches | 81.51% | 81.55% | 📈 +0.04% |
📁 Per-file Coverage Changes (1 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/config-writer.ts |
83.0% → 85.6% (+2.54%) | 83.0% → 85.6% (+2.54%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
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 fix the failing ci check https://github.com/github/gh-aw-firewall/actions/runs/25890271394/job/76111521947?pr=3169 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot recompile smoke claude |
Done — all 35 workflows recompiled and post-processed in commit |
Smoke Test Results
GitHub CLI authentication failed; other tests passed successfully.
|
Smoke Test: Copilot BYOK — Results
Note: Running in BYOK offline mode ( Overall: PARTIAL — BYOK inference works, but GitHub MCP returned 401 and pre-step template variables were not substituted.
|
Smoke Codex: FAILPRs: fix(api-proxy): route GPT-5 family models to /responses regardless of auth path; Fix token usage extraction for OpenAI Responses API ( 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
Overall: FAIL — GitHub MCP returned 401 Bad credentials.
|
Chroot Smoke Test Results
Overall: FAILED — Python and Node.js versions differ between host and chroot.
|
Smoke Test Results
Overall: FAIL —
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Gemini Engine Validation 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.
|
|
@copilot fix this failed ci check https://github.com/github/gh-aw-firewall/actions/runs/25899818114/job/76121041361?pr=3169 |
This failure is a transient infrastructure issue unrelated to the PR changes. All 4 failing tests in The same tests passed on |
Summary
Remove test-only re-exports from
docker-manager.tsandhost-iptables.tsbarrel modules. Test files now import directly from source modules, narrowing the public API surface.Changes
src/docker-manager.tsbarrel — removed 19 test-only re-exports:host-env:AGENT_CONTAINER_NAME,ACT_PRESET_BASE_IMAGE,MIN_REGULAR_UID,validateIdNotInSystemRange,getSafeHostUid,getSafeHostGid,getRealUserHome,extractGhHostFromServerUrl,readGitHubPathEntries,readGitHubEnvEntries,parseGitHubEnvFile,mergeGitHubPathEntries,readEnvFile,subnetsOverlap,SslConfig,stripSchemecompose-generator:generateDockerComposecontainer-lifecycle:isAgentExternallyKilled,resetAgentExternallyKilledsrc/host-iptables.tsbarrel — removed 2 test-only re-exports:isValidPortSpec(fromhost-iptables-rules)cleanupFirewallNetwork(fromhost-iptables-network)Test files updated to import directly from source modules:
docker-manager-utils.test.ts→ imports from./host-envcompose-generator.test.ts→ imports from./compose-generator+./host-envdocker-manager-lifecycle.test.ts→ imports from./container-lifecycle+./container-cleanup+./host-envhost-iptables-setup.test.ts→ imports from./host-iptables-ruleshost-iptables-network.test.ts→ imports from./host-iptables-networkVerification
npm run build)Closes #3165
Closes #3166
Closes #3167