Repository navigation
Proposal: add a --compact flag to gh run watch #4535
Copy link
Copy link
Closed
Labels
enhancementa request to improve CLIa request to improve CLIgh-runrelating to the gh run commandrelating to the gh run command
Description
Describe the feature or problem you’d like to solve
When using gh watch on large projects with more than a few jobs and steps the list of jobs goes off the top of the screen.
Proposed solution
I'd like to propose a --compact flag which only shows the current step of each job, rather than all the past and future steps.
Additional context
Currently the output looks like this when I do an rclone build. This is 200 lines long and nowhere near fits on the largest terminal.
Refreshing run status every 3 seconds. Press Ctrl+C to quit.
- test build #3111 · 1346339921
Triggered via push about 7 minutes ago
JOBS
- android-all (ID 3907194786)
✓ Set up job
✓ Checkout
✓ Set up Go 1.16
✓ Force NDK version
✓ Go module cache
✓ Set global environment variables
✓ build native rclone
✓ install gomobile
✓ arm-v7a gomobile build
✓ arm-v7a Set environment variables
✓ arm-v7a build
✓ arm64-v8a Set environment variables
✓ arm64-v8a build
✓ x86 Set environment variables
✓ x86 build
✓ x64 Set environment variables
✓ x64 build
- Upload artifacts
- Post Go module cache
- Post Checkout
X lint in 1m29s (ID 3907194927)
✓ Set up job
✓ Checkout
X Code quality test
✓ Post Code quality test
✓ Post Checkout
✓ Complete job
- linux (ID 3907195090)
✓ Set up job
✓ Checkout
✓ Install Go
✓ Set environment variables
✓ Install Libraries on Linux
✓ Install Libraries on macOS
✓ Install Libraries on Windows
✓ Print Go version and environment
✓ Go module cache
✓ Build rclone
✓ Run tests
- Race test
- Run librclone tests
- Compile all architectures test
- Deploy built binaries
- Post Go module cache
- Post Checkout
- mac_amd64 (ID 3907195150)
✓ Set up job
✓ Checkout
✓ Install Go
✓ Set environment variables
✓ Install Libraries on Linux
✓ Install Libraries on macOS
✓ Install Libraries on Windows
✓ Print Go version and environment
✓ Go module cache
✓ Build rclone
✓ Run tests
- Race test
- Run librclone tests
- Compile all architectures test
- Deploy built binaries
- Post Go module cache
- Post Checkout
✓ mac_arm64 in 3m56s (ID 3907195227)
✓ Set up job
✓ Checkout
✓ Install Go
✓ Set environment variables
✓ Install Libraries on Linux
✓ Install Libraries on macOS
✓ Install Libraries on Windows
✓ Print Go version and environment
✓ Go module cache
✓ Build rclone
✓ Run tests
✓ Race test
✓ Run librclone tests
✓ Compile all architectures test
✓ Deploy built binaries
✓ Post Go module cache
✓ Post Checkout
✓ Complete job
- windows_amd64 (ID 3907195293)
✓ Set up job
✓ Checkout
✓ Install Go
✓ Set environment variables
✓ Install Libraries on Linux
✓ Install Libraries on macOS
✓ Install Libraries on Windows
✓ Print Go version and environment
✓ Go module cache
✓ Build rclone
✓ Run tests
- Race test
- Run librclone tests
- Compile all architectures test
- Deploy built binaries
- Post Go module cache
- Post Checkout
- windows_386 (ID 3907195369)
✓ Set up job
✓ Checkout
✓ Install Go
✓ Set environment variables
✓ Install Libraries on Linux
✓ Install Libraries on macOS
✓ Install Libraries on Windows
✓ Print Go version and environment
✓ Go module cache
✓ Build rclone
- Run tests
- Race test
- Run librclone tests
- Compile all architectures test
- Deploy built binaries
- Post Go module cache
- Post Checkout
- other_os (ID 3907195431)
✓ Set up job
✓ Checkout
✓ Install Go
✓ Set environment variables
✓ Install Libraries on Linux
✓ Install Libraries on macOS
✓ Install Libraries on Windows
✓ Print Go version and environment
✓ Go module cache
✓ Build rclone
✓ Run tests
✓ Race test
✓ Run librclone tests
- Compile all architectures test
- Deploy built binaries
- Post Go module cache
- Post Checkout
- go1.14 (ID 3907195496)
✓ Set up job
✓ Checkout
✓ Install Go
✓ Set environment variables
✓ Install Libraries on Linux
✓ Install Libraries on macOS
✓ Install Libraries on Windows
✓ Print Go version and environment
✓ Go module cache
✓ Build rclone
✓ Run tests
- Race test
- Run librclone tests
- Compile all architectures test
- Deploy built binaries
- Post Go module cache
- Post Checkout
- go1.15 (ID 3907195576)
✓ Set up job
✓ Checkout
✓ Install Go
✓ Set environment variables
✓ Install Libraries on Linux
✓ Install Libraries on macOS
✓ Install Libraries on Windows
✓ Print Go version and environment
✓ Go module cache
✓ Build rclone
✓ Run tests
- Race test
- Run librclone tests
- Compile all architectures test
- Deploy built binaries
- Post Go module cache
- Post Checkout
- go1.16 (ID 3907195648)
✓ Set up job
✓ Checkout
✓ Install Go
✓ Set environment variables
✓ Install Libraries on Linux
✓ Install Libraries on macOS
✓ Install Libraries on Windows
✓ Print Go version and environment
✓ Go module cache
✓ Build rclone
✓ Run tests
- Race test
- Run librclone tests
- Compile all architectures test
- Deploy built binaries
- Post Go module cache
- Post Checkout
ANNOTATIONS
X golangci-lint exit with code 4
I'd propose that it be shortened to this with the --compact flag, where what is showing is the current step only, or if it has finished, the first failing step, otherwise the last step.
This is only 31 lines long, conveys all the important detail and would fit on my terminal just fine!
Refreshing run status every 3 seconds. Press Ctrl+C to quit.
- test build #3111 · 1346339921
Triggered via push about 7 minutes ago
JOBS
- android-all (ID 3907194786)
- Upload artifacts
X lint in 1m29s (ID 3907194927)
X Code quality test
- linux (ID 3907195090)
- Race test
- mac_amd64 (ID 3907195150)
- Race test
✓ mac_arm64 in 3m56s (ID 3907195227)
✓ Complete job
- windows_amd64 (ID 3907195293)
- Race test
- windows_386 (ID 3907195369)
- Run tests
- other_os (ID 3907195431)
- Compile all architectures test
- go1.14 (ID 3907195496)
- Race test
- go1.15 (ID 3907195576)
- Race test
- go1.16 (ID 3907195648)
- Race test
ANNOTATIONS
X golangci-lint exit with code 4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementa request to improve CLIa request to improve CLIgh-runrelating to the gh run commandrelating to the gh run command
Activity
Vampire commentedon Apr 3, 2023
Maybe an alternative or additional option could be to hide successful steps, so that you can see which are failed, which are still running and which are yet to be executed.
vilmibm commentedon Apr 4, 2023
Sounds great to me.
let's start here.
babakks commentedon May 19, 2025
@iamazeem, Thanks for submitting the PR for this issue! 🙏
However, as I was reviewing your PR, I noticed we need an A/C on this, since there are a few edge/special cases. Also, I think we can achieve a better experience with a few simple improvements to your PR, which is already a good base to build on.
I know this issue started with the idea of just showing the running steps, but as a user I'd expect the
--compactmode to provide me with a terse and yet informative representation of my workflow run. I might not be interested to see all future steps, or all passed ones, but I would like to see the failed ones (which can be more than one step; have a look at this run for such a case). Also, I don't need to see the steps of a completed job if all steps has been successful.I'm going to propose what I think is a good experience for the
--compactoption and then we can discuss it with other folks in the team to derive the A/C for this issue.Proposed experience
Let's say I have workflow run in progress. I'd expect the
--compactmode to show me the live report applying these rules:Also, since the underlying code is shared between
run watchandrun view, we can add the--compactoption torun viewas well.@williammartin @andyfeller @BagToad What do you think?
BagToad commentedon May 20, 2025
I discussed this with @babakks and it makes total sense to me! It doesn't seem all that different to the current implementation; there's just a few differences that I think make sense for a compact output.
babakks commentedon May 21, 2025
So, I'm putting down an A/C for this.
Acceptance Criteria
1. Successful job
Given I have a workflow running, with a job that is completed without any failed steps
When I run
gh run watch --compactThen The job is displayed (among others) as a single line with a green pass marker and no last/final step
2. Completed job with failed steps
Given I have a workflow running, with a job that is completed with one or more failed steps
When I run
gh run watch --compactThen The job is displayed (among others) with a red failure marker, followed by failed steps nested from it
3. Ongoing job
Given I have a workflow running, with a job that is not yet completed, and without any failed steps
When I run
gh run watch --compactThen The job is displayed (among others) as a single line with an asterisk marker, followed by the only running step nested from it
4. Ongoing job with failed steps
Given I have a workflow running, with a job that is not yet completed, but has one or more failed steps
When I run
gh run watch --compactThen The job is displayed (among others) as a single line with an asterisk marker, followed by the failed steps and the only running step nested from it
babakks commentedon May 21, 2025
@iamazeem I made the above A/C to clear up different scenarios. Now I think we can update the PR.
FWIW I made this workflow to help with simulating failed steps, and a sleep per step to be able to check
run watchwhen it's running. For example, you can manually trigger the workflow with an input likeTFTFTto make certain steps fail/pass (Ffor fail). Feel free to use it if you find it helpful.