You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the user-facing CLI interface for the destroy command. This epic builds on top of the application layer implementation from Epic #9 to provide a complete, production-ready CLI experience.
This is Phase 2 of the inside-outside approach: after the core application logic is implemented and tested, we add the user-friendly CLI interface.
🎯 Goals
Fix E2E infrastructure preservation for manual testing workflow
Rename existing app commands to command handlers for clarity
Add Clap subcommand configuration for destroy
Implement user-friendly progress messages and feedback
Provide comprehensive user documentation
Note: Force flags (--force, --yes) and skip confirmation features are out of scope for MVP. These are easy to implement later and not essential for the initial destroy command functionality.
Follow project principles established in docs/research/UX/user-output-vs-logging-separation.md:
User Output: Directed to stdout via UserOutput type, clear and concise
Logging: Directed to files/stderr via tracing, detailed for debugging
Complete separation between user-facing messages and internal logging
UserOutput Implementation
// Verbosity levels (enum only for MVP, no CLI flags yet)#[derive(Debug,Clone,Copy,PartialEq,Eq,PartialOrd,Ord)]pubenumVerbosityLevel{Quiet,// Minimal outputNormal,// Default: Essential progress (MVP focus)Verbose,// Detailed progressVeryVerbose,// Including decisions & retriesDebug,// Maximum detail for troubleshooting}// UserOutput type for destroy commandpubstructUserOutput{verbosity:VerbosityLevel,}implUserOutput{pubfnprogress(&self,message:&str){/* ... */}pubfnsuccess(&self,message:&str){/* ... */}pubfnwarn(&self,message:&str){/* ... */}}
Example Destroy Output
Normal Verbosity (MVP implementation):
⏳ Destroying environment 'my-env'...
⏳ Tearing down infrastructure...
⏳ Cleaning up resources...
✅ Environment 'my-env' destroyed successfully
Parallel Internal Logging (always present):
2025-10-21T10:15:00.123Z INFO destroy_command: Starting environment destruction
environment="my-env" command_type="destroy"
2025-10-21T10:15:01.456Z INFO opentofu_client: Executing destroy operation
workspace="/path/to/env" operation="destroy"
2025-10-21T10:15:15.789Z INFO destroy_command: Environment destruction completed
environment="my-env" duration=15.666s
🚀 Next Steps After Completion
After completing this epic:
User testing with real environments
Gather feedback on UX
Consider future improvements:
Interactive confirmation with resource preview
Selective destruction (only OpenTofu, only Ansible, etc.)
Epic Type: Child Epic #10 (Phase 2 of Task 1.2)
Parent Epic: #8 (
epic-destroy-command.md)Dependencies: Child Epic #9 (
epic-app-layer-destroy-command.md) must be completed firstRelated Roadmap: Section 1.2
Parent Issue: #2 (Scaffolding for main app)
Roadmap Section: 1.2 - Create command
torrust-tracker-deployer destroyType: Epic
Priority: High
📋 Epic Overview
Implement the user-facing CLI interface for the destroy command. This epic builds on top of the application layer implementation from Epic #9 to provide a complete, production-ready CLI experience.
This is Phase 2 of the inside-outside approach: after the core application logic is implemented and tested, we add the user-friendly CLI interface.
🎯 Goals
destroyNote: Force flags (
--force,--yes) and skip confirmation features are out of scope for MVP. These are easy to implement later and not essential for the initial destroy command functionality.🚫 Non-Goals
📦 Sub-Issues
Issue #21: Fix E2E Infrastructure Preservation
Description: Restore the
--keepflag functionality for E2E tests to enable proper manual testing of the destroy command.Scope: Fix the E2E infrastructure preservation feature that was lost during recent refactoring.
Acceptance Criteria:
--keepflag functionality restored in E2E testslxc list | grep e2e-provisionshows preserved infrastructureGitHub Issue: #21 - 21-fix-e2e-infrastructure-preservation.md
Estimated Effort: 1-2 hours
Issue #22: Rename App Commands to Command Handlers
Description: Refactor existing command terminology for clarity as we introduce UI-level Clap subcommands.
Scope:
src/application/commands/for clarityRationale: As we introduce UI-level commands (Clap subcommands), we need clear terminology:
destroy,provision)DestroyCommand,ProvisionCommand)Acceptance Criteria:
GitHub Issue: #22 - 22-rename-app-commands-to-command-handlers.md
Estimated Effort: 2-3 hours
Issue #23: Add Clap Subcommand Configuration
Description: Implement the
destroysubcommand in the CLI with basic functionality and UserOutput scaffolding.Dependencies: Issue #21 must be completed first to enable manual testing workflow.
Scope:
destroysubcommand tosrc/app.rsDestroyCommandhandlerUserOutputtype andVerbosityLevelenum (followingdocs/research/UX/user-output-vs-logging-separation.md)UserOutputUserOutput Integration:
VerbosityLevelenum (Quiet, Normal, Verbose, VeryVerbose, Debug)UserOutputstruct with methods for different message typesUserOutputfor essential destroy command messagesExample Usage:
Example Output (Normal verbosity level):
Acceptance Criteria:
destroysubcommand added to Clap configurationDestroyCommandfrom Application LayerVerbosityLevelenum implemented (5 levels)UserOutputstruct implemented with basic methods (progress,success,warn)UserOutputGitHub Issue: #23 - 23-add-clap-subcommand-configuration.md
Estimated Effort: 3-4 hours
Issue #24: Add User Documentation
Description: Create comprehensive user-facing documentation for the destroy command.
Scope:
docs/user-guide/about destroy commandAcceptance Criteria:
GitHub Issue: #24 - 24-add-user-documentation.md
Estimated Effort: 2-3 hours
📊 Epic Summary
Total Estimated Effort: 8-12 hours
Sub-Issues:
Out of Scope for MVP: Force flags (
--force,--yes) and skip confirmation features - these can be implemented as separate improvements later.🔗 Dependencies
📝 Technical Notes
MVP Focus
This epic focuses on the essential functionality for MVP:
Future Improvements (out of scope for MVP):
-v,-vv,-q)UI Command vs. Command Handler
After this epic, we'll have clear separation:
User Output vs. Logging
Follow project principles established in
docs/research/UX/user-output-vs-logging-separation.md:UserOutputtype, clear and conciseUserOutput Implementation
Example Destroy Output
Normal Verbosity (MVP implementation):
Parallel Internal Logging (always present):
🚀 Next Steps After Completion
After completing this epic:
📋 Related Documentation
Epic Document: docs/issues/10-epic-ui-layer-destroy-command.md