Skip to content

feat: [#363] add verbosity levels to configure command#364

Merged
josecelano merged 5 commits intomainfrom
363-add-verbosity-configure
Feb 18, 2026
Merged

feat: [#363] add verbosity levels to configure command#364
josecelano merged 5 commits intomainfrom
363-add-verbosity-configure

Conversation

@josecelano
Copy link
Copy Markdown
Member

Summary

Implements graduated verbosity levels (-v, -vv, -vvv) for the configure command, following the same pattern established in the provision command (PR #361). This gives users control over the amount of progress detail displayed during configuration operations.

Related: Closes #363

What's Changed

Phase 1: Handler Integration (commit 666ca363)

  • ✅ Updated ConfigureCommandHandler to accept CommandProgressListener parameter
  • ✅ Emits step progress for all 4 configuration steps at Verbose level
  • ✅ Controller passes listener from UserOutput to handler
  • ✅ Backward compatible - default behavior unchanged

Phase 2: Step-Level Progress (commit 206d6137)

  • ✅ All 4 configuration steps accept optional listener parameter:
    • InstallDockerStep
    • InstallDockerComposeStep
    • ConfigureSecurityUpdatesStep
    • ConfigureFirewallStep
  • ✅ Steps emit detail messages (versions, configurations, status)
  • ✅ Steps emit debug messages (Ansible commands, working directories)
  • ✅ Handler passes listener through to all steps

Phase 3: Documentation (commit 8c80ff2b)

  • ✅ Added comprehensive verbosity section to docs/user-guide/commands/configure.md
  • ✅ Included examples for all 4 verbosity levels (Normal, Verbose, VeryVerbose, Debug)
  • ✅ Pattern matches provision command documentation
  • Verified with live testing - all documented output matches actual behavior

Verbosity Levels

Level Flag Shows
Normal (default) Essential progress and results
Verbose -v + Detailed progress (4 configuration steps)
VeryVerbose -vv + Context details (versions, status)
Debug -vvv + Technical details (Ansible commands)

Example Output

Normal (Default)

⏳ [1/3] Validating environment...
⏳   ✓ Environment name validated: my-env (took 0ms)
⏳ [2/3] Creating command handler...
⏳   ✓ Done (took 0ms)
⏳ [3/3] Configuring infrastructure...
⏳   ✓ Infrastructure configured (took 37.3s)
✅ Environment 'my-env' configured successfully

Verbose (-v)

⏳ [3/3] Configuring infrastructure...
📋   [Step 1/4] Installing Docker...
📋   [Step 2/4] Installing Docker Compose...
📋   [Step 3/4] Configuring automatic security updates...
📋   [Step 4/4] Configuring firewall (UFW)...
⏳   ✓ Infrastructure configured (took 34.1s)

VeryVerbose (-vv)

📋   [Step 1/4] Installing Docker...
📋      → Installing Docker Engine from official repository
📋      → Docker version: 24.0.7
📋   [Step 2/4] Installing Docker Compose...
📋      → Installing Docker Compose plugin
📋      → Compose version: 2.23.3

Debug (-vvv)

📋   [Step 1/4] Installing Docker...
🔍      → Ansible working directory: ./build/my-env/ansible
🔍      → Executing playbook: ansible-playbook install-docker.yml -i inventory.ini
📋      → Installing Docker Engine from official repository
📋      → Docker version: 24.0.7

Testing

All tests pass: 2292 library tests
Pre-commit checks: All linters pass (markdown, YAML, TOML, cspell, clippy, rustfmt, shellcheck)
No unused dependencies: cargo machete clean
Live testing: Created 4 test environments and verified actual output matches documentation at all verbosity levels

Acceptance Criteria

22/22 criteria complete (100%)

Quality Checks (4/4):

  • ✅ Pre-commit checks pass
  • ✅ No unused dependencies
  • ✅ All tests pass
  • ✅ No clippy warnings

Task-Specific Criteria (11/11):

  • ✅ Configure command accepts -v, -vv, -vvv flags
  • ✅ Default behavior unchanged
  • ✅ Verbose shows 4 configuration steps
  • ✅ VeryVerbose shows detail messages
  • ✅ Debug shows Ansible commands
  • ✅ User output separate from logs
  • ✅ RUST_LOG controls logging independently
  • ✅ Help text explains verbosity levels
  • ✅ Output clean and readable at all levels
  • ✅ Channel separation maintained
  • ✅ Pattern matches provision command

Architecture

  • DDD Layer: Application (src/application/command_handlers/configure/)
  • Pattern: Reuses CommandProgressListener trait from provision command
  • Consistency: Follows same four verbosity levels as provision command
  • Separation of Concerns: User output (verbosity) completely separate from internal logging (RUST_LOG)

Files Modified

Source Code (5 files)

  • src/application/command_handlers/configure/handler.rs - Handler integration and step coordination
  • src/application/steps/software/docker.rs - Docker installation step with listener
  • src/application/steps/software/docker_compose.rs - Docker Compose installation step with listener
  • src/application/steps/system/configure_security_updates.rs - Security updates step with listener
  • src/application/steps/system/configure_firewall.rs - Firewall configuration step with listener

Documentation (2 files)

  • docs/user-guide/commands/configure.md - Added comprehensive verbosity section with examples
  • docs/issues/363-add-verbosity-levels-to-configure-command.md - Issue specification and tracking

Related PRs

Breaking Changes

None. This is a backward-compatible addition - default behavior remains unchanged.

Notes

  • Verbosity controls only user-facing progress messages (via UserOutput)
  • Internal diagnostic logs controlled by RUST_LOG environment variable
  • Symbol legend: ⏳ (progress), ✅ (success), 📋 (details), 🔍 (debug)
  • Documentation verified with live testing - all examples match actual output

@josecelano josecelano self-assigned this Feb 18, 2026
@josecelano
Copy link
Copy Markdown
Member Author

ACK 8c80ff2

@josecelano josecelano merged commit 1fce4ac into main Feb 18, 2026
39 checks passed
@josecelano josecelano deleted the 363-add-verbosity-configure branch February 18, 2026 09:02
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.

Add verbosity levels to configure command

1 participant