summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-22 06:09:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-22 06:09:42 +0000
commit66b52237fd4f10a62afef61034e90f68cb9363a9 (patch)
tree63ca386cfb4deb1ae3571220bee8d91f3b143db6 /app/models
parent37a0fef392fb9da809a6b8aea0115740a5c2ceb6 (diff)
downloadgitlab-ce-66b52237fd4f10a62afef61034e90f68cb9363a9.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project_services/chat_message/pipeline_message.rb48
1 files changed, 11 insertions, 37 deletions
diff --git a/app/models/project_services/chat_message/pipeline_message.rb b/app/models/project_services/chat_message/pipeline_message.rb
index 50b982a803f..1cd3837433f 100644
--- a/app/models/project_services/chat_message/pipeline_message.rb
+++ b/app/models/project_services/chat_message/pipeline_message.rb
@@ -52,8 +52,6 @@ module ChatMessage
def attachments
return message if markdown
- return [{ text: format(message), color: attachment_color }] unless fancy_notifications?
-
[{
fallback: format(message),
color: attachment_color,
@@ -103,10 +101,6 @@ module ChatMessage
failed_jobs.uniq { |job| job[:name] }.reverse
end
- def fancy_notifications?
- Feature.enabled?(:fancy_pipeline_slack_notifications, default_enabled: true)
- end
-
def failed_stages_field
{
title: s_("ChatMessage|Failed stage").pluralize(failed_stages.length),
@@ -166,42 +160,22 @@ module ChatMessage
end
def humanized_status
- if fancy_notifications?
- case status
- when 'success'
- detailed_status == "passed with warnings" ? s_("ChatMessage|has passed with warnings") : s_("ChatMessage|has passed")
- when 'failed'
- s_("ChatMessage|has failed")
- else
- status
- end
+ case status
+ when 'success'
+ detailed_status == "passed with warnings" ? s_("ChatMessage|has passed with warnings") : s_("ChatMessage|has passed")
+ when 'failed'
+ s_("ChatMessage|has failed")
else
- case status
- when 'success'
- s_("ChatMessage|passed")
- when 'failed'
- s_("ChatMessage|failed")
- else
- status
- end
+ status
end
end
def attachment_color
- if fancy_notifications?
- case status
- when 'success'
- detailed_status == 'passed with warnings' ? 'warning' : 'good'
- else
- 'danger'
- end
+ case status
+ when 'success'
+ detailed_status == 'passed with warnings' ? 'warning' : 'good'
else
- case status
- when 'success'
- 'good'
- else
- 'danger'
- end
+ 'danger'
end
end
@@ -230,7 +204,7 @@ module ChatMessage
end
def pipeline_url
- if fancy_notifications? && failed_jobs.any?
+ if failed_jobs.any?
pipeline_failed_jobs_url
else
"#{project_url}/pipelines/#{pipeline_id}"