summaryrefslogtreecommitdiff
path: root/app/models/project_services/chat_message/pipeline_message.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-10-06 13:00:50 -0700
committerStan Hu <stanhu@gmail.com>2017-10-06 13:02:28 -0700
commit75000979703a58297f76278c4b630ff026b9c50d (patch)
treea634b9983c75ea8791d4a293bdc3f99edf4246f5 /app/models/project_services/chat_message/pipeline_message.rb
parent2cf5dca8f80cdefeb8932bf80417f52f289668c8 (diff)
downloadgitlab-ce-75000979703a58297f76278c4b630ff026b9c50d.tar.gz
Include GitLab full name with username in Slack messagessh-show-all-slack-names
We used to include the first and last name of the user, but !6624 modified this to include only the username. Let's compromise and add both in the form of `First Last (username)`. Closes #38865
Diffstat (limited to 'app/models/project_services/chat_message/pipeline_message.rb')
-rw-r--r--app/models/project_services/chat_message/pipeline_message.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/project_services/chat_message/pipeline_message.rb b/app/models/project_services/chat_message/pipeline_message.rb
index d63d4ec2b12..2135122278a 100644
--- a/app/models/project_services/chat_message/pipeline_message.rb
+++ b/app/models/project_services/chat_message/pipeline_message.rb
@@ -9,7 +9,7 @@ module ChatMessage
def initialize(data)
super
- @user_name = data.dig(:user, :name) || 'API'
+ @user_name = data.dig(:user, :username) || 'API'
pipeline_attributes = data[:object_attributes]
@ref_type = pipeline_attributes[:tag] ? 'tag' : 'branch'
@@ -35,7 +35,7 @@ module ChatMessage
def activity
{
- title: "Pipeline #{pipeline_link} of #{ref_type} #{branch_link} by #{user_name} #{humanized_status}",
+ title: "Pipeline #{pipeline_link} of #{ref_type} #{branch_link} by #{user_combined_name} #{humanized_status}",
subtitle: "in #{project_link}",
text: "in #{pretty_duration(duration)}",
image: user_avatar || ''
@@ -45,7 +45,7 @@ module ChatMessage
private
def message
- "#{project_link}: Pipeline #{pipeline_link} of #{ref_type} #{branch_link} by #{user_name} #{humanized_status} in #{pretty_duration(duration)}"
+ "#{project_link}: Pipeline #{pipeline_link} of #{ref_type} #{branch_link} by #{user_combined_name} #{humanized_status} in #{pretty_duration(duration)}"
end
def humanized_status