From 08baa9983ee586c10b4fa28f68b10ba8e7807125 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 3 Jun 2016 13:34:03 +0200 Subject: Use pipelines in context of Project --- app/views/projects/commit/_commit_box.html.haml | 6 +++--- app/views/projects/graphs/ci/_overall.haml | 2 +- app/views/projects/issues/_merge_requests.html.haml | 4 ++-- app/views/projects/issues/_related_branches.html.haml | 6 +++--- app/views/projects/merge_requests/_merge_request.html.haml | 4 ++-- app/views/projects/merge_requests/widget/_show.html.haml | 2 +- app/views/projects/pipelines/_head.html.haml | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) (limited to 'app') diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index 6674d58417b..b117517c0dd 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -53,13 +53,13 @@ - if @commit.status .commit-info-row Builds for - = pluralize(@commit.ci_commits.count, 'pipeline') + = pluralize(@commit.pipelines.count, 'pipeline') = link_to builds_namespace_project_commit_path(@project.namespace, @project, @commit.id), class: "ci-status-link ci-status-icon-#{@commit.status}" do = ci_icon_for_status(@commit.status) = ci_label_for_status(@commit.status) - - if @commit.ci_commits.duration + - if @commit.pipelines.duration in - = time_interval_in_words @commit.ci_commits.duration + = time_interval_in_words @commit.pipelines.duration .commit-box.content-block %h3.commit-title diff --git a/app/views/projects/graphs/ci/_overall.haml b/app/views/projects/graphs/ci/_overall.haml index 4b12e5f2da1..edc4f7b079f 100644 --- a/app/views/projects/graphs/ci/_overall.haml +++ b/app/views/projects/graphs/ci/_overall.haml @@ -16,4 +16,4 @@ %li Commits covered: %strong - = @project.ci_commits.count(:all) + = @project.pipelines.count(:all) diff --git a/app/views/projects/issues/_merge_requests.html.haml b/app/views/projects/issues/_merge_requests.html.haml index 2f9dc867d0d..313c9433de2 100644 --- a/app/views/projects/issues/_merge_requests.html.haml +++ b/app/views/projects/issues/_merge_requests.html.haml @@ -6,8 +6,8 @@ - @merge_requests.each do |merge_request| %li %span.merge-request-ci-status - - if merge_request.ci_commit - = render_pipeline_status(merge_request.ci_commit) + - if merge_request.pipeline + = render_pipeline_status(merge_request.pipeline) - elsif has_any_ci = icon('blank fw') %span.merge-request-id diff --git a/app/views/projects/issues/_related_branches.html.haml b/app/views/projects/issues/_related_branches.html.haml index 5f9d2919982..b9bb6fe559d 100644 --- a/app/views/projects/issues/_related_branches.html.haml +++ b/app/views/projects/issues/_related_branches.html.haml @@ -5,10 +5,10 @@ - @related_branches.each do |branch| %li - sha = @project.repository.find_branch(branch).target - - ci_commit = @project.ci_commit(sha, branch) if sha - - if ci_commit + - pipeline = @project.pipeline(sha, branch) if sha + - if ci_copipelinemmit %span.related-branch-ci-status - = render_pipeline_status(ci_commit) + = render_pipeline_status(pipeline) %span.related-branch-info %strong = link_to namespace_project_compare_path(@project.namespace, @project, from: @project.default_branch, to: branch), class: "label-branch" do diff --git a/app/views/projects/merge_requests/_merge_request.html.haml b/app/views/projects/merge_requests/_merge_request.html.haml index c02f94490a0..37197c7a027 100644 --- a/app/views/projects/merge_requests/_merge_request.html.haml +++ b/app/views/projects/merge_requests/_merge_request.html.haml @@ -11,9 +11,9 @@ = icon('ban') CLOSED - - if merge_request.ci_commit + - if merge_request.pipeline %li - = render_pipeline_status(merge_request.ci_commit) + = render_pipeline_status(merge_request.pipeline) - if merge_request.open? && merge_request.broken? %li diff --git a/app/views/projects/merge_requests/widget/_show.html.haml b/app/views/projects/merge_requests/widget/_show.html.haml index b79508bdc34..d9efe81701f 100644 --- a/app/views/projects/merge_requests/widget/_show.html.haml +++ b/app/views/projects/merge_requests/widget/_show.html.haml @@ -13,7 +13,7 @@ check_enable: #{@merge_request.unchecked? ? "true" : "false"}, ci_status_url: "#{ci_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}", gitlab_icon: "#{asset_path 'gitlab_logo.png'}", - ci_status: "#{@merge_request.ci_commit ? @merge_request.ci_commit.status : ''}", + ci_status: "#{@merge_request.pipeline ? @merge_request.pipeline.status : ''}", ci_message: { normal: "Build {{status}} for \"{{title}}\"", preparing: "{{status}} build for \"{{title}}\"" diff --git a/app/views/projects/pipelines/_head.html.haml b/app/views/projects/pipelines/_head.html.haml index 6e757df5417..d284694efb7 100644 --- a/app/views/projects/pipelines/_head.html.haml +++ b/app/views/projects/pipelines/_head.html.haml @@ -4,7 +4,7 @@ = link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do %span Pipelines - %span.badge.count.ci_counter= number_with_delimiter(@project.ci_commits.running_or_pending.count) + %span.badge.count.ci_counter= number_with_delimiter(@project.pipelines.running_or_pending.count) - if project_nav_tab? :builds = nav_link(controller: %w(builds)) do -- cgit v1.2.3