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
This commit is contained in:
commit
c87f83602e
|
@ -48,6 +48,8 @@ module CiStatusHelper
|
|||
'icon_status_created'
|
||||
when 'skipped'
|
||||
'icon_status_skipped'
|
||||
when 'manual'
|
||||
'icon_status_manual'
|
||||
else
|
||||
'icon_status_canceled'
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
- if @pipeline
|
||||
.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) }
|
||||
%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
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
= render 'projects/merge_requests/widget/open/build_failed'
|
||||
- elsif !@merge_request.mergeable_discussions_state?
|
||||
= 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
|
||||
= render 'projects/merge_requests/widget/open/accept'
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
%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
|
|||
|
||||
context 'view merge request' do
|
||||
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
|
||||
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
|
||||
|
@ -96,6 +101,26 @@ describe 'Merge request', :feature, :js do
|
|||
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
|
||||
before do
|
||||
commit_status = create(:commit_status, project: project, status: 'pending')
|
||||
|
|
Loading…
Reference in New Issue