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

Fixes #16159 - Rename mail alerts to not be Puppet specific #3741

Merged
merged 1 commit into from May 27, 2017

Conversation

dLobatog
Copy link
Member

Right now, under 'my account', users get emails with alerts about the
status of their hosts regarding configuration management (e.g: if there
was an error, get an alert, or get a weekly summary of all hosts
changes)

These emails gather info from reports that could come from Puppet,
Ansible, Salt or Chef, but there are references to Puppet all over
them.

I think these Puppet references should be removed as these reports
may not come from Puppet.

Another step further in this direction would be to start storing a
'origin' or similar field in Reports and Facts that indicates where
they come from.

@@ -0,0 +1,10 @@
class ConfigError < MailNotification
Copy link
Member

Choose a reason for hiding this comment

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

Since this is missing namespace, I'd prefer something more specific. This is too generic term that can be defined in our dependencies. How about ConfigManagementError or similar?

@dLobatog
Copy link
Member Author

@lzap Thanks for taking a look - I've updated this according to your suggestions, except for removing the fixture which involves changing most of the mail notifications test.

@dLobatog
Copy link
Member Author

@lzap ping?

Copy link
Member

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

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

👍 other then a couple of minor inline comments.

puppet_summary = MailNotification.find_by_name('puppet_summary')
if puppet_summary.present?
puppet_summary.update_attributes(:name => 'config_summary')
end
Copy link
Member

Choose a reason for hiding this comment

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

MailNotification.where(:name => 'puppet_summary').update_all(:name => 'config_summary')?

if puppet_error_state.present?
puppet_error_state.update_attributes(:name => 'config_error_state',
:type => ConfigManagementError)
end
Copy link
Member

Choose a reason for hiding this comment

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

MailNotification.where(:name => 'puppet_error_state').update_all(:name => 'config_error_state', :type => ConfigManagementError)?

@dLobatog
Copy link
Member Author

@tbrisker Updated the migrations as you suggested, thanks 😄

@dLobatog
Copy link
Member Author

@tbrisker Rebased - let me know if there is anything else to fix, thanks!

Copy link
Member

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

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

one comment inline, otherwise code looks good. I don't have a working mail setup to test though.

MailNotification.where(:name => 'config_summary').
update_all(:name => 'puppet_summary')
MailNotification.where(:name => 'config_error_state').
update_all(:name => 'puppet_error_state', :type => ConfigManagementError)
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be type => PuppetError?

Right now, under 'my account', users get emails with alerts about the
status of their hosts regarding configuration management (e.g: if there
was an error, get an alert, or get a weekly summary of all hosts
changes)

These emails gather info from reports that could come from Puppet,
Ansible, Salt or Chef, but there are references to Puppet all over
them.

I think these Puppet references should be removed as these reports
may not come from Puppet.
@dLobatog
Copy link
Member Author

@tbrisker Updated to fix the problem in the down part of the migration. Thanks for reviewing!

@tbrisker tbrisker merged commit d80e243 into theforeman:develop May 27, 2017
@tbrisker
Copy link
Member

Thanks @dLobatog !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants