Skip to content

Comments

Fix CD refresh/list/down#1804

Merged
lionello merged 3 commits intomainfrom
lio/fix-refresh
Jan 19, 2026
Merged

Fix CD refresh/list/down#1804
lionello merged 3 commits intomainfrom
lio/fix-refresh

Conversation

@lionello
Copy link
Member

@lionello lionello commented Jan 18, 2026

Description

This PR fixes an issue with defang cd ls --remote failing (because of missing project-name) and fixes a regression in #1764 to ensure deployment table only gets updated after successful deletion of subdomain.

Checklist

  • I have performed a self-review of my code
  • I have added appropriate tests
  • I have updated the Defang CLI docs and/or README to reflect my changes, if necessary

Summary by CodeRabbit

Release Notes

  • New Features

    • Added command aliases "dn" and "destroy" for the compose down command.
  • Bug Fixes

    • Improved deployment state handling when executing down/destroy operations to ensure proper cleanup.
  • Chores

    • Removed deprecated compose subcommands (restart, start, stop).
    • Updated flag documentation for improved clarity.
    • Refined internal logging for better diagnostics.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 18, 2026

📝 Walkthrough

Walkthrough

This PR removes deprecated CLI commands (start, restart, stop), adds command aliases to the "down" command, and refactors the CD flow to conditionally delete subdomains and record deployment history with a new refresh action type.

Changes

Cohort / File(s) Summary
CLI Command Deprecation
src/cmd/cli/command/commands.go, src/cmd/cli/command/compose.go
Removed deprecated compose subcommands (start, restart, stop). Added "dn" and "destroy" aliases to down command. Updated --force flag description for up command.
Deployment CD Flow Refactoring
src/pkg/cli/cd.go, src/pkg/cli/common.go
Refactored down/destroy flow to conditionally delete subdomains before recording deployment state. Renamed afterDown to deleteSubdomain. Wrapped stack upload in action-based conditional (only executes on DEPLOYMENT_ACTION_UP). Adjusted deployment history error handling to warn but continue.
Action & Provider Types
src/pkg/cli/client/provider.go, src/protos/io/defang/v1/fabric.proto
Added new CdCommandPreview constant and DEPLOYMENT_ACTION_REFRESH enum value. Updated CdCommandUp comment to indicate Compose payload requirement.
Logging Infrastructure
src/pkg/clouds/aws/ecs/cfn/setup.go
Replaced fmt.Println/fmt.Printf calls with term-based logging (term.Info, term.Warnf) for CloudFormation status messages. Added term package import.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • jordanstephens
  • raphaeltm

Poem

🐰 The old commands fade like morning mist,
Down's aliases dance with a twist,
Subdomains vanish with gentle care,
Refresh flows fresh through the morning air! 🌅

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix CD refresh/list/down' directly addresses the main objectives: fixing CD refresh/list operations and restoring deployment table updates on down operations. It clearly summarizes the primary fixes in the changeset.

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

✨ Finishing touches
  • 📝 Generate docstrings

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

level=warning msg="[linters_context] running gomodguard failed: unable to read module file go.mod: current working directory must have a go.mod file: if you are not using go modules it is suggested to disable this linter"
level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


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

@lionello lionello changed the title Fix CD refresh/list Fix CD refresh/list/down Jan 18, 2026
@lionello lionello merged commit 56369ee into main Jan 19, 2026
14 checks passed
@lionello lionello deleted the lio/fix-refresh branch January 19, 2026 17:42
@coderabbitai coderabbitai bot mentioned this pull request Jan 23, 2026
4 tasks
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