Skip to content

chore(compose): comments state behavior, not history - #14130

Merged
glours merged 1 commit into
docker:mainfrom
ndeloof:a2-comments-state-behavior
Aug 27, 2026
Merged

chore(compose): comments state behavior, not history#14130
glours merged 1 commit into
docker:mainfrom
ndeloof:a2-comments-state-behavior

Conversation

@ndeloof

@ndeloof ndeloof commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Eleven comments in the reconciler justified decisions by referencing deleted code ("matching the previous ensureNetwork behavior", stale line numbers to code that moved). Each is rewritten as a self-contained behavioral statement — including that starting containers is not the plan's job, and that sortContainers' ordering is the scale-down policy.

Epic #14074, section A — split out of #14075 for focused review.

🤖 Generated with Claude Code

@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

All eleven comment rewrites accurately describe the behavior of the code they annotate. No logic changes, no misleading descriptions, and no omitted critical caveats were found across create.go, observed_state.go, and reconcile.go.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

glours
glours previously approved these changes Aug 27, 2026

@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.

Nit: pkg/compose/reconcile_test.go:1245 still has // Exited containers are left as-is, matching convergence.go:199 behavior same stale-pointer pattern this PR fixes elsewhere, just left out of scope here (probably because it's a test file rather than "the reconciler" itself). Not blocking, just flagging for a follow-up pass.

Eleven comments in the reconciler and its neighbors justified decisions
by pointing at code that no longer exists ('matching the previous
ensureNetwork behavior', 'same way as convergence.go:138-160' — lines
that today hold unrelated code) instead of stating the behavior and its
reason. A reader following those pointers finds nothing, or worse,
something else.

Each is rewritten as a self-contained behavioral statement. Two carry
real weight:
- reconcileService's up-to-date branch now says explicitly that
  starting containers is NOT the plan's job (a separate start phase in
  start.go does it) — the previous wording invited 'fixing' the
  StateCreated case;
- sortContainers now documents that its ordering IS the scale-down
  policy (the tail it produces is what i >= expected trims), instead of
  referencing stale line numbers.

Part of docker#14074 (A: the code misdescribes its own structure).

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof
ndeloof force-pushed the a2-comments-state-behavior branch from 329cb6a to 080cc85 Compare August 27, 2026 09:55
@glours
glours enabled auto-merge (rebase) August 27, 2026 09:58
@glours
glours merged commit 720da68 into docker:main Aug 27, 2026
90 of 91 checks passed
@ndeloof
ndeloof deleted the a2-comments-state-behavior branch August 27, 2026 12:19
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