Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stage summary info to the script execution summary #93

Open
jmgate opened this issue Sep 5, 2024 · 0 comments
Open

Add stage summary info to the script execution summary #93

jmgate opened this issue Sep 5, 2024 · 0 comments
Assignees
Labels
Type: Feature A new capability we need added to the code.

Comments

@jmgate
Copy link
Collaborator

jmgate commented Sep 5, 2024

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.

@jmgate jmgate added the Type: Feature A new capability we need added to the code. label Sep 5, 2024
@jmgate jmgate self-assigned this Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature A new capability we need added to the code.
Projects
None yet
Development

No branches or pull requests

1 participant