Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/alert_management/alert.rb')
-rw-r--r--app/models/alert_management/alert.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/models/alert_management/alert.rb b/app/models/alert_management/alert.rb
index 156111ffaf3..679406e68d7 100644
--- a/app/models/alert_management/alert.rb
+++ b/app/models/alert_management/alert.rb
@@ -210,7 +210,7 @@ module AlertManagement
end
def self.link_reference_pattern
- @link_reference_pattern ||= super("alert_management", /(?<alert>\d+)\/details(\#)?/)
+ @link_reference_pattern ||= super("alert_management", %r{(?<alert>\d+)/details(\#)?})
end
def self.reference_valid?(reference)
@@ -225,6 +225,10 @@ module AlertManagement
open_statuses.include?(status)
end
+ def open?
+ self.class.open_status?(status_name)
+ end
+
def status_event_for(status)
self.class.state_machines[:status].events.transitions_for(self, to: status.to_s.to_sym).first&.event
end
@@ -248,10 +252,10 @@ module AlertManagement
"#{project.to_reference_base(from, full: full)}#{reference}"
end
- def execute_services
- return unless project.has_active_services?(:alert_hooks)
+ def execute_integrations
+ return unless project.has_active_integrations?(:alert_hooks)
- project.execute_services(hook_data, :alert_hooks)
+ project.execute_integrations(hook_data, :alert_hooks)
end
# Representation of the alert's payload. Avoid accessing