-
Notifications
You must be signed in to change notification settings - Fork 90
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
Reduce the noise around running scriptlets #1606
Conversation
Useful to create "temporary" messages, will be used to reduce the "Running scriptlet" / "Stop scriptlet" rpm transaction noise.
If the scriptlet finishes successfully, do not print the "Running scriptlet..." / "Stop scriptlet..." pair of messages in the transaction progress bar. The "Running scriptlet" message is displayed during the scriptlet execution to inform the user that a time-consuming operation is in progress. If the scriptlet completes successfully, the message is removed. If it fails, the message remains, and an error/warning message and the "Stop scriptlet" message is printed to enable debugging.
d1ffe89
to
e10dc24
Compare
I haven't run code yet, but it looks reasonable. The only concern I have is flickering the line by periodical printing and erasing the message. Maybe we should think about rate limiting of the progress bar. But that's an idea for another pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the code and it works for me.
It should not flicker - the starting message for the scriptlet is printed and then erased only once. So it should be visible during execution of the scriptlet, and eventually erased after the scriptlet successfully finishes. |
switch (return_code) { | ||
case RPMRC_OK: | ||
// remove the script_start message in case the script finished successfully | ||
active_progress_bar->pop_message(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @ppisar mentioned, I've also noticed the flickering. There is always a flash of an empty line after the message is popped and before the next one is printed. I've tried to modify the implementation locally to always just switch on a flag that we have to rewrite the last message next time when adding a new one. It seems the flickering is gone then, but still some edge cases seem need to be covered, like when the message is the last one in the given bar. Let's defer it to a separate issue, see #1611.
Changes:
d1ffe89 (Marek Blaha, 9 minutes ago)
dnf5: Reduce the noise around running scriptlets
If the scriptlet finishes successfully, do not print the
"Running scriptlet..." / "Stop scriptlet..." pair of messages in the
transaction progress bar.
The "Running scriptlet" message is displayed during the scriptlet execution
to inform the user that a time-consuming operation is in progress. If the
scriptlet completes successfully, the message is removed. If it fails, the
message remains, and an error/warning message and the "Stop scriptlet"
message is printed to enable debugging.
b3163df (Marek Blaha, 12 minutes ago)
cli: Method to drop the last progress bar message
Useful to create "temporary" messages, will be used to reduce the
"Running scriptlet" / "Stop scriptlet" rpm transaction noise.
Resolves: #1533