Skip to content

Conversation

@sj26
Copy link
Member

@sj26 sj26 commented Jul 7, 2025

Based on #500, use SpinWhile everywhere that has a spinner so that the CLI works in more non-TTY environments across the board.

Amp's description follows:


  • Replace spinner.New() calls in 13 files across the codebase
  • All spinners now use SpinWhile for TTY-aware behavior
  • Add comprehensive test coverage for TTY/non-TTY scenarios
  • Ensures CLI works reliably in both interactive and automated environments
  • Follows patterns from PR Handle missing TTY #499 for consistent spinner behavior

Files updated:

  • pkg/cmd/job/retry.go
  • pkg/cmd/build/rebuild.go
  • pkg/cmd/build/cancel.go
  • pkg/cmd/build/view.go
  • pkg/cmd/build/new.go
  • pkg/cmd/agent/view.go
  • pkg/cmd/artifacts/download.go
  • pkg/cmd/build/download.go
  • pkg/cmd/artifacts/list.go
  • pkg/cmd/job/unblock.go
  • pkg/cmd/pipeline/create.go
  • pkg/cmd/cluster/view.go
  • internal/pipeline/resolver/repository.go
  • internal/io/spinner_test.go (enhanced test coverage)

Amp-Thread: https://ampcode.com/threads/T-69a131f0-814d-4d1d-b0fc-f7f61f34b1a6


I'll do a little self review, but from a glance it looks good!

@sj26 sj26 requested a review from a team as a code owner July 7, 2025 03:37
@sj26 sj26 self-assigned this Jul 7, 2025
mcncl
mcncl previously approved these changes Jul 7, 2025
@sj26 sj26 force-pushed the implement-spinwhile-everywhere branch from 4687578 to 31a86b9 Compare July 7, 2025 13:17
@sj26
Copy link
Member Author

sj26 commented Jul 7, 2025

@mcncl I think we need to ✅ and 🚀 #500 first 🙏

Base automatically changed from fix-spin-while to main July 7, 2025 21:44
@mcncl mcncl dismissed their stale review July 7, 2025 21:44

The base branch was changed.

sj26 and others added 2 commits July 8, 2025 17:53
- Replace spinner.New() calls in 13 files across the codebase
- All spinners now use SpinWhile for TTY-aware behavior
- Add comprehensive test coverage for TTY/non-TTY scenarios
- Ensures CLI works reliably in both interactive and automated environments
- Follows patterns from PR #499 for consistent spinner behavior

Files updated:
- pkg/cmd/job/retry.go
- pkg/cmd/build/rebuild.go
- pkg/cmd/build/cancel.go
- pkg/cmd/build/view.go
- pkg/cmd/build/new.go
- pkg/cmd/agent/view.go
- pkg/cmd/artifacts/download.go
- pkg/cmd/build/download.go
- pkg/cmd/artifacts/list.go
- pkg/cmd/job/unblock.go
- pkg/cmd/pipeline/create.go
- pkg/cmd/cluster/view.go
- internal/pipeline/resolver/repository.go
- internal/io/spinner_test.go (enhanced test coverage)

Amp-Thread: https://ampcode.com/threads/T-69a131f0-814d-4d1d-b0fc-f7f61f34b1a6
Co-authored-by: Amp <[email protected]>
- Fix gofmt formatting issues in internal/io/spinner_test.go and pkg/cmd/pipeline/create.go
- Update AGENT.md with correct golangci-lint command

Amp-Thread: https://ampcode.com/threads/T-69a131f0-814d-4d1d-b0fc-f7f61f34b1a6
Co-authored-by: Amp <[email protected]>
@sj26 sj26 force-pushed the implement-spinwhile-everywhere branch from 31a86b9 to 4421edf Compare July 8, 2025 07:53
@sj26
Copy link
Member Author

sj26 commented Jul 8, 2025

Rebased 🙏

@sj26 sj26 requested review from a team and mcncl July 8, 2025 07:53
@sj26
Copy link
Member Author

sj26 commented Jul 8, 2025

Diff looks about right to me 👍

Best viewed ignoring whitespace:

https://github.com/buildkite/cli/pull/501/files?w=1

@scadu scadu merged commit 71f9f87 into main Jul 8, 2025
1 check passed
@scadu scadu deleted the implement-spinwhile-everywhere branch July 8, 2025 08:30
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.

4 participants