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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /lib/gitlab/chat/responder.rb
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'lib/gitlab/chat/responder.rb')
-rw-r--r--lib/gitlab/chat/responder.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/gitlab/chat/responder.rb b/lib/gitlab/chat/responder.rb
index 53a625e9d43..478be5bd350 100644
--- a/lib/gitlab/chat/responder.rb
+++ b/lib/gitlab/chat/responder.rb
@@ -11,10 +11,21 @@ module Gitlab
#
# build - A `Ci::Build` that executed a chat command.
def self.responder_for(build)
- integration = build.pipeline.chat_data&.chat_name&.integration
+ if Feature.enabled?(:use_response_url_for_chat_responder)
+ response_url = build.pipeline.chat_data&.response_url
+ return unless response_url
- if (responder = integration.try(:chat_responder))
- responder.new(build)
+ if response_url.start_with?('https://hooks.slack.com/')
+ Gitlab::Chat::Responder::Slack.new(build)
+ else
+ Gitlab::Chat::Responder::Mattermost.new(build)
+ end
+ else
+ integration = build.pipeline.chat_data&.chat_name&.integration
+
+ if (responder = integration.try(:chat_responder))
+ responder.new(build)
+ end
end
end
end