Skip to content

feat(compose): add compose fix command#2125

Closed
simple-agent-manager[bot] wants to merge 2 commits into
mainfrom
feat/compose-fix
Closed

feat(compose): add compose fix command#2125
simple-agent-manager[bot] wants to merge 2 commits into
mainfrom
feat/compose-fix

Conversation

@simple-agent-manager
Copy link
Copy Markdown
Contributor

Summary

  • add pure compose.FixProject for deterministic mechanical Compose fixes
  • add defang compose fix with dry-run reporting and YAML output
  • add fixture and table-driven tests for fixer behavior and validation

@raphaeltm please review.

Test plan

  • go test -short ./pkg/cli/compose/...
  • go test -short ./cmd/cli/command
  • make test

raphaeltm and others added 2 commits May 22, 2026 10:38
Remove fixes that guess at values users should set themselves:
- Memory reservation defaults (512M/256M)
- Healthcheck generation (curl-based)
- Managed service extension injection (x-defang-postgres etc.)
- Hostname-to-domainname conversion

Keep only safe, deterministic fixes:
- Port mode assignment (ingress/host based on protocol/image)
- Limits-to-reservations copy
- Restart policy normalization
- Unsupported directive removal (dns, devices, etc.)

Also makes compose fix fully offline (no session/auth needed),
handles zero-fix case gracefully, and rewrites tests to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@simple-agent-manager
Copy link
Copy Markdown
Contributor Author

Collapsed into PR #2124 as defang compose lint --fix instead of a separate compose fix command.

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