Skip to content

feat(workspace): add down alias for workspace delete - #1215

Merged
skevetter merged 1 commit into
mainfrom
feat/1211-workspace-down-alias
Sep 12, 2026
Merged

skevetter merged 1 commit into
mainfrom
feat/1211-workspace-down-alias

Conversation

@skevetter

@skevetter skevetter commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements devsy workspace down as an alias of the canonical devsy workspace delete command following the design in #1211.

Motivation

Users familiar with Docker Compose often expect devsy workspace down as the inverse of devsy workspace up. Devsy's compose-backed teardown already executes Docker Compose down, while workspace stop owns reversible suspension semantics. Adding down as an exact Cobra alias of workspace delete aligns ergonomics with user mental models without introducing unnecessary lifecycle or state divergence.

Changes

  1. CLI Alias & Command Description (cmd/workspace/delete.go):

    • Added "down" to deleteCmd.Aliases ([]string{"rm", "down"}).
    • Updated deleteCmd.Long to clarify that down and rm perform the same full Devsy workspace teardown, noting Docker/Podman Compose down behavior for Compose-backed workspaces.
  2. CLI Contract Tests (cmd/workspace/delete_test.go):

    • TestDeleteCmd_Aliases: Asserts rm and down are registered aliases.
    • TestDeleteCmd_Resolution: Asserts delete, rm, down, and down <workspace> resolve to the canonical delete command.
    • TestDeleteCmd_HelpExposesDownAlias: Asserts command help output exposes down and rm under Aliases:.
    • TestDeleteCmd_Completion: Asserts generated shell completion suggestions include down.
  3. Documentation (sites/docs-devsy-sh/content/docs/developing-in-workspaces/stop-and-delete-a-workspace.mdx):

    • Added documentation for devsy workspace down under Stop or Delete a Workspace, clarifying its relationship with delete and stop.

Verification

  • Local unit tests pass: go test -v -run '^TestDeleteCmd' ./cmd/workspace
  • Formatting verified: golangci-lint fmt and gofmt
  • Linting verified: golangci-lint run --fast-only
  • Pre-review verified: coderabbit review reported no findings (0 issues across all 3 files)

Closes #1211

Summary by CodeRabbit

  • New Features
    • Added devsy workspace rm and devsy workspace down as aliases for fully deleting a workspace.
    • Added command help and shell completion support for both aliases.
  • Documentation
    • Documented the devsy workspace down command, including its teardown behavior and Compose volume handling.
    • Clarified that devsy workspace stop preserves workspace configuration and state for later restart.

@netlify

netlify Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 36d3ae1
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6aa3832b84a9140008e4f6eb

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a68908df-6165-4fa3-a961-e0280d3c76f8

📥 Commits

Reviewing files that changed from the base of the PR and between 0296937 and 36d3ae1.

📒 Files selected for processing (3)
  • cmd/workspace/delete.go
  • cmd/workspace/delete_test.go
  • sites/docs-devsy-sh/content/docs/developing-in-workspaces/stop-and-delete-a-workspace.mdx

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The workspace delete command now supports rm and down aliases. Help text, command resolution, shell completion, tests, and workspace lifecycle documentation cover the aliases and their teardown behavior.

Changes

Workspace delete alias

Layer / File(s) Summary
Alias and help wiring
cmd/workspace/delete.go
The delete command defines rm and down constants, exposes both aliases, and documents full workspace teardown.
Alias validation and documentation
cmd/workspace/delete_test.go, sites/docs-devsy-sh/content/docs/developing-in-workspaces/stop-and-delete-a-workspace.mdx
Tests cover alias resolution, help output, and bash completion. Documentation describes down and when to use stop.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 36d3a

The new workspace down alias is consistent with the existing delete behavior and is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (1 skipped: 1… 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 clearly and concisely states the main change: adding the down alias for workspace delete.
Linked Issues check ✅ Passed Issue #1211 requires down to alias workspace delete, appear in help, support shell completion, and preserve delete and rm. cmd/workspace/delete.go registers aliasDown with aliasRm on the…
Out of Scope Changes check ✅ Passed The changes stay within Issue #1211. The command change implements the alias and related help text. The tests verify the required CLI contract. The documentation explains the new alias and its relatio…
Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/1211-workspace-down-alias

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.

@netlify

netlify Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 36d3ae1
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6aa3832b5f89a800086e7a96

Add 'down' as an alias for 'devsy workspace delete' to match common Docker Compose mental models without changing existing teardown semantics.

- Register 'down' in DeleteCmd.Aliases
- Extract aliasDown and aliasRm constants to satisfy goconst
- Update Long description noting full Devsy teardown and Compose down mapping
- Add CLI contract tests for alias registration, command resolution, help text, and shell completion
- Update documentation in stop-and-delete-a-workspace.mdx

Closes #1211
@skevetter
skevetter force-pushed the feat/1211-workspace-down-alias branch from 02b718c to 36d3ae1 Compare September 11, 2026 04:27
@skevetter skevetter changed the title feat(workspace): add down alias for workspace delete (#1211) feat(workspace): add down alias for workspace delete Sep 11, 2026
@skevetter
skevetter marked this pull request as ready for review September 12, 2026 16:21
@mergify

mergify Bot commented Sep 12, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@skevetter
skevetter merged commit 77a1e7e into main Sep 12, 2026
85 checks passed
@skevetter
skevetter deleted the feat/1211-workspace-down-alias branch September 12, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add a down alias to workspace delete to align with docker compose down

1 participant