diff options
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 2 | ||||
-rw-r--r-- | app/views/admin/runners/show.html.haml | 4 | ||||
-rw-r--r-- | app/views/notify/build_fail_email.html.haml | 4 | ||||
-rw-r--r-- | app/views/notify/build_fail_email.text.erb | 6 | ||||
-rw-r--r-- | app/views/notify/build_success_email.html.haml | 4 | ||||
-rw-r--r-- | app/views/notify/build_success_email.text.erb | 6 | ||||
-rw-r--r-- | app/views/projects/builds/show.html.haml | 12 | ||||
-rw-r--r-- | app/views/projects/ci/pipelines/_pipeline.html.haml (renamed from app/views/projects/ci/commits/_commit.html.haml) | 44 | ||||
-rw-r--r-- | features/steps/shared/builds.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/merge_requests_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/ci/api/builds_spec.rb | 2 |
11 files changed, 44 insertions, 44 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index e6924a6a450..1fca05e949a 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -316,7 +316,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController @merge_request_diff = @merge_request.merge_request_diff @pipeline = @merge_request.pipeline - @statuses = @ci_commit.statuses if @pipeline + @statuses = @pipeline.statuses if @pipeline if @merge_request.locked_long_ago? @merge_request.unlock_mr diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml index c3784bf7192..e049b40bfab 100644 --- a/app/views/admin/runners/show.html.haml +++ b/app/views/admin/runners/show.html.haml @@ -99,8 +99,8 @@ %td.build-link - if project - = link_to ci_status_path(build.commit) do - %strong #{build.commit.short_sha} + = link_to ci_status_path(build.pipeline) do + %strong #{build.pipeline.short_sha} %td.timestamp - if build.finished_at diff --git a/app/views/notify/build_fail_email.html.haml b/app/views/notify/build_fail_email.html.haml index 81d65037312..4bf7c1f4d64 100644 --- a/app/views/notify/build_fail_email.html.haml +++ b/app/views/notify/build_fail_email.html.haml @@ -10,7 +10,7 @@ %p Commit: #{link_to @build.short_sha, namespace_project_commit_url(@build.project.namespace, @build.project, @build.sha)} %p - Author: #{@build.commit.git_author_name} + Author: #{@build.pipeline.git_author_name} %p Branch: #{@build.ref} %p @@ -18,7 +18,7 @@ %p Job: #{@build.name} %p - Message: #{@build.commit.git_commit_message} + Message: #{@build.pipeline.git_commit_message} %p Build details: #{link_to "Build #{@build.id}", namespace_project_build_url(@build.project.namespace, @build.project, @build)} diff --git a/app/views/notify/build_fail_email.text.erb b/app/views/notify/build_fail_email.text.erb index 675acea60a1..9d497983498 100644 --- a/app/views/notify/build_fail_email.text.erb +++ b/app/views/notify/build_fail_email.text.erb @@ -1,11 +1,11 @@ Build failed for <%= @project.name %> Status: <%= @build.status %> -Commit: <%= @build.commit.short_sha %> -Author: <%= @build.commit.git_author_name %> +Commit: <%= @build.pipeline.short_sha %> +Author: <%= @build.pipeline.git_author_name %> Branch: <%= @build.ref %> Stage: <%= @build.stage %> Job: <%= @build.name %> -Message: <%= @build.commit.git_commit_message %> +Message: <%= @build.pipeline.git_commit_message %> Url: <%= namespace_project_build_url(@build.project.namespace, @build.project, @build) %> diff --git a/app/views/notify/build_success_email.html.haml b/app/views/notify/build_success_email.html.haml index 5d247eb4cf2..252a5b7152c 100644 --- a/app/views/notify/build_success_email.html.haml +++ b/app/views/notify/build_success_email.html.haml @@ -10,7 +10,7 @@ %p Commit: #{link_to @build.short_sha, namespace_project_commit_url(@build.project.namespace, @build.project, @build.sha)} %p - Author: #{@build.commit.git_author_name} + Author: #{@build.pipeline.git_author_name} %p Branch: #{@build.ref} %p @@ -18,7 +18,7 @@ %p Job: #{@build.name} %p - Message: #{@build.commit.git_commit_message} + Message: #{@build.pipeline.git_commit_message} %p Build details: #{link_to "Build #{@build.id}", namespace_project_build_url(@build.project.namespace, @build.project, @build)} diff --git a/app/views/notify/build_success_email.text.erb b/app/views/notify/build_success_email.text.erb index 747da44acae..c5ed4f84861 100644 --- a/app/views/notify/build_success_email.text.erb +++ b/app/views/notify/build_success_email.text.erb @@ -1,11 +1,11 @@ Build successful for <%= @project.name %> Status: <%= @build.status %> -Commit: <%= @build.commit.short_sha %> -Author: <%= @build.commit.git_author_name %> +Commit: <%= @build.pipeline.short_sha %> +Author: <%= @build.pipeline.git_author_name %> Branch: <%= @build.ref %> Stage: <%= @build.stage %> Job: <%= @build.name %> -Message: <%= @build.commit.git_commit_message %> +Message: <%= @build.pipeline.git_commit_message %> Url: <%= namespace_project_build_url(@build.project.namespace, @build.project, @build) %> diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index 16017c994ba..5477fc65c2b 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -4,7 +4,7 @@ .build-page .row-content-block.top-block Build ##{@build.id} for commit - %strong.monospace= link_to @build.commit.short_sha, ci_status_path(@build.commit) + %strong.monospace= link_to @build.pipeline.short_sha, ci_status_path(@build.pipeline) from = link_to @build.ref, namespace_project_commits_path(@project.namespace, @project, @build.ref) - merge_request = @build.merge_request @@ -13,7 +13,7 @@ = link_to "merge request #{merge_request.to_reference}", merge_request_path(merge_request) #up-build-trace - - builds = @build.commit.builds.latest.to_a + - builds = @build.pipeline.builds.latest.to_a - if builds.size > 1 %ul.nav-links.no-top.no-bottom - builds.each do |build| @@ -178,16 +178,16 @@ Commit .pull-right %small - = link_to @build.commit.short_sha, ci_status_path(@build.commit), class: "monospace" + = link_to @build.pipeline.short_sha, ci_status_path(@build.pipeline), class: "monospace" %p %span.attr-name Branch: = link_to @build.ref, namespace_project_commits_path(@project.namespace, @project, @build.ref) %p %span.attr-name Author: - #{@build.commit.git_author_name} + #{@build.pipeline.git_author_name} %p %span.attr-name Message: - #{@build.commit.git_commit_message} + #{@build.pipeline.git_commit_message} - if @build.tags.any? .build-widget @@ -201,7 +201,7 @@ .build-widget %h4.title #{pluralize(@builds.count(:id), "other build")} for = succeed ":" do - = link_to @build.commit.short_sha, ci_status_path(@build.commit), class: "monospace" + = link_to @build.pipeline.short_sha, ci_status_path(@build.pipeline), class: "monospace" %table.table.builds - @builds.each_with_index do |build, i| %tr.build diff --git a/app/views/projects/ci/commits/_commit.html.haml b/app/views/projects/ci/pipelines/_pipeline.html.haml index 5e3a4123a8e..a0ffa065067 100644 --- a/app/views/projects/ci/commits/_commit.html.haml +++ b/app/views/projects/ci/pipelines/_pipeline.html.haml @@ -1,55 +1,55 @@ -- status = commit.status +- status = pipeline.status %tr.commit %td.commit-link - = link_to namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: "ci-status ci-#{status}" do + = link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline.id), class: "ci-status ci-#{status}" do = ci_icon_for_status(status) - %strong ##{commit.id} + %strong ##{pipeline.id} %td %div.branch-commit - - if commit.ref - = link_to commit.ref, namespace_project_commits_path(@project.namespace, @project, commit.ref), class: "monospace" + - if pipeline.ref + = link_to pipeline.ref, namespace_project_commits_path(@project.namespace, @project, pipeline.ref), class: "monospace" · - = link_to commit.short_sha, namespace_project_commit_path(@project.namespace, @project, commit.sha), class: "commit-id monospace" + = link_to pipeline.short_sha, namespace_project_commit_path(@project.namespace, @project, pipeline.sha), class: "commit-id monospace" - - if commit.tag? + - if pipeline.tag? %span.label.label-primary tag - - elsif commit.latest? + - elsif pipeline.latest? %span.label.label-success.has-tooltip{ title: 'Latest build for this branch' } latest - - if commit.triggered? + - if pipeline.triggered? %span.label.label-primary triggered - - if commit.yaml_errors.present? - %span.label.label-danger.has-tooltip{ title: "#{commit.yaml_errors}" } yaml invalid - - if commit.builds.any?(&:stuck?) + - if pipeline.yaml_errors.present? + %span.label.label-danger.has-tooltip{ title: "#{pipeline.yaml_errors}" } yaml invalid + - if pipeline.builds.any?(&:stuck?) %span.label.label-warning stuck %p.commit-title - - if commit_data = commit.commit_data + - if commit_data = pipeline.commit_data = link_to_gfm truncate(commit_data.title, length: 60), namespace_project_commit_path(@project.namespace, @project, commit_data.id), class: "commit-row-message" - else Cant find HEAD commit for this branch - - stages_status = commit.statuses.stages_status + - stages_status = pipeline.statuses.stages_status - stages.each do |stage| %td - status = stages_status[stage] - tooltip = "#{stage.titleize}: #{status || 'not found'}" - if status - = link_to namespace_project_pipeline_path(@project.namespace, @project, commit.id, anchor: stage), class: "has-tooltip ci-status-icon-#{status}", title: tooltip do + = link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline.id, anchor: stage), class: "has-tooltip ci-status-icon-#{status}", title: tooltip do = ci_icon_for_status(status) - else .light.has-tooltip{ title: tooltip } \- %td - - if commit.started_at && commit.finished_at + - if pipeline.started_at && pipeline.finished_at %p.duration - #{duration_in_words(commit.finished_at, commit.started_at)} + #{duration_in_words(pipeline.finished_at, pipeline.started_at)} %td .controls.hidden-xs.pull-right - - artifacts = commit.builds.latest.select { |b| b.artifacts? } + - artifacts = pipeline.builds.latest.select { |b| b.artifacts? } - if artifacts.present? .dropdown.inline.build-artifacts %button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'} @@ -63,9 +63,9 @@ %span #{build.name} - if can?(current_user, :update_pipeline, @project) - - if commit.retryable? - = link_to retry_namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: 'btn has-tooltip', title: "Retry", method: :post do + - if pipeline.retryable? + = link_to retry_namespace_project_pipeline_path(@project.namespace, @project, pipeline.id), class: 'btn has-tooltip', title: "Retry", method: :post do = icon("repeat") - - if commit.cancelable? - = link_to cancel_namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: 'btn btn-remove has-tooltip', title: "Cancel", method: :post do + - if pipeline.cancelable? + = link_to cancel_namespace_project_pipeline_path(@project.namespace, @project, pipeline.id), class: 'btn btn-remove has-tooltip', title: "Cancel", method: :post do = icon("remove") diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb index 92d7bed0450..bcb8d0fc507 100644 --- a/features/steps/shared/builds.rb +++ b/features/steps/shared/builds.rb @@ -11,7 +11,7 @@ module SharedBuilds step 'project has a recent build' do @ci_commit = create(:ci_commit, project: @project, sha: @project.commit.sha, ref: 'master') - @build = create(:ci_build_with_coverage, commit: @ci_commit) + @build = create(:ci_build_with_coverage, pipeline: @ci_commit) end step 'recent build is successful' do diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index 04cf15641d0..03bc8b70551 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -443,7 +443,7 @@ describe API::API, api: true do it "enables merge when build succeeds if the ci is active" do allow_any_instance_of(MergeRequest).to receive(:pipeline).and_return(pipeline) - allow(ci_commit).to receive(:active?).and_return(true) + allow(pipeline).to receive(:active?).and_return(true) put api("/projects/#{project.id}/merge_requests/#{merge_request.id}/merge", user), merge_when_build_succeeds: true diff --git a/spec/requests/ci/api/builds_spec.rb b/spec/requests/ci/api/builds_spec.rb index 10e3631f5fc..11316d89eba 100644 --- a/spec/requests/ci/api/builds_spec.rb +++ b/spec/requests/ci/api/builds_spec.rb @@ -85,7 +85,7 @@ describe Ci::API::API do trigger = FactoryGirl.create(:ci_trigger, project: project) commit = FactoryGirl.create(:ci_commit, project: project, ref: 'master') - trigger_request = FactoryGirl.create(:ci_trigger_request_with_variables, pipeline: commit, trigger: trigger) + trigger_request = FactoryGirl.create(:ci_trigger_request_with_variables, commit: commit, trigger: trigger) commit.create_builds(nil, trigger_request) project.variables << Ci::Variable.new(key: "SECRET_KEY", value: "secret_value") |