BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c87f8360
Commit
c87f8360
authored
Mar 07, 2017
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Plain Diff
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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
2 deletions
+35
-2
ci_status_helper.rb
app/helpers/ci_status_helper.rb
+2
-0
_heading.html.haml
app/views/projects/merge_requests/widget/_heading.html.haml
+1
-1
_open.html.haml
app/views/projects/merge_requests/widget/_open.html.haml
+2
-0
_manual.html.haml
...ews/projects/merge_requests/widget/open/_manual.html.haml
+4
-0
widget_spec.rb
spec/features/merge_requests/widget_spec.rb
+26
-1
No files found.
app/helpers/ci_status_helper.rb
View file @
c87f8360
...
...
@@ -48,6 +48,8 @@ module CiStatusHelper
'icon_status_created'
when
'skipped'
'icon_status_skipped'
when
'manual'
'icon_status_manual'
else
'icon_status_canceled'
end
...
...
app/views/projects/merge_requests/widget/_heading.html.haml
View file @
c87f8360
-
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
...
...
app/views/projects/merge_requests/widget/_open.html.haml
View file @
c87f8360
...
...
@@ -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'
...
...
app/views/projects/merge_requests/widget/open/_manual.html.haml
0 → 100644
View file @
c87f8360
%h4
Pipeline blocked
%p
The pipeline for this merge request requires a manual action to proceed.
spec/features/merge_requests/widget_spec.rb
View file @
c87f8360
...
...
@@ -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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment