summaryrefslogtreecommitdiff
path: root/app/models/alert_management
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-06 15:08:10 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-06 15:08:10 +0000
commitc8003cdfe1597fa6aab21e91aab8cb77097e7eea (patch)
tree759b16c518b0abf8354e0382b72b672849db254d /app/models/alert_management
parent07207812561efc09c0c8783fd8d1430bb90dfd33 (diff)
downloadgitlab-ce-c8003cdfe1597fa6aab21e91aab8cb77097e7eea.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/alert_management')
-rw-r--r--app/models/alert_management/alert.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/alert_management/alert.rb b/app/models/alert_management/alert.rb
index 35fae370e4a..564ef024c21 100644
--- a/app/models/alert_management/alert.rb
+++ b/app/models/alert_management/alert.rb
@@ -150,8 +150,19 @@ module AlertManagement
''
end
+ def execute_services
+ return unless Feature.enabled?(:alert_slack_event, project)
+ return unless project.has_active_services?(:alert_hooks)
+
+ project.execute_services(hook_data, :alert_hooks)
+ end
+
private
+ def hook_data
+ Gitlab::DataBuilder::Alert.build(self)
+ end
+
def hosts_length
return unless hosts