diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-06 15:08:10 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-06 15:08:10 +0000 |
commit | c8003cdfe1597fa6aab21e91aab8cb77097e7eea (patch) | |
tree | 759b16c518b0abf8354e0382b72b672849db254d /app/models/alert_management | |
parent | 07207812561efc09c0c8783fd8d1430bb90dfd33 (diff) | |
download | gitlab-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.rb | 11 |
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 |