Skip to content

fix(dry-run): commit no longer creates a real image; the interception set becomes declarative - #14150

Open
ndeloof wants to merge 1 commit into
docker:mainfrom
ndeloof:b7-dryrun-commit
Open

fix(dry-run): commit no longer creates a real image; the interception set becomes declarative#14150
ndeloof wants to merge 1 commit into
docker:mainfrom
ndeloof:b7-dryrun-commit

Conversation

@ndeloof

@ndeloof ndeloof commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Epic #14074, B.7. compose commit --dry-run delegated ContainerCommit to the real client and actually created the image; it now returns a dry-run ID without touching the engine (e2e step added, with a new ImageAbsent check).

Auditing the rest of the surface: 39 more mutating operations were delegated — none that compose itself issues today (verified caller by caller), but any future code path reaching one would mutate the engine under --dry-run silently. They now refuse with an explicit <op> is not allowed in dry-run mode.

The interception set was only implied by a method's position under a comment; it is now declared in dryrunclient_test.go (read-only delegated / faked / refused), with an AST-based test that fails on any method missing, misclassified, or new and unclassified — extending APIClient requires an explicit dry-run decision.

🤖 Generated with Claude Code

… set becomes declarative

compose commit --dry-run delegated ContainerCommit to the real client
and actually created the image. It now returns a dry-run ID without
touching the engine.

Auditing the rest of the client surface: 39 more mutating operations
were delegated — none that compose itself issues (verified caller by
caller), but any future code path reaching one would mutate the engine
under --dry-run silently. They now refuse with an explicit error.

The classification — read-only delegated / faked / refused — was only
implied by a method's position under a comment; it is now declared in
dryrunclient_test.go, which parses the client and fails on any method
missing, misclassified, or new and unclassified: extending APIClient
requires an explicit dry-run decision.

The commit e2e scenario gains a --dry-run step asserting the image is
NOT created (new ImageAbsent check).

Epic docker#14074, B.7.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 81 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/dryrun/dryrunclient.go 0.00% 81 Missing ⚠️

📢 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

The changes are mechanically correct and well-structured. The 39 new refused stubs follow a consistent, uniform pattern. The AST-based classification test (TestDryRunClientClassifiesEveryMethod) provides strong bidirectional coverage — it catches both unclassified new methods and classified names that no longer exist on DryRunClient. ContainerCommit now returns a synthetic dry-run ID instead of delegating to the real engine (defense-in-depth, since pkg/compose/commit.go already short-circuits on s.dryRun). The new ImageAbsent check and the e2e dry-run commit step are logically sound.

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.

2 participants