Skip to content

[Export Audit] Test files still import from docker-manager barrel instead of source modules #3922

@github-actions

Description

@github-actions

API Surface Issue

Category

Test importing from wrong location

Summary

  • Files: src/docker-manager-utils.test.ts, src/docker-manager-cleanup.test.ts, src/docker-manager-lifecycle.test.ts
  • Issue: Three test files import from the docker-manager barrel, violating the explicit comment at the top of that file which states: "Only production-consumed symbols are re-exported here. Test files should import directly from the source modules."

This issue re-introduces the pattern fixed in #2958 and #3166 (both closed as completed), indicating the fix was incomplete or subsequently reverted.

Evidence

src/docker-manager-utils.test.ts:21:  import { parseDifcProxyHost } from './docker-manager';
  → should import from './host-env'

src/docker-manager-cleanup.test.ts:1:  import { writeConfigs, cleanup, collectDiagnosticLogs, preserveIptablesAudit } from './docker-manager';
  → should import from './config-writer' (writeConfigs) and './container-cleanup' (cleanup, collectDiagnosticLogs, preserveIptablesAudit)

src/docker-manager-lifecycle.test.ts:1:  import { startContainers, runAgentCommand, fastKillAgentContainer, setAwfDockerHost, stopContainers, getLocalDockerEnv } from './docker-manager';
  → should import from './container-lifecycle' (startContainers, runAgentCommand, fastKillAgentContainer, stopContainers) and './docker-host' (setAwfDockerHost, getLocalDockerEnv)

Barrel comment in src/docker-manager.ts line 1–3:

// Re-export public API for backwards compatibility.
// Only production-consumed symbols are re-exported here. Test files should
// import directly from the source modules (host-env, compose-generator, etc.).

Recommended Fix

Update each test file to import directly from its respective source module:

  1. docker-manager-utils.test.ts: change from './docker-manager'from './host-env' for parseDifcProxyHost
  2. docker-manager-cleanup.test.ts: change to import writeConfigs from './config-writer' and the rest from './container-cleanup'
  3. docker-manager-lifecycle.test.ts: change to import lifecycle functions from './container-lifecycle' and setAwfDockerHost/getLocalDockerEnv from './docker-host'

Impact

  • Dead code risk: Low
  • Maintenance burden: Medium — tests that import via the barrel bypass the explicit layering contract, making future refactors of docker-manager.ts harder and obscuring which modules each test actually exercises

Detected by Export Audit workflow. Triggered by push to main on 2026-05-27. Prior related issues: #2958, #3166.

Generated by API Surface & Export Audit · sonnet46 1.5M ·

  • expires on Jun 26, 2026, 4:28 AM UTC

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions