Skip to content

Add stage summary info to the script execution summary #93

@jmgate

Description

@jmgate

It might be worthwhile to allow users to record summary information for each of the stages to be displayed in the script execution summary. E.g., one of the scripts that motivated the development of this package would have produced something like this:

* clone:  <code name> cloned into <source directory>
* config:  <code name> configured in <build directory> with <some command>
* build:  <code name> built in <build directory>
* test:  <code name> successfully/unsuccessfully tested in <build directory>
* install:  <code name> installed in <install directory>

I'm not sure at the moment if it's worth providing separate functionality for this, or if it'd be better for the user to just use the existing functionality for adding their own custom sections to the script execution summary. I'll have to think about this some more.

I could see the benefit over the existing output, especially for long/complicated scripts, for there to be a section near the start of the summary (probably right after the command that was run) that provided just a human-readable high-level overview of what happened. E.g.:

Using Existing Functionality

───────────────── ex_0_the_basics.py Script Execution Summary ──────────────────
                                                            staged_script.py:920
           ➤ Ran the following:                                                 
                                                                                
               ex_0_the_basics.py \                                             
                   --stage hello \                                              
                   --hello-retry-attempts 0 \                                   
                   --hello-retry-delay 0 \                                      
                   --hello-retry-timeout 60 \                                   
                   --goodbye-retry-attempts 0 \                                 
                   --goodbye-retry-delay 0 \                                    
                   --goodbye-retry-timeout 60                                   
                                                                                
           ➤ hello:  Greeted the user
                                                                                
           ➤ goodbye:  Bid them farewell
                                                                                
           ➤ Commands executed:                                                 
                                                                                
               echo 'Hello World'                                               
                                                                                
           ➤ Timing results:                                                    
                                                                                
               ┏━━━━━━━━━┳━━━━━━━━━━━━━━━━┓                                     
               ┃ Stage   ┃ Duration       ┃                                     
               ┡━━━━━━━━━╇━━━━━━━━━━━━━━━━┩                                     
               │ hello   │ 0:00:00.005333 │                                     
               │ goodbye │ 0:00:00.001868 │                                     
               ├─────────┼────────────────┤                                     
               │ Total   │ 0:00:00.010201 │                                     
               └─────────┴────────────────┘                                     
                                                                                
           ➤ Script result:                                                     
                                                                                
               Success                                                          
                                                                                
─────────────── End ex_0_the_basics.py Script Execution Summary ────────────────

With New Functionality:

───────────────── ex_0_the_basics.py Script Execution Summary ──────────────────
                                                            staged_script.py:920
           ➤ Ran the following:                                                 
                                                                                
               ex_0_the_basics.py \                                             
                   --stage hello \                                              
                   --hello-retry-attempts 0 \                                   
                   --hello-retry-delay 0 \                                      
                   --hello-retry-timeout 60 \                                   
                   --goodbye-retry-attempts 0 \                                 
                   --goodbye-retry-delay 0 \                                    
                   --goodbye-retry-timeout 60                                   
                                                                                
           ➤ Stages:                                                 
                                                                                
               ┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓                                     
               ┃ Stage   ┃ Summary           ┃                                     
               ┡━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩                                     
               │ hello   │ Greeted the user  │                                     
               │ goodbye │ Bid them farewell │                                     
               └─────────┴───────────────────┘
                                                                                
           ➤ Commands executed:                                                 
                                                                                
               echo 'Hello World'                                               
                                                                                
           ➤ Timing results:                                                    
                                                                                
               ┏━━━━━━━━━┳━━━━━━━━━━━━━━━━┓                                     
               ┃ Stage   ┃ Duration       ┃                                     
               ┡━━━━━━━━━╇━━━━━━━━━━━━━━━━┩                                     
               │ hello   │ 0:00:00.005333 │                                     
               │ goodbye │ 0:00:00.001868 │                                     
               ├─────────┼────────────────┤                                     
               │ Total   │ 0:00:00.010201 │                                     
               └─────────┴────────────────┘                                     
                                                                                
           ➤ Script result:                                                     
                                                                                
               Success                                                          
                                                                                
─────────────── End ex_0_the_basics.py Script Execution Summary ────────────────

The latter is more desirable aesthetically, but I'd have to think about how this would integrate with how things are currently implemented.

Metadata

Metadata

Assignees

Labels

Type: FeatureA new capability we need added to the code.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions