Repository navigation
Conversation
Pure extraction, no behavior change: create() resolved the project model, ensured images/models and external networks/volumes, observed the daemon, and reconciled a Plan, all inline before calling executePlan. That decision-making half is now its own function, preparePlan, returning the canonical project, the daemon snapshot, and the Plan — nothing is created, started, or otherwise touched by it. This is Lot 1's last item (epic docker#14081): interactive up's eventual create/start phase boundary needs to prepare the plan once, run the Create phase, set up attach/printer/monitor, then run the Start phase — which needs the plan and snapshot available between those steps, not buried inside create()'s single call chain. create() itself is unchanged in behavior, just now a two-line call into preparePlan followed by the existing emitRunningEvents + executePlan. Verified with the existing unit suite plus the create/up/down e2e scenarios (TestLocalComposeUp, TestCreateIdempotentDefaultPlatform, TestCreateIdempotentSharedImageMixedPlatforms, TestCreateRefusesJob, TestCreateLocalMultiPlatformImage, TestUpWithAllResources) against a locally built binary. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
7 of 17 tasks
docker-agent
reviewed
Oct 6, 2026
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The extraction preserves the existing operation order and error handling without introducing behavioral changes.
Review effort: Balanced
Findings: None
What changed in this PR
Extracts create planning into preparePlan, enabling future lifecycle phase separation without changing current behavior.
Changes:
- Adds
preparePlanto resolve resources, observe daemon state, and reconcile a plan. - Refactors
createto prepare, emit running events, then execute.
| File | Description |
|---|---|
pkg/compose/create.go |
Separates plan preparation from execution. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
docker-agent
reviewed
Oct 6, 2026
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
docker-agent
reviewed
Oct 6, 2026
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
This was referenced Oct 6, 2026
This branch has not been deployed
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.
What this PR does, in one sentence
create()'s planning half — resolving the project, ensuring images/models and external resources, observing the daemon, and reconciling aPlan— becomes its own function,preparePlan, so a future caller can get the plan and snapshot without also running it.Context
create()(pkg/compose/create.go) currently does two very different things in one unbroken call chain: it figures out what needs to happen (resolve the project model, ensure images/models exist, check external networks/volumes, observe the daemon, reconcile all of it into aPlan), then immediately does it (executePlan). That's fine as long as every caller wants both halves back to back — which is true today, but won't stay true onceupconverges onto the plan engine (epic #14081): interactiveupneeds to prepare the plan once, run its Create phase, set up the attach/printer/monitor session, and only then run the Start phase under a different context — it needs the plan and the daemon snapshot in hand between those two steps, not buried inside a single function that also executes everything.What the PR brings
preparePlan(ctx, project, options)now returns exactly what a caller needs to decide how to run a plan: the canonical project (after optional-dependency pruning anduse_api_socketresolution), the observed daemon state, and the reconciledPlanitself — without creating, starting, or otherwise touching a single container, network, or volume.create()is now justpreparePlan+ the existingemitRunningEvents+ the existingexecutePlan, in the same order as before.This is a pure extraction: every step, every error short-circuit, and every side effect (the orphan-containers warning, the unmanaged-network/volume warnings) keeps its exact original position and order. No caller-visible behavior changes — verified against the existing unit suite and the create/up/down e2e scenarios (
TestLocalComposeUp,TestCreateIdempotentDefaultPlatform,TestCreateIdempotentSharedImageMixedPlatforms,TestCreateRefusesJob,TestCreateLocalMultiPlatformImage,TestUpWithAllResources).This closes the last item of epic #14081's Lot 1 — inert code, no consumer yet: nothing calls
preparePlandirectly outsidecreate()until Lot 2 wires the interactive-up phase split in.Part of #14081.
🤖 Generated with Claude Code