diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/controllers/projects/alerting | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) | |
download | gitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/controllers/projects/alerting')
-rw-r--r-- | app/controllers/projects/alerting/notifications_controller.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/app/controllers/projects/alerting/notifications_controller.rb b/app/controllers/projects/alerting/notifications_controller.rb index 358e7629958..fef8235628d 100644 --- a/app/controllers/projects/alerting/notifications_controller.rb +++ b/app/controllers/projects/alerting/notifications_controller.rb @@ -29,12 +29,22 @@ module Projects end def notify_service - Projects::Alerting::NotifyService - .new(project, current_user, notification_payload) + notify_service_class.new(project, current_user, notification_payload) + end + + def notify_service_class + # We are tracking the consolidation of these services in + # https://gitlab.com/groups/gitlab-org/-/epics/3360 + # to get rid of this workaround. + if Projects::Prometheus::Alerts::NotifyService.processable?(notification_payload) + Projects::Prometheus::Alerts::NotifyService + else + Projects::Alerting::NotifyService + end end def notification_payload - params.permit![:notification] + @notification_payload ||= params.permit![:notification] end end end |