Commit b486ee40 authored by Shinya Maeda's avatar Shinya Maeda

Merge branch 'nfriend-remove-fancy_pipeline_slack_notifications-ff' into 'master'

Remove `fancy_pipeline_slack_notifications` feature flag

See merge request gitlab-org/gitlab!29969
parents 3233d6f9 559bb7c3
...@@ -52,8 +52,6 @@ module ChatMessage ...@@ -52,8 +52,6 @@ module ChatMessage
def attachments def attachments
return message if markdown return message if markdown
return [{ text: format(message), color: attachment_color }] unless fancy_notifications?
[{ [{
fallback: format(message), fallback: format(message),
color: attachment_color, color: attachment_color,
...@@ -103,10 +101,6 @@ module ChatMessage ...@@ -103,10 +101,6 @@ module ChatMessage
failed_jobs.uniq { |job| job[:name] }.reverse failed_jobs.uniq { |job| job[:name] }.reverse
end end
def fancy_notifications?
Feature.enabled?(:fancy_pipeline_slack_notifications, default_enabled: true)
end
def failed_stages_field def failed_stages_field
{ {
title: s_("ChatMessage|Failed stage").pluralize(failed_stages.length), title: s_("ChatMessage|Failed stage").pluralize(failed_stages.length),
...@@ -166,42 +160,22 @@ module ChatMessage ...@@ -166,42 +160,22 @@ module ChatMessage
end end
def humanized_status def humanized_status
if fancy_notifications? case status
case status when 'success'
when 'success' detailed_status == "passed with warnings" ? s_("ChatMessage|has passed with warnings") : s_("ChatMessage|has passed")
detailed_status == "passed with warnings" ? s_("ChatMessage|has passed with warnings") : s_("ChatMessage|has passed") when 'failed'
when 'failed' s_("ChatMessage|has failed")
s_("ChatMessage|has failed")
else
status
end
else else
case status status
when 'success'
s_("ChatMessage|passed")
when 'failed'
s_("ChatMessage|failed")
else
status
end
end end
end end
def attachment_color def attachment_color
if fancy_notifications? case status
case status when 'success'
when 'success' detailed_status == 'passed with warnings' ? 'warning' : 'good'
detailed_status == 'passed with warnings' ? 'warning' : 'good'
else
'danger'
end
else else
case status 'danger'
when 'success'
'good'
else
'danger'
end
end end
end end
...@@ -230,7 +204,7 @@ module ChatMessage ...@@ -230,7 +204,7 @@ module ChatMessage
end end
def pipeline_url def pipeline_url
if fancy_notifications? && failed_jobs.any? if failed_jobs.any?
pipeline_failed_jobs_url pipeline_failed_jobs_url
else else
"#{project_url}/pipelines/#{pipeline_id}" "#{project_url}/pipelines/#{pipeline_id}"
......
...@@ -3639,9 +3639,6 @@ msgstr "" ...@@ -3639,9 +3639,6 @@ msgstr ""
msgid "ChatMessage|and [%{count} more](%{pipeline_failed_jobs_url})" msgid "ChatMessage|and [%{count} more](%{pipeline_failed_jobs_url})"
msgstr "" msgstr ""
msgid "ChatMessage|failed"
msgstr ""
msgid "ChatMessage|has failed" msgid "ChatMessage|has failed"
msgstr "" msgstr ""
...@@ -3657,9 +3654,6 @@ msgstr "" ...@@ -3657,9 +3654,6 @@ msgstr ""
msgid "ChatMessage|in %{project_link}" msgid "ChatMessage|in %{project_link}"
msgstr "" msgstr ""
msgid "ChatMessage|passed"
msgstr ""
msgid "Check again" msgid "Check again"
msgstr "" msgstr ""
......
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