Skip to content

Add progress bars and spinners for long-running CLI operations#149

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-progress-bar-capability
Draft

Add progress bars and spinners for long-running CLI operations#149
Copilot wants to merge 2 commits intomainfrom
copilot/add-progress-bar-capability

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

Any operation taking >30s (container startup, Azure Bicep deployment, DB migration, pipeline sync) gave no visual feedback beyond a static message. Users had no way to gauge progress or distinguish a slow operation from a hang.

New: cmd/progress.go

Zero-dependency terminal progress UI with three primitives:

  • progressBar — in-place [████████░░░░░░░░] 8/36 waiting for DevLake (1m20s elapsed) via \r
  • countdown(n, label) — deterministic per-second fill bar for fixed-duration sleeps
  • spinWhile(label, fn) — runs fn in a goroutine, shows a braille spinner (⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏) until it returns

Constants progressLineWidth = 72 and progressBarWidth = 24 keep rendering consistent across all callers.

Applied to long-running operations

Location Before After
waitForReady / waitForReadyAny / waitForMigration New line per poll attempt Single in-place progress bar
startLocalContainers — MySQL init sleep time.Sleep(30s) countdown(30, "MySQL initializing")
DeployBicep in deploy_azure.go Blocking call, no feedback spinWhile("Deploying Azure resources via Bicep", ...)
Azure MySQL restart sleep time.Sleep(30s) countdown(30, "waiting for MySQL")
triggerAndPoll in configure_projects.go New line every 10s with raw elapsed/status In-place [████░░░░] 3/8 tasks — TASK_RUNNING (45s elapsed)

Example — spinner wrapping Bicep deployment

var deployment *azure.DeploymentOutput
err = spinWhile("Deploying Azure resources via Bicep (this takes several minutes)", func() error {
    var innerErr error
    deployment, innerErr = azure.DeployBicep(azureRG, templatePath, params)
    return innerErr
})

On failure, spinWhile clears the spinner line before returning so the caller's error message lands on a clean line.

Original prompt

Add "progress bar" capability in the UI to Containers spinning up and long deployment ones like Azure deployment. Basically anything in the flow where a user has to wait longer than 30 seconds for something should ideally have a progress bar

The user has attached the following file paths as relevant context:

  • .github/copilot-instructions.md
  • AGENTS.md
  • AGENTS.md

Created from VS Code.

- New cmd/progress.go: progressBar struct (in-place fill bar with \r),
  countdown() for deterministic sleeps, spinWhile() for indeterminate
  waits (braille spinner). Constants progressLineWidth/progressBarWidth
  ensure consistent rendering across all callers.
- cmd/helpers.go: waitForReady, waitForReadyAny, waitForMigration now
  show an animated [████░░░░] progress bar instead of printing a new
  line per attempt.
- cmd/deploy_local.go: 30s MySQL init sleep replaced with countdown bar.
- cmd/deploy_azure.go: DeployBicep wrapped with spinWhile(); MySQL 30s
  sleep replaced with countdown().
- cmd/configure_projects.go: triggerAndPoll uses in-place \r updates
  with renderBar for task progress.

Agent-Logs-Url: https://github.com/DevExpGbb/gh-devlake/sessions/5882daaa-5962-4400-851a-c131c3cb23f9

Co-authored-by: ewega <26189114+ewega@users.noreply.github.com>
Copilot AI changed the title [WIP] Add progress bar for long-running UI processes Add progress bars and spinners for long-running CLI operations Mar 30, 2026
Copilot AI requested a review from ewega March 30, 2026 16:00
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.

2 participants