Commit 4c595e9d authored by Justin Ho's avatar Justin Ho

Upgrade "slack-notifier" gem to 2.3.2

parent 59344b22
......@@ -237,7 +237,7 @@ gem 'atlassian-jwt', '~> 0.2.0'
gem 'flowdock', '~> 0.7'
# Slack integration
gem 'slack-notifier', '~> 1.5.1'
gem 'slack-notifier', '~> 2.3.2'
# Hangouts Chat integration
gem 'hangouts-chat', '~> 0.0.5'
......
......@@ -1021,7 +1021,7 @@ GEM
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
sixarm_ruby_unaccent (1.2.0)
slack-notifier (1.5.1)
slack-notifier (2.3.2)
snowplow-tracker (0.6.1)
contracts (~> 0.7, <= 0.11)
spring (2.0.2)
......@@ -1376,7 +1376,7 @@ DEPENDENCIES
sidekiq-cron (~> 1.0)
simple_po_parser (~> 1.1.2)
simplecov (~> 0.16.1)
slack-notifier (~> 1.5.1)
slack-notifier (~> 2.3.2)
snowplow-tracker (~> 0.6.1)
spring (~> 2.0.0)
spring-commands-rspec (~> 1.0.4)
......
......@@ -59,7 +59,7 @@ module ChatMessage
end
def format(string)
Slack::Notifier::LinkFormatter.format(format_relative_links(string))
Slack::Notifier::Util::LinkFormatter.format(format_relative_links(string))
end
def format_relative_links(string)
......
......@@ -98,7 +98,7 @@ module ChatMessage
def failed_stages_field
{
title: s_("ChatMessage|Failed stage").pluralize(failed_stages.length),
value: Slack::Notifier::LinkFormatter.format(failed_stages_links),
value: Slack::Notifier::Util::LinkFormatter.format(failed_stages_links),
short: true
}
end
......@@ -106,7 +106,7 @@ module ChatMessage
def failed_jobs_field
{
title: s_("ChatMessage|Failed job").pluralize(failed_jobs.length),
value: Slack::Notifier::LinkFormatter.format(failed_jobs_links),
value: Slack::Notifier::Util::LinkFormatter.format(failed_jobs_links),
short: true
}
end
......@@ -123,12 +123,12 @@ module ChatMessage
fields = [
{
title: ref_type == "tag" ? s_("ChatMessage|Tag") : s_("ChatMessage|Branch"),
value: Slack::Notifier::LinkFormatter.format(ref_link),
value: Slack::Notifier::Util::LinkFormatter.format(ref_link),
short: true
},
{
title: s_("ChatMessage|Commit"),
value: Slack::Notifier::LinkFormatter.format(commit_link),
value: Slack::Notifier::Util::LinkFormatter.format(commit_link),
short: true
}
]
......
......@@ -48,7 +48,7 @@ module ChatMessage
end
def format(string)
Slack::Notifier::LinkFormatter.format(string)
Slack::Notifier::Util::LinkFormatter.format(string)
end
def commit_messages
......
......@@ -36,7 +36,10 @@ class SlackService < ChatNotificationService
def notify(message, opts)
# See https://github.com/stevenosloan/slack-notifier#custom-http-client
notifier = Slack::Notifier.new(webhook, opts.merge(http_client: HTTPClient))
notifier = Slack::Notifier.new(webhook) do
http_client HTTPClient
defaults opts
end
notifier.ping(
message.pretext,
......
......@@ -29,6 +29,6 @@ class SlackSlashCommandsService < SlashCommandsService
private
def format(text)
Slack::Notifier::LinkFormatter.format(text) if text
Slack::Notifier::Util::LinkFormatter.format(text) if text
end
end
......@@ -63,7 +63,7 @@ module Gitlab
# Convert Markdown to slacks format
def format(string)
Slack::Notifier::LinkFormatter.format(string)
Slack::Notifier::Util::LinkFormatter.format(string)
end
def resource_url
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment