Skip to content

chore(deps): migrate to docker compose v5#41

Merged
pilat merged 1 commit into
mainfrom
chore/compose-v5-migration
Jun 23, 2026
Merged

chore(deps): migrate to docker compose v5#41
pilat merged 1 commit into
mainfrom
chore/compose-v5-migration

Conversation

@pilat

@pilat pilat commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Why

docker/compose/v2 is a dead module path frozen at 2.40.3 — the rest of the docker stack (cli, moby, compose-go) moved on, so dependency updates kept colliding and wouldn't build. This moves us onto the actively maintained line.

What

  • Update docker/compose/v2docker/compose/v5 (5.1.4), realigning docker/cli, compose-go and the new moby/moby client/api modules.
  • Restore build/up/down progress output — compose v5 routes progress through an event-bus subscriber that now has to be wired explicitly, otherwise those commands render nothing. Source sync uses the same progress board for a consistent look.

Notes

  • All progress goes to stdout, errors to stderr — one consistent stream.
  • build, vet, lint, unit (-race) and the full e2e suite all pass.

Summary by CodeRabbit

  • New Features

    • Real-time progress indicators during container build, start, and stop operations
    • Parallel source synchronization with optimized concurrency for faster background updates
  • Chores

    • Upgraded to Docker Compose v5
    • Updated Docker and Moby client library dependencies
    • Removed obsolete compatibility patches

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@pilat, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 39 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f61f7009-ca69-4833-b82e-7d3213482aed

📥 Commits

Reviewing files that changed from the base of the PR and between fdb5a48 and 63d8fa7.

⛔ Files ignored due to path filters (2)
  • go.sum is excluded by !**/*.sum
  • tests/e2e/e2e_test.go is excluded by !**/*_test.go
📒 Files selected for processing (13)
  • .goreleaser.yml
  • cmd/devbox/devbox.go
  • cmd/devbox/down.go
  • cmd/devbox/logs.go
  • cmd/devbox/restart.go
  • cmd/devbox/run.go
  • cmd/devbox/shell.go
  • cmd/devbox/up.go
  • cmd/devbox/update.go
  • go.mod
  • internal/project/export.go
  • internal/project/project.go
  • scripts/patch.sh

Walkthrough

Migrates Docker Compose from v2 to v5 and Docker Engine client to Moby across the codebase. Adds newProgressBus and newProgressCompose helpers for TTY-aware progress display, wires them into up, down, and build commands. Refactors source sync in update.go to use bounded parallel execution with fail-fast cancellation. Removes patch.sh and its goreleaser hook.

Changes

Docker Compose v5 + Moby Client Migration

Layer / File(s) Summary
Dependency upgrade and build hook cleanup
go.mod, .goreleaser.yml
go.mod switches Docker Compose to v5, updates Moby API/client versions, removes docker→moby replace directives, and refreshes the full indirect dependency tree. The goreleaser hook replaces patch.sh with completions.sh, and patch.sh is deleted.
Project-level Compose v5 type aliases and labels
internal/project/export.go, internal/project/project.go
Both files update their api import from v2 to v5, updating the underlying source of all exported type aliases (UpOptions, BuildOptions, etc.) and label variables (ServiceLabel, ProjectLabel, WorkingDirLabel).
Docker CLI initialization and progress display helpers
cmd/devbox/devbox.go
Promotes dockerCLI to a package-level variable, wires initDocker to assign it and construct apiService via compose.NewComposeService with explicit error handling, and introduces newProgressBus (TTY vs plain renderer) and newProgressCompose (Compose service with event processor) helpers.
Shell command Moby API migration
cmd/devbox/shell.go
Imports switch to moby/moby/client and stdcopy. findContainerID uses ContainerList with client.ContainerListOptions and accesses list.Items[0].ID. containerExec switches to ExecCreate/ExecAttach with client.*Options. filterLabels returns client.Filters built via chained Add calls instead of filters.Args.
Commands wired to progress-aware Compose service
cmd/devbox/up.go, cmd/devbox/down.go, cmd/devbox/restart.go, cmd/devbox/run.go, cmd/devbox/logs.go
runBuild and runUp replace direct apiService calls with newProgressCompose()-created services. runDown does the same. restart.go, run.go, and logs.go update their compose/formatter imports from v2 to v5.
Update command progress bus and syncSources refactor
cmd/devbox/update.go
Replaces progress.RunWithTitle rendering with a newProgressBus lifecycle that emits per-source Syncing/Synced/Failed api.Resource events. The new syncSources helper runs git.Sync in bounded parallel (max 4) with fail-fast context cancellation, aggregating the first error.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(deps): migrate to docker compose v5' accurately and concisely summarizes the primary change across all modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/compose-v5-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pilat pilat self-assigned this Jun 23, 2026
@pilat
pilat force-pushed the chore/compose-v5-migration branch from fdb5a48 to edd995b Compare June 23, 2026 00:17

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/devbox/devbox.go`:
- Around line 83-90: In the newProgressBus() function, fix the display.Full()
call to properly route error and output streams separately. The function
signature expects display.Full(err io.Writer, out io.Writer, detached bool), but
currently both parameters receive the same output stream. Change the first
argument from out to dockerCLI.Err() so that error messages are routed to stderr
while keeping standard output on stdout.

In `@cmd/devbox/shell.go`:
- Line 107: In the return statement that uses fmt.Errorf with the message
"failed to list containers", change the error format verb from `%v` to `%w` to
properly wrap and preserve the error chain. This will maintain consistency with
the similar error handling in the containerExec method (which already uses `%w`
on lines 124 and 129) and ensure that errors.Is and errors.As work correctly for
error chain inspection and type assertion.

In `@cmd/devbox/update.go`:
- Around line 145-170: The issue is that when a sync operation fails and calls
cancelSync(), other goroutines waiting at the start of the loop will send
ctx.Err() to errCh, which can be received and stored as firstErr instead of the
actual git.Sync error. To fix this, remove the context cancellation check and
error sending at line 145 that sends ctx.Err() to the channel, and instead rely
only on the actual sync operation error being sent at line 164 via errCh <- err.
This ensures that only real sync failures are captured and returned, not the
secondary context cancellation errors from fail-fast aborts.

In `@go.mod`:
- Around line 18-136: Update the versions of two vulnerable dependencies in the
go.mod file to address HIGH-severity security vulnerabilities. Change
github.com/containerd/containerd/v2 from v2.2.3 to v2.2.5 or later to fix five
CVEs related to CDI annotation smuggling, image tag poisoning, DoS attacks,
symlink following, and command execution. Change github.com/docker/docker from
v28.5.2 to v29.5.1 or later to fix five CVEs related to arbitrary code
execution, AuthZ bypass, race conditions in docker cp, and privilege validation.
Use go get to update these dependencies or manually edit the version constraints
in the require block.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8b558e7b-1296-4223-b4d3-31fd111c741d

📥 Commits

Reviewing files that changed from the base of the PR and between baaae8f and fdb5a48.

⛔ Files ignored due to path filters (2)
  • go.sum is excluded by !**/*.sum
  • tests/e2e/e2e_test.go is excluded by !**/*_test.go
📒 Files selected for processing (13)
  • .goreleaser.yml
  • cmd/devbox/devbox.go
  • cmd/devbox/down.go
  • cmd/devbox/logs.go
  • cmd/devbox/restart.go
  • cmd/devbox/run.go
  • cmd/devbox/shell.go
  • cmd/devbox/up.go
  • cmd/devbox/update.go
  • go.mod
  • internal/project/export.go
  • internal/project/project.go
  • scripts/patch.sh
💤 Files with no reviewable changes (2)
  • scripts/patch.sh
  • .goreleaser.yml

Comment thread cmd/devbox/devbox.go
Comment thread cmd/devbox/shell.go Outdated
Comment thread cmd/devbox/update.go
Comment thread go.mod
@pilat
pilat force-pushed the chore/compose-v5-migration branch from edd995b to 63d8fa7 Compare June 23, 2026 00:25
@pilat
pilat merged commit a2cad8e into main Jun 23, 2026
3 checks passed
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.

1 participant