summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Goodman <jgoodman@gitlab.com>2019-04-23 18:05:57 -0400
committerJason Goodman <jgoodman@gitlab.com>2019-04-23 18:05:57 -0400
commit7d2cf168025d54378772b39af9b01454c8de5ef5 (patch)
tree3b6fdd35048dc228a12d13b730f4fe4206dbdd7b
parentcc5f4f1f34810fd8a55c085290948042161cc9fc (diff)
downloadgitlab-ce-issue-42692-deployment-chat-notifications.tar.gz
Implement UrlBuilder.build for Ci::Buildissue-42692-deployment-chat-notifications
Use in DataBuilder::Deployment
-rw-r--r--lib/gitlab/data_builder/deployment.rb2
-rw-r--r--lib/gitlab/url_builder.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/data_builder/deployment.rb b/lib/gitlab/data_builder/deployment.rb
index ff0195aebcd..e83f7591969 100644
--- a/lib/gitlab/data_builder/deployment.rb
+++ b/lib/gitlab/data_builder/deployment.rb
@@ -7,7 +7,7 @@ module Gitlab
def build(deployment)
deployable = deployment.deployable
- deployable_url = Gitlab::Routing.url_helpers.project_job_url(deployable.project, deployable)
+ deployable_url = Gitlab::UrlBuilder.build(deployable)
commit_url = Gitlab::UrlBuilder.build(deployment.commit)
{
object_kind: 'deployment',
diff --git a/lib/gitlab/url_builder.rb b/lib/gitlab/url_builder.rb
index f86d599e4cb..169ce8ab026 100644
--- a/lib/gitlab/url_builder.rb
+++ b/lib/gitlab/url_builder.rb
@@ -30,6 +30,8 @@ module Gitlab
snippet_url(object)
when Milestone
milestone_url(object)
+ when ::Ci::Build
+ project_job_url(object.project, object)
else
raise NotImplementedError.new("No URL builder defined for #{object.class}")
end