feat: start preflight guards and external-node event-port warnings - #25
Merged
Conversation
… + external-node event-port warnings
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds start-time preflight checks to prevent Docker Compose project name collisions and port conflicts, plus clearer warnings/docs for external-node event receiver ports.
Changes:
- Introduces
published_ports()to enumerate host ports a deployment will publish (respectingport_offset). - Adds
startpreflight guards for compose project collisions and for already-taken host ports, with unit tests. - Expands configuration warnings and documents the new safety checks in the README.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/utils/services.rs | Adds published_ports() helper used by docker start preflight checks. |
| src/utils/docker.rs | Adds project-collision detection and host-port test-binds before docker compose up, plus tests. |
| src/config/mod.rs | Improves warnings for external node + managed receivers by clarifying unpublished event ports. |
| README.md | Documents the new stacksup start collision/port preflight behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The follow-ups from #24:
stacksup startnow fails fast — before compose creates anything — when it would collide with another deployment, plus a config warning for a push-edge gap.Port preflight
starttest-binds every host port the deployment is about to publish. A taken port aborts with the owning service and the fix:Services already running are skipped (their ports are legitimately ours, so
start/restarton a live stack stays idempotent), and single-service starts only check that service.Project-name collision detection
Before starting, the deployment name is checked against
docker compose ls --all. A project with the same name rendered from a different directory aborts the start — compose would otherwise silently adopt (and replace) that stack's containers, which was the worst failure mode of the pre-#24 world:Best-effort by design: if
docker compose lsfails, start proceeds. The JSON matching is a pure function with unit tests (same file → us; different file → conflict; absent name / garbage JSON → no conflict).Event-port warnings
When the node is
externaland the API or signer is managed, the apply-to-your-node warnings now also say that the API's event port (3700) / signer's endpoint (port 30000) is not published on this host, so an off-host node cannot push to it — run the node on this machine or expose the port via a compose override. Publishing these ports by default was deliberately avoided; it would poke holes in the #23 network isolation for every deployment to serve a niche topology.Verified live
All three behaviors exercised against the built binary: a socket squatting 5432 → start refused pre-compose; two directories sharing the default name → second start refused naming the first's path; external node + managed API render → warning names port 3700.
🤖 Generated with Claude Code