Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
f5dc8910
Commit
f5dc8910
authored
Apr 20, 2017
by
Sean McGivern
Committed by
Lin Jen-Shin
Apr 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'fix/29125' into 'master'
Port of fix/29125-ee to CE Closes #29125 See merge request !10796
parent
b9fff815
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
1 deletion
+40
-1
app/assets/javascripts/merge_request_widget.js
app/assets/javascripts/merge_request_widget.js
+7
-1
app/views/projects/merge_requests/widget/_open.html.haml
app/views/projects/merge_requests/widget/_open.html.haml
+2
-0
app/views/projects/merge_requests/widget/open/_error.html.haml
...iews/projects/merge_requests/widget/open/_error.html.haml
+6
-0
changelogs/unreleased/fix-29125.yml
changelogs/unreleased/fix-29125.yml
+4
-0
spec/features/merge_requests/widget_spec.rb
spec/features/merge_requests/widget_spec.rb
+21
-0
No files found.
app/assets/javascripts/merge_request_widget.js
View file @
f5dc8910
...
@@ -157,7 +157,7 @@ import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
...
@@ -157,7 +157,7 @@ import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
$
(
'
.ci-widget-fetching
'
).
show
();
$
(
'
.ci-widget-fetching
'
).
show
();
return
$
.
getJSON
(
this
.
opts
.
ci_status_url
,
(
function
(
_this
)
{
return
$
.
getJSON
(
this
.
opts
.
ci_status_url
,
(
function
(
_this
)
{
return
function
(
data
)
{
return
function
(
data
)
{
var
message
,
status
,
title
;
var
message
,
status
,
title
,
callback
;
_this
.
status
=
data
.
status
;
_this
.
status
=
data
.
status
;
_this
.
hasCi
=
data
.
has_ci
;
_this
.
hasCi
=
data
.
has_ci
;
_this
.
updateMergeButton
(
_this
.
status
,
_this
.
hasCi
);
_this
.
updateMergeButton
(
_this
.
status
,
_this
.
hasCi
);
...
@@ -179,6 +179,12 @@ import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
...
@@ -179,6 +179,12 @@ import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
_this
.
opts
.
ci_sha
=
data
.
sha
;
_this
.
opts
.
ci_sha
=
data
.
sha
;
_this
.
updateCommitUrls
(
data
.
sha
);
_this
.
updateCommitUrls
(
data
.
sha
);
}
}
if
(
data
.
status
===
"
success
"
||
data
.
status
===
"
failed
"
)
{
callback
=
function
()
{
return
_this
.
getMergeStatus
();
};
return
setTimeout
(
callback
,
2000
);
}
if
(
showNotification
&&
data
.
status
)
{
if
(
showNotification
&&
data
.
status
)
{
status
=
_this
.
ciLabelForStatus
(
data
.
status
);
status
=
_this
.
ciLabelForStatus
(
data
.
status
);
if
(
status
===
"
preparing
"
)
{
if
(
status
===
"
preparing
"
)
{
...
...
app/views/projects/merge_requests/widget/_open.html.haml
View file @
f5dc8910
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
=
render
'projects/merge_requests/widget/open/conflicts'
=
render
'projects/merge_requests/widget/open/conflicts'
-
elsif
@merge_request
.
work_in_progress?
-
elsif
@merge_request
.
work_in_progress?
=
render
'projects/merge_requests/widget/open/wip'
=
render
'projects/merge_requests/widget/open/wip'
-
elsif
@merge_request
.
merge_when_pipeline_succeeds?
&&
@merge_request
.
merge_error
.
present?
=
render
'projects/merge_requests/widget/open/error'
-
elsif
@merge_request
.
merge_when_pipeline_succeeds?
-
elsif
@merge_request
.
merge_when_pipeline_succeeds?
=
render
'projects/merge_requests/widget/open/merge_when_pipeline_succeeds'
=
render
'projects/merge_requests/widget/open/merge_when_pipeline_succeeds'
-
elsif
!
@merge_request
.
can_be_merged_by?
(
current_user
)
-
elsif
!
@merge_request
.
can_be_merged_by?
(
current_user
)
...
...
app/views/projects/merge_requests/widget/open/_error.html.haml
0 → 100644
View file @
f5dc8910
%h4
=
icon
(
'exclamation-triangle'
)
This merge request failed to be merged automatically
%p
=
@merge_request
.
merge_error
changelogs/unreleased/fix-29125.yml
0 → 100644
View file @
f5dc8910
---
title
:
Display custom hook error messages when automatic merge is enabled
merge_request
:
author
:
spec/features/merge_requests/widget_spec.rb
View file @
f5dc8910
...
@@ -141,6 +141,27 @@ describe 'Merge request', :feature, :js do
...
@@ -141,6 +141,27 @@ describe 'Merge request', :feature, :js do
end
end
end
end
context
'view merge request with MWPS enabled but automatically merge fails'
do
before
do
merge_request
.
update
(
merge_when_pipeline_succeeds:
true
,
merge_user:
merge_request
.
author
,
merge_error:
'Something went wrong'
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
it
'shows information about the merge error'
do
# Wait for the `ci_status` and `merge_check` requests
wait_for_ajax
page
.
within
(
'.mr-widget-body'
)
do
expect
(
page
).
to
have_content
(
'Something went wrong'
)
end
end
end
context
'merge error'
do
context
'merge error'
do
before
do
before
do
allow_any_instance_of
(
Repository
).
to
receive
(
:merge
).
and_return
(
false
)
allow_any_instance_of
(
Repository
).
to
receive
(
:merge
).
and_return
(
false
)
...
...
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