refactor: remove dead exports from preflight, network-setup, domain-acl, and logs barrel#3051
Conversation
…cl, and logs barrel - Unexport AllowedDomainsResult interface in preflight.ts (never imported) - Unexport NetworkSetupResult interface in network-setup.ts (never imported) - Unexport DomainsByProtocol, PatternsByProtocol interfaces in domain-acl.ts (only used internally) - Unexport groupDomainsByProtocol, groupPatternsByProtocol functions in domain-acl.ts (only called within the same file) - Trim logs/index.ts barrel to the 3 symbols actually consumed via the barrel (listLogSources, LogFormatter, streamLogs); remove 9 dead re-exports (parseLogLine, extractDomain, discoverLogSources, selectMostRecent, isContainerRunning, validateSource, aggregateLogs, loadAllLogs, loadAndAggregate, AggregatedStats, DomainStats, formatStats) Closes #3044 Closes #3041 Closes #3047 Closes #3048 Closes #3050 Closes #3025 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
Smoke Test Results✅ Playwright Test: GitHub page title verified Overall: PARTIAL PASS (3/4 tests passed)
|
There was a problem hiding this comment.
Pull request overview
This PR reduces the project’s public TypeScript surface area by removing unused/dead exports and trimming an internal barrel module, based on export-audit findings. The intent is to keep only externally-consumed exports while leaving runtime behavior unchanged.
Changes:
- Unexported unused result interfaces in the commands layer (
AllowedDomainsResult,NetworkSetupResult). - Unexported internal-only helper types/functions in
src/squid/domain-acl.ts(protocol grouping helpers). - Trimmed
src/logs/index.tsbarrel exports down to the symbols actually imported via the barrel.
Show a summary per file
| File | Description |
|---|---|
| src/commands/preflight.ts | Removes export from an internal-only return-type interface. |
| src/commands/network-setup.ts | Removes export from an internal-only return-type interface. |
| src/squid/domain-acl.ts | Makes protocol-grouping types/helpers module-private while keeping the intended public functions exported. |
| src/logs/index.ts | Trims the logs barrel to only the symbols consumed via ../logs. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 0
🔬 Smoke Test Results
Overall: ❌ FAIL — workflow template variables ( Author: @lpcox
|
🔥 Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Overall: PASS 🟢 /cc @lpcox
|
Smoke Test: FAILPRs: feat: gate token steering behind opt-in flag, adjust thresholds to 80/90/95/99%; Refactor squid config generation into focused modules 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.
|
🏗️ Build Test Suite Results
Overall: 7/8 ecosystems passed — ❌ FAIL ❌ Failure DetailsJava (gson, caffeine) — Network unreachable (Maven central Maven requires network access to download plugins/dependencies. This environment does not have outbound HTTPS connectivity to Maven Central, causing both Java projects to fail at compile time.
|
Smoke Test Results — FAIL
Overall: FAIL
|
🧪 Chroot Version Comparison
Result: FAILED — Python and Node.js versions differ between host and chroot environments.
|
Summary
Remove dead exports identified by export audit issues. No behavioral changes — all modifications are
exportkeyword removals or barrel trimming.Changes
src/commands/preflight.ts— UnexportAllowedDomainsResultinterface (never imported outside the file; the functionresolveAllowedDomainsremains exported since it is used bymain-action.tsand tests).src/commands/network-setup.ts— UnexportNetworkSetupResultinterface (never imported outside the file;resolveNetworkConfigremains exported).src/squid/domain-acl.ts— Unexport 4 symbols only used internally:DomainsByProtocolinterfacePatternsByProtocolinterfacegroupDomainsByProtocol()functiongroupPatternsByProtocol()functionassertSafeForSquidConfig,formatDomainForSquid, andparseDomainConfigremain exported (used by other modules).src/logs/index.ts— Trim barrel from 12 re-exports to the 3 actually consumed via the barrel (listLogSources,LogFormatter,streamLogs). All other consumers already import directly from source modules.Verification
npx tsc --noEmit— passesCloses #3044, #3041, #3047, #3048, #3050, #3025