diff options
author | Poornima M <poornima.malepati@gmail.com> | 2017-01-18 16:08:59 +0530 |
---|---|---|
committer | Poornima M <poornima.malepati@gmail.com> | 2017-01-25 21:48:57 +0530 |
commit | d5fa77d53d73b9d47647443460d2ea95babb52e4 (patch) | |
tree | 83dbd65387fd81afc083bef9c4f99f4ce6aa58ee /lib | |
parent | 1fe80c296243c92fc4619ae556bc53383c059266 (diff) | |
download | gitlab-ce-d5fa77d53d73b9d47647443460d2ea95babb52e4.tar.gz |
Adding links to user & build in Chat Notifications
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/data_builder/build.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab/data_builder/build.rb b/lib/gitlab/data_builder/build.rb index 6548e6475c6..f78106f5b10 100644 --- a/lib/gitlab/data_builder/build.rb +++ b/lib/gitlab/data_builder/build.rb @@ -8,6 +8,8 @@ module Gitlab commit = build.pipeline user = build.user + author_url = build_author_url(build.commit, commit) + data = { object_kind: 'build', @@ -43,6 +45,7 @@ module Gitlab message: commit.git_commit_message, author_name: commit.git_author_name, author_email: commit.git_author_email, + author_url: author_url, status: commit.status, duration: commit.duration, started_at: commit.started_at, @@ -62,6 +65,13 @@ module Gitlab data end + + private + + def build_author_url(commit, pipeline) + author = commit.try(:author) + author ? Gitlab::Routing.url_helpers.user_url(author) : "mailto:#{pipeline.git_author_email}" + end end end end |