Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Improve UX: Add automatic waiting to infra-apply and app-deploy commands #24

@josecelano

Description

@josecelano

Problem

The current manual deployment workflow has poor UX due to asynchronous task gaps that cause commands to fail if run too quickly:

Current Issues

  1. make infra-apply completes before:

    • VM gets DHCP IP assignment
    • OpenTofu state is refreshed with the IP
    • Cloud-init provisioning finishes
  2. make app-deploy fails if run before:

    • VM is fully accessible via SSH
    • Cloud-init has completed system setup
    • All required packages/services are installed
  3. Users must manually wait between steps without clear indication of readiness

Current Problematic Workflow

make infra-apply ENVIRONMENT=local
# ❌ User doesn't know when to run next command
# ❌ May fail if run too early
make app-deploy ENVIRONMENT=local  
# ❌ User doesn't know when services are ready
make app-health-check

Proposed Solution

Modify commands to wait for full readiness by default, with optional skip flags for advanced users:

# ✅ Default behavior - waits for full readiness
make infra-apply ENVIRONMENT=local    # Waits for IP + cloud-init completion
make app-deploy ENVIRONMENT=local     # Waits for service health  
make app-health-check                 # Already validates

# ✅ Optional skip for advanced users/CI
make infra-apply ENVIRONMENT=local SKIP_WAIT=true
make app-deploy ENVIRONMENT=local SKIP_WAIT=true

Implementation Plan

Phase 1: Enhanced make infra-apply

  • Wait for VM IP assignment
  • Refresh OpenTofu state automatically
  • Wait for cloud-init completion
  • Show progress indicators
  • Add SKIP_WAIT=true option

Phase 2: Enhanced make app-deploy

  • Wait for SSH connectivity
  • Wait for Docker services to be healthy
  • Show deployment progress
  • Add SKIP_WAIT=true option

Phase 3: Documentation Updates

  • Update cloud-deployment-guide.md
  • Add troubleshooting for wait timeouts
  • Document SKIP_WAIT option

Benefits

  • ✅ Better default UX - commands complete when actually ready
  • ✅ Clear progress indication during waits
  • ✅ Backwards compatibility for automation
  • ✅ Matches user mental model of "completion"

Testing Requirements

  • All existing E2E tests must pass
  • Manual testing of the improved three-step workflow:
    make infra-apply ENVIRONMENT=local
    make app-deploy ENVIRONMENT=local  
    make app-health-check
  • Test SKIP_WAIT=true option maintains original behavior

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions