Skip to content

feat: add real-time TTY progress output for AWS env status polling#214

Open
ianaya89 wants to merge 4 commits intomasterfrom
feat/tty-progress-output
Open

feat: add real-time TTY progress output for AWS env status polling#214
ianaya89 wants to merge 4 commits intomasterfrom
feat/tty-progress-output

Conversation

@ianaya89
Copy link
Member

@ianaya89 ianaya89 commented Mar 18, 2026

Summary

  • Write provisioning progress directly to /dev/tty during spec revision polling, showing elapsed time and current vs target revision
  • Gracefully skips output when no TTY is available (e.g. CI/CD environments)
  • Provides real-time feedback during long-running terraform apply operations without polluting Terraform's stdout/stderr

Example output

  [altinitycloud] Waiting for "my-aws-env" to reach spec revision 5...
  [altinitycloud] [10s] my-aws-env: revision 3/5, connecting...
  [altinitycloud] [20s] my-aws-env: revision 3/5, connecting...
  [altinitycloud] [30s] my-aws-env: revision 3/5, waiting...
  [altinitycloud] [40s] my-aws-env: revision 4/5, waiting...
  [altinitycloud] [50s] my-aws-env: revision 5/5, ready!

Downsides

  1. /dev/tty is Unix-only. On Windows openTTY returns nil gracefully (no breakage, but no output).
  2. If a panic occurs between open and return, the file descriptor leaks (the defer Close() won't run). Minor edge case.
  3. With a 30s poll interval and 60min timeout, output could reach ~120 lines in the worst case.

Write provisioning progress directly to /dev/tty during spec revision
polling, showing elapsed time and current vs target revision. Gracefully
skips output when no TTY is available (e.g. CI/CD environments).
… env status data sources

Add opt-in verbose flag (default true) to all env status data sources
(AWS, GCP, Azure, K8s, HCloud). Extract TTYWriter to common package
for shared use. Setting verbose=false disables terminal output.
Move TTY output, timeout handling, DISCONNECTED logic, and progress
messages into a shared WaitForSpecRevision function. Each data source
now only provides a PollFunc callback for its provider-specific API call.
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.

1 participant