Skip to content

Check incident_management_settings before sending alert email

Reuben Pereira requested to merge 4925-use-send-email-setting into master

What does this MR do?

The current behavior is: An email is always sent to developers when an alert is received from alertmanager.

The new behavior:

An email should be sent only if the appropriate checkbox is not unticked in the Operations Settings. Note that the settings are stored in the ProjectIncidentManagementSettings model. This means that the email should be sent if any of the following is true:

  1. The project has the incident_management feature_flag and license enabled but does not have an entry in the ProjectIncidentManagementSettings model. This is to keep the default behavior of sending emails to developers.
  2. The project has the incident_management feature_flag and license enabled and ProjectIncidentManagementSettings.send_email is set to true.
  3. The project has the incident_management feature_flag or license disabled. This is also to keep the current behavior of sending emails to developers.

Note that if the incident_management license is disabled, but the incident_management feature flag is enabled, the alert email will not be sent out.

This MR changes the NotifyService to respect the ProjectIncidentManagementSettings.send_email setting.

The new settings form that is being added to the Operations Settings page: image

What are the relevant issue numbers?

#4925 (closed)

Does this MR meet the acceptance criteria?

Edited by Reuben Pereira

Merge request reports