summaryrefslogtreecommitdiff
path: root/app/controllers/projects/alerting
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 11:18:50 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 11:18:50 +0000
commit8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch)
treea77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/controllers/projects/alerting
parent00b35af3db1abfe813a778f643dad221aad51fca (diff)
downloadgitlab-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.rb16
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