Add progress bars and spinners for long-running CLI operations#149
Draft
Add progress bars and spinners for long-running CLI operations#149
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.goZero-dependency terminal progress UI with three primitives:
progressBar— in-place[████████░░░░░░░░] 8/36 waiting for DevLake (1m20s elapsed)via\rcountdown(n, label)— deterministic per-second fill bar for fixed-duration sleepsspinWhile(label, fn)— runsfnin a goroutine, shows a braille spinner (⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏) until it returnsConstants
progressLineWidth = 72andprogressBarWidth = 24keep rendering consistent across all callers.Applied to long-running operations
waitForReady/waitForReadyAny/waitForMigrationstartLocalContainers— MySQL init sleeptime.Sleep(30s)countdown(30, "MySQL initializing")DeployBicepindeploy_azure.gospinWhile("Deploying Azure resources via Bicep", ...)time.Sleep(30s)countdown(30, "waiting for MySQL")triggerAndPollinconfigure_projects.go[████░░░░] 3/8 tasks — TASK_RUNNING (45s elapsed)Example — spinner wrapping Bicep deployment
On failure,
spinWhileclears the spinner line before returning so the caller's error message lands on a clean line.Original prompt
Created from VS Code.