canonical / craft-application

The basis for *craft applications
https://canonical-craft-application.readthedocs-hosted.com/en/latest
GNU Lesser General Public License v3.0
7 stars 12 forks source link

Lifecycle progress messages get repeated when in verbose mode #107

Open tigarmo opened 1 year ago

tigarmo commented 1 year ago

Bug Description

When running a craft tool in --verbose (or higher, probably), the lifecycle messages like Pulling mypart get duplicated.

To Reproduce

Run any lifecycle-using command with verbose verbosity, e.g. appcraft build -v.

part yaml

n/a

Relevant log output

Initialising lifecycle                                                                                                                          
Installing build-packages                                                                                                                       
Pulling my-part                                                                                                                                 
Pulling my-part                                                                                                                                 
Pulling pebble                                                                                                                                  
Pulling pebble                                                                                                                                  
Overlaying my-part                                                                                                                              
Overlaying my-part                                                                                                                              
Overlaying pebble                                                                                                                               
Overlaying pebble                                                                                                                               
Building my-part                                                                                                                                
Building my-part
tigarmo commented 1 year ago

I think this happens because we pass the step message to the emit.open_stream() call here. That message then gets printed again, even though it was just printed in the emit.progress() call.

My initial thinking is that the correct fix is here to make that text parameter optional in Emitter.open_stream(), and then omit it in the lifecycle service code linked above. In our case that text is always redundant now, it's a relic of times past.

syncronize-issues-to-jira[bot] commented 8 months ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-2605.

This message was autogenerated

lengau commented 2 months ago

I'm unable to reproduce this with the latest snapcraft or charmcraft, so I believe this has been fixed. Could you verify?

(I couldn't validate with rorkcraft due to overlay issues)