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

automatic: add a setting to not emit boring messages #1884

Merged

Conversation

AdamWill
Copy link
Contributor

Currently, we always emit messages every time automatic runs, even if it does nothing very interesting (the operation succeeds and there are no changed packages). This is flooding Fedora infra with boring emails that effectively just say "nothing happened".

This adds a setting to only emit if something interesting happened - the operation failed, or we saw package changes.

@AdamWill
Copy link
Contributor Author

There don't appear to be any tests for this code, so, uh...how much do you trust my C++?

hint: the answer should be "not very far at all". Please review carefully. :D

I can imagine a more sophisticated implementation of this where you could configure it per emitter - or have a changed_emit_via list of emitters to do this for, or whatever. But my C++ is not good enough to write either of those in a not-dumb way (I don't know how to properly factor out the loop over the emitters into a shared function, which would be needed to do either of those without stupidly copy/pasting the loop). So, this!

@AdamWill AdamWill force-pushed the automatic-emit-only-changed branch from 33cf93f to 869fb44 Compare November 20, 2024 19:25
@jan-kolarik jan-kolarik self-assigned this Dec 13, 2024
@jan-kolarik
Copy link
Member

Hi @AdamWill, sorry for the delayed response. If I'm looking at this correctly, this behavior differs from dnf4, where no message was shown for an empty transaction. I believe we should make this the default behavior and introduce a config option for users who prefer explicit messages indicating that "everything is fine". Will check with the team and get back to you next week.

@AdamWill
Copy link
Contributor Author

sorry, didn't get back to it yet, will try and update this later today.

Currently, we always emit messages every time automatic runs,
even if it does nothing very interesting (the operation succeeds
and there are no changed packages). This is flooding Fedora infra
with boring emails that effectively just say "nothing happened".

This adds a setting that controls whether we emit a message when
nothing interesting happened, and makes it default to false, so
we only emit if *something* interesting happened - the operation
failed, or we saw package changes.

Signed-off-by: Adam Williamson <[email protected]>
@AdamWill AdamWill force-pushed the automatic-emit-only-changed branch from 869fb44 to fe0de83 Compare December 18, 2024 22:54
@AdamWill
Copy link
Contributor Author

OK, rebased and updated with the logic inverted but the default kept as false (so now we do not emit boring messages by default).

Copy link
Member

@jan-kolarik jan-kolarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for bringing this up!

@jan-kolarik jan-kolarik added this pull request to the merge queue Dec 19, 2024
Merged via the queue into rpm-software-management:main with commit 19f085f Dec 19, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants