diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 09:55:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 09:55:51 +0000 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /app/models/alert_management/alert.rb | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) | |
download | gitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'app/models/alert_management/alert.rb')
-rw-r--r-- | app/models/alert_management/alert.rb | 12 |
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 |