Skip to content

refactor: remove dead re-exports from cli.ts and unexport ExecaMockResult#2992

Merged
lpcox merged 1 commit into
mainfrom
fix/export-audit-dead-reexports
May 12, 2026
Merged

refactor: remove dead re-exports from cli.ts and unexport ExecaMockResult#2992
lpcox merged 1 commit into
mainfrom
fix/export-audit-dead-reexports

Conversation

@lpcox
Copy link
Copy Markdown
Collaborator

@lpcox lpcox commented May 12, 2026

Summary

Remove dead barrel re-exports from src/cli.ts and unexport the unused ExecaMockResult interface.

Changes

src/cli.ts — Removed all 38 dead barrel re-exports added during the cli.ts split refactor. Every consumer already imports directly from the source modules (domain-utils, api-proxy-config, option-parsers, dns-resolver, copilot-api-resolver), so these re-exports only widened the public API surface without providing value.

src/cli.test.ts — Updated imports: copilot API functions now imported from copilot-api-resolver directly instead of the cli barrel.

src/test-helpers/host-iptables-test-setup.ts — Removed export from ExecaMockResult interface. The type is only used internally by execaResult() and MockedExecaFn within the same file — no external consumer imports it.

Verification

  • npx tsc --noEmit — passes
  • npx jest cli.test.ts host-iptables — all 72 tests pass

Closes #2991
Closes #2990

…sult

- Remove all 38 dead barrel re-exports from src/cli.ts that were
  added during the cli.ts split but never consumed via the cli module
  (all consumers import directly from the source modules)
- Remove deprecated DEFAULT_DNS_SERVERS re-export (all consumers
  import from dns-resolver.ts directly)
- Remove export keyword from ExecaMockResult interface in
  host-iptables-test-setup.ts (never imported outside its file)
- Update cli.test.ts to import copilot API functions from
  copilot-api-resolver.ts instead of the cli barrel

Closes #2991
Closes #2990

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lpcox lpcox requested a review from Mossaka as a code owner May 12, 2026 02:03
Copilot AI review requested due to automatic review settings May 12, 2026 02:03
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 87.89% 87.81% 📉 -0.08%
Statements 87.85% 87.77% 📉 -0.08%
Functions 83.51% 92.12% 📈 +8.61%
Branches 79.79% 79.84% 📈 +0.05%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/cli.ts 98.3% → 85.7% (-12.59%) 98.3% → 85.7% (-12.62%)
src/container-lifecycle.ts 87.3% → 88.4% (+1.09%) 87.7% → 88.7% (+1.06%)

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

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results:
✅ Playwright: GitHub.com navigation + title verification
✅ File Write: Test file created
✅ Bash Verify: File contents confirmed
❌ GitHub MCP Read: gh CLI not authenticated

Overall: PASS (3/4 tests succeeded)

💥 [THE END] — Illustrated by Smoke Claude

@github-actions
Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

Test Status
GitHub MCP connectivity ❌ (401 Bad credentials)
GitHub.com HTTP ⚠️ (pre-step data unavailable — template vars not resolved)
File write/read ⚠️ (pre-step data unavailable — template vars not resolved)

Overall: FAIL

Template variables (${{ steps.smoke-data.outputs.* }}) were not interpolated at runtime, so pre-computed results could not be verified.

📰 BREAKING: Report filed by Smoke Copilot

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Offline) Mode

  1. ✅ GitHub MCP — skipped (401 in this run)
  2. ✅ GitHub.com connectivity — HTTP 200
  3. ⚠️ File write/read — template vars not expanded (workflow misconfiguration)
  4. ✅ BYOK inference — responding via api-proxy → api.githubcopilot.com

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

Overall: PARTIAL PASS (BYOK inference confirmed; pre-step data unavailable due to unexpanded template variables)

🔑 BYOK report filed by Smoke Copilot BYOK

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 reduces the package’s exposed API surface by removing unused barrel re-exports from the CLI entrypoint and tightening a test-helper module’s exported types.

Changes:

  • Removed dead re-export “barrel” exports from src/cli.ts.
  • Updated src/cli.test.ts to import Copilot API resolver helpers directly from copilot-api-resolver.
  • Made ExecaMockResult non-exported in src/test-helpers/host-iptables-test-setup.ts.
Show a summary per file
File Description
src/cli.ts Removes unused re-exports so cli.ts is only the runtime CLI entrypoint.
src/cli.test.ts Adjusts imports to no longer rely on cli.ts as a barrel.
src/test-helpers/host-iptables-test-setup.ts Stops exporting an unused interface, but currently introduces a declaration-emit build issue.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment on lines 11 to 16
type MockedExecaFn = (file: string, args?: readonly string[], options?: unknown) => Promise<ExecaMockResult>;

export interface ExecaMockResult {
interface ExecaMockResult {
command: string;
escapedCommand: string;
exitCode: number;
@github-actions
Copy link
Copy Markdown
Contributor

Smoke Codex: FAIL

Merged PRs: ✅ refactor: fix test import path inconsistency for docker-manager; refactor: split token-tracker test file for maintainability
SafeInputs GH: ❌ safeinputs-gh unavailable
Playwright: ✅ GitHub title verified
Tavily: ❌ no Tavily tools registered
File/Bash/Build: ✅ smoke file verified; npm ci && npm run build passed
Overall status: FAIL

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

Chroot Smoke Test Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3 ❌ No
Node.js v24.14.1 v20.20.2 ❌ No
Go go1.22.12 go1.22.12 ✅ Yes

Result: Some versions differ between host and chroot environments. Go matches, but Python and Node.js have version mismatches (host is newer).

Tested by Smoke Chroot

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: GitHub Actions Services Connectivity

Check Result
Redis PING ❌ No response
PostgreSQL pg_isready ❌ No response
PostgreSQL SELECT 1 ❌ Failed

Overall: FAILhost.docker.internal is unreachable from this environment. Service containers may not be configured or running for this workflow.

🔌 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 N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color passed ✅ PASS
Go env passed ✅ PASS
Go uuid passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit 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 #2992 · ● 687K ·

@lpcox lpcox merged commit 2701fc3 into main May 12, 2026
67 of 72 checks passed
@lpcox lpcox deleted the fix/export-audit-dead-reexports branch May 12, 2026 02:51
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] Deprecated DEFAULT_DNS_SERVERS re-export in cli.ts is unused [Export Audit] Dead export ExecaMockResult in test-helpers

2 participants