diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 06:12:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 06:12:05 +0300 |
commit | dac80e83804c8491956033196ec7621159e709d3 (patch) | |
tree | 4d02373d0c3850c2849e68b5829fc20e8d5980ac /app | |
parent | 346d8760cee627f97457d5b594adaa198a06a7ce (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/models/integrations/base_chat_notification.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/app/models/integrations/base_chat_notification.rb b/app/models/integrations/base_chat_notification.rb index d4bf6353b45..b75801335bd 100644 --- a/app/models/integrations/base_chat_notification.rb +++ b/app/models/integrations/base_chat_notification.rb @@ -28,7 +28,8 @@ module Integrations attribute :category, default: 'chat' - prop_accessor :webhook, :username, :channel, :branches_to_be_notified, :labels_to_be_notified, :labels_to_be_notified_behavior + prop_accessor :webhook, :username, :channel, :branches_to_be_notified, :labels_to_be_notified, + :labels_to_be_notified_behavior, :notify_only_default_branch # Custom serialized properties initialization prop_accessor(*SUPPORTED_EVENTS.map { |event| EVENT_CHANNEL[event] }) @@ -45,10 +46,10 @@ module Integrations super if properties.empty? - self.notify_only_broken_pipelines = true if self.respond_to?(:notify_only_broken_pipelines) + self.notify_only_broken_pipelines = true if respond_to?(:notify_only_broken_pipelines) self.branches_to_be_notified = "default" self.labels_to_be_notified_behavior = MATCH_ANY_LABEL - elsif !properties['notify_only_default_branch'].nil? + elsif !notify_only_default_branch.nil? # In older versions, there was only a boolean property named # `notify_only_default_branch`. Now we have a string property named # `branches_to_be_notified`. Instead of doing a background migration, we @@ -56,7 +57,7 @@ module Integrations # users haven't specified one already. When users edit the integration and # select a value for this new property, it will override everything. - self.branches_to_be_notified ||= properties['notify_only_default_branch'] ? "default" : "all" + self.branches_to_be_notified ||= notify_only_default_branch == 'true' ? "default" : "all" end end @@ -238,7 +239,7 @@ module Integrations case object_kind when "push", "tag_push" Integrations::ChatMessage::PushMessage.new(data) if notify_for_ref?(data) - when "issue" + when "issue", "incident" Integrations::ChatMessage::IssueMessage.new(data) unless update?(data) when "merge_request" Integrations::ChatMessage::MergeMessage.new(data) unless update?(data) @@ -250,8 +251,6 @@ module Integrations Integrations::ChatMessage::WikiPageMessage.new(data) when "deployment" Integrations::ChatMessage::DeploymentMessage.new(data) if notify_for_ref?(data) - when "incident" - Integrations::ChatMessage::IssueMessage.new(data) unless update?(data) when "group_mention" Integrations::ChatMessage::GroupMentionMessage.new(data) end |