Commit c87f8360 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'feature/gb/add-blocked-pipeline-mr-widget-state' into 'master'

Add new merge request widget state for blocked pipeline

See merge request !9762
parents d4ecf427 64ae4689
...@@ -48,6 +48,8 @@ module CiStatusHelper ...@@ -48,6 +48,8 @@ module CiStatusHelper
'icon_status_created' 'icon_status_created'
when 'skipped' when 'skipped'
'icon_status_skipped' 'icon_status_skipped'
when 'manual'
'icon_status_manual'
else else
'icon_status_canceled' 'icon_status_canceled'
end end
......
- if @pipeline - if @pipeline
.mr-widget-heading .mr-widget-heading
- %w[success success_with_warnings skipped canceled failed running pending].each do |status| - %w[success success_with_warnings skipped manual canceled failed running pending].each do |status|
.ci_widget{ class: "ci-#{status}", style: ("display:none" unless @pipeline.status == status) } .ci_widget{ class: "ci-#{status}", style: ("display:none" unless @pipeline.status == status) }
%div{ class: "ci-status-icon ci-status-icon-#{status}" } %div{ class: "ci-status-icon ci-status-icon-#{status}" }
= link_to namespace_project_pipeline_path(@pipeline.project.namespace, @pipeline.project, @pipeline.id), class: 'icon-link' do = link_to namespace_project_pipeline_path(@pipeline.project.namespace, @pipeline.project, @pipeline.id), class: 'icon-link' do
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
= render 'projects/merge_requests/widget/open/build_failed' = render 'projects/merge_requests/widget/open/build_failed'
- elsif !@merge_request.mergeable_discussions_state? - elsif !@merge_request.mergeable_discussions_state?
= render 'projects/merge_requests/widget/open/unresolved_discussions' = render 'projects/merge_requests/widget/open/unresolved_discussions'
- elsif @pipeline&.blocked?
= render 'projects/merge_requests/widget/open/manual'
- elsif @merge_request.can_be_merged? || resolved_conflicts - elsif @merge_request.can_be_merged? || resolved_conflicts
= render 'projects/merge_requests/widget/open/accept' = render 'projects/merge_requests/widget/open/accept'
......
%h4
Pipeline blocked
%p
The pipeline for this merge request requires a manual action to proceed.
...@@ -37,7 +37,12 @@ describe 'Merge request', :feature, :js do ...@@ -37,7 +37,12 @@ describe 'Merge request', :feature, :js do
context 'view merge request' do context 'view merge request' do
let!(:environment) { create(:environment, project: project) } let!(:environment) { create(:environment, project: project) }
let!(:deployment) { create(:deployment, environment: environment, ref: 'feature', sha: merge_request.diff_head_sha) }
let!(:deployment) do
create(:deployment, environment: environment,
ref: 'feature',
sha: merge_request.diff_head_sha)
end
before do before do
visit namespace_project_merge_request_path(project.namespace, project, merge_request) visit namespace_project_merge_request_path(project.namespace, project, merge_request)
...@@ -96,6 +101,26 @@ describe 'Merge request', :feature, :js do ...@@ -96,6 +101,26 @@ describe 'Merge request', :feature, :js do
end end
end end
context 'when merge request is in the blocked pipeline state' do
before do
create(:ci_pipeline, project: project,
sha: merge_request.diff_head_sha,
ref: merge_request.source_branch,
status: :manual)
visit namespace_project_merge_request_path(project.namespace,
project,
merge_request)
end
it 'shows information about blocked pipeline' do
expect(page).to have_content("Pipeline blocked")
expect(page).to have_content(
"The pipeline for this merge request requires a manual action")
expect(page).to have_css('.ci-status-icon-manual')
end
end
context 'view merge request with MWBS button' do context 'view merge request with MWBS button' do
before do before do
commit_status = create(:commit_status, project: project, status: 'pending') commit_status = create(:commit_status, project: project, status: 'pending')
......
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