Repository navigation
Proposal: add a --compact flag to gh run watch #4535
Description
Activity
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.
Sounds great to me.
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.
let's start here.
Reacted by Björn Kautler, Nick Craig-Wood and Azeem@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:- If a job is completed:
- If all steps were successful, only show the job name.
- If the job has failed steps, show the job name and the failed steps.
- If a job is still in progress:
- If no step has failed, only show the job name and the currently running step.
- GH Actions does not support parallel running steps, but this can change someday. So, I'd like to see all running steps, if there are more than one.
- If one or more steps has failed, show the job name, the failed steps, and the current running step, in a chronological order.
- If no step has failed, only show the job name and the currently running step.
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?
Reacted by Azeem and Kynan Ware- If a job is completed:
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.
Reacted by Babak K. Shandiz and AzeemSo, 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 rungh run watch --compact
Then The job is displayed (among others) as a single line with a green pass marker and no last/final step2. 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 rungh run watch --compact
Then The job is displayed (among others) with a red failure marker, followed by failed steps nested from it3. Ongoing job
Given I have a workflow running, with a job that is not yet completed, and without any failed steps
When I rungh run watch --compact
Then The job is displayed (among others) as a single line with an asterisk marker, followed by the only running step nested from it4. 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 rungh run watch --compact
Then 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 itReacted by Azeem@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.Reacted by Azeem
Describe the feature or problem you’d like to solve
When using
gh watchon 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
--compactflag 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.
I'd propose that it be shortened to this with the
--compactflag, 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!