Skip to content

refactor(compose): move the plan types to internal/planning - #14408

Merged
glours merged 1 commit into
docker:mainfrom
ndeloof:internal-plan
Nov 16, 2026
Merged

glours merged 1 commit into
docker:mainfrom
ndeloof:internal-plan

Conversation

@ndeloof

@ndeloof ndeloof commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

What this PR does, in one sentence

Moves the reconciliation plan types (Plan, PlanNode, Operation, OperationType and the Op* constants) out of pkg/compose into a self-contained internal/planning package.

Context

Plan and Operation are the vocabulary the reconciler writes and the executor reads, but they are declared in pkg/compose and exported from it, so they are part of the /v5 public API even though nothing outside the package uses them. They are also among the most isolated pieces of the package: plan.go needs nothing from the rest of pkg/compose. This is part of the effort tracked in #14396 to split pkg/compose and to shrink its exported surface.

What the PR brings

  • plan.go and its test move unchanged to internal/planning (only the package clause differs); the reconciler, the executor and up/create now refer to the qualified names. The rest of the diff is the mechanical qualification of identifiers, with no behavior change and no change to any test assertion.
  • The only API adjustment is Plan.addNode, which reconcile.go and the tests call across the new package boundary: it becomes the exported Plan.AddNode, the minimum needed.
  • No Backend interface and no forwarder: the package has no dependency on pkg/compose (or on anything else of the project).
  • Symbols no longer exported by pkg/compose: Plan (with String and IsEmpty), PlanNode, PlanPhase, PhaseCreate, PhaseStart, Operation, OperationType (with String) and the sixteen Op* constants (OpCreateNetwork, OpRemoveNetwork, OpDisconnectNetwork, OpConnectNetwork, OpCreateVolume, OpRemoveVolume, OpCreateContainer, OpStartContainer, OpStopContainer, OpRemoveContainer, OpRenameContainer, OpRunProvider, OpWaitCondition, OpRunPreStart, OpRunPostStart, OpCreateHookContainer). Nothing in this repository outside pkg/compose references them.
  • The package is named planning rather than plan because plan is the usual name of local variables across the reconciler and its tests, which would have shadowed the package and forced a much noisier diff.

Why this is the right next brick

It is the leaf of the plan engine cluster: moving it first means reconcile, observed_state and executor can follow later without dragging the plan types along. It is independent of the other extractions of the series, and keeps the changes to reconcile.go to the qualification of identifiers so it stays easy to rebase for the open PRs touching that file.

Part of #14396

🤖 Generated with Claude Code

@ndeloof
ndeloof requested review from a team as code owners October 28, 2026 07:09

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

@ndeloof
ndeloof force-pushed the internal-plan branch 2 times, most recently from c7283ea to f9a98c1 Compare November 4, 2026 17:17
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>

@glours glours left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@glours
glours enabled auto-merge (rebase) November 16, 2026 13:54
@glours
glours merged commit 0fd23ff into docker:main Nov 16, 2026
115 of 117 checks passed
@ndeloof
ndeloof deleted the internal-plan branch November 16, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants