diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-01 00:07:40 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-01 00:07:40 +0300 |
commit | 9e83d078577a9c066f21fcef1355f800ad895c9c (patch) | |
tree | 8995c5868449584040e58400ae2bcb9f48346fb3 /lib/gitlab/chat | |
parent | 22dde36e800253350e5fa1d902f191a7f64bc6e9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/chat')
-rw-r--r-- | lib/gitlab/chat/responder.rb | 17 |
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 |