Commit 3abcab77 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fixed MR handling when GitLab CI project is not present

parent 183892fd
...@@ -46,7 +46,9 @@ class GitlabCiService < CiService ...@@ -46,7 +46,9 @@ class GitlabCiService < CiService
end end
ci_project = Ci::Project.find_by(gitlab_id: project.id) ci_project = Ci::Project.find_by(gitlab_id: project.id)
Ci::CreateCommitService.new.execute(ci_project, data) if ci_project
Ci::CreateCommitService.new.execute(ci_project, data)
end
end end
def get_ci_commit(sha, ref) def get_ci_commit(sha, ref)
...@@ -85,7 +87,9 @@ class GitlabCiService < CiService ...@@ -85,7 +87,9 @@ class GitlabCiService < CiService
end end
def build_page(sha, ref) def build_page(sha, ref)
Ci::RoutesHelper.ci_project_ref_commits_path(project.gitlab_ci_project, ref, sha) if project.gitlab_ci_project.present?
Ci::RoutesHelper.ci_project_ref_commits_path(project.gitlab_ci_project, ref, sha)
end
end end
def title def title
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
%span CI build #{status} %span CI build #{status}
for #{@merge_request.last_commit_short_sha}. for #{@merge_request.last_commit_short_sha}.
%span.ci-coverage %span.ci-coverage
= link_to "View build details", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink" - if ci_build_details_path(@merge_request)
= link_to "View build details", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget .ci_widget
= icon("spinner spin") = icon("spinner spin")
......
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