Refactor Docker Compose teardown into a shared helper#3564
Conversation
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (3 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
This PR consolidates Docker Compose teardown logic into a shared helper so that both the normal shutdown path and the startup-retry cleanup path use the same docker compose down -v -t 1 invocation and execa options, reducing drift while preserving best-effort retry cleanup behavior.
Changes:
- Added
runComposeDown(workDir, opts?)to centralize Compose teardown arguments and standard execa options. - Updated
stopContainers()to call the shared helper (default rejecting behavior preserved). - Updated the startup retry cleanup path to call the helper with
{ reject: false }and adjusted unit tests accordingly.
Show a summary per file
| File | Description |
|---|---|
src/container-cleanup.ts |
Introduces runComposeDown() and refactors stopContainers() to use it. |
src/container-lifecycle.ts |
Uses runComposeDown(workDir, { reject: false }) for best-effort teardown before retrying startup. |
src/docker-manager-lifecycle.test.ts |
Adds an assertion verifying retry cleanup calls Compose down with reject: false and the expected options. |
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: 0
|
✅ Smoke Test: Claude Engine Validation
Result: PASS
|
🔬 Smoke Test Results
PR: "Refactor Docker Compose teardown into a shared helper" — author: Overall: PARTIAL — MCP ✅, pre-step data unavailable (template vars unexpanded in workflow)
|
|
docs(spec): add port information to /reflect endpoint sections 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: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test Results — FAIL
|
Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Overall: PARTIAL PASS (inference ✅, pre-step data unavailable) Author:
|
Chroot Smoke Test Results
Overall: ❌ FAILED — Python and Node.js versions differ between host and chroot.
|
Smoke Test: Gemini Engine Validation
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.
|
The container stop path and the startup-retry cleanup path each inlined the same
docker compose down -v -t 1invocation, leaving teardown behavior split across two files. This change consolidates that logic so future compose-down changes stay consistent while preserving the retry path’s best-effort semantics.What changed
runComposeDown(workDir, opts?)helper insrc/container-cleanup.tsdocker compose down -v -t 1arguments and standard execa options into that helperstopContainers()on the default rejecting behaviorsrc/container-lifecycle.tsto call the same helper withreject: falseBehavior preserved
Call sites after refactor
Why this matters