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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
bf6633ef
Commit
bf6633ef
authored
Apr 18, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display custom hook error messages when automatic merge is enabled
parent
465b4ec5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
app/assets/javascripts/merge_request_widget.js
app/assets/javascripts/merge_request_widget.js
+7
-1
app/services/merge_requests/refresh_service.rb
app/services/merge_requests/refresh_service.rb
+7
-0
app/views/projects/merge_requests/widget/_open.html.haml
app/views/projects/merge_requests/widget/_open.html.haml
+4
-2
No files found.
app/assets/javascripts/merge_request_widget.js
View file @
bf6633ef
...
...
@@ -179,7 +179,7 @@ import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
$
(
'
.ci-widget-fetching
'
).
show
();
return
$
.
getJSON
(
this
.
opts
.
ci_status_url
,
(
function
(
_this
)
{
return
function
(
data
)
{
var
message
,
status
,
title
;
var
message
,
status
,
title
,
callback
;
_this
.
status
=
data
.
status
;
_this
.
hasCi
=
data
.
has_ci
;
_this
.
updateMergeButton
(
_this
.
status
,
_this
.
hasCi
);
...
...
@@ -201,6 +201,12 @@ import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
_this
.
opts
.
ci_sha
=
data
.
sha
;
_this
.
updateCommitUrls
(
data
.
sha
);
}
if
(
data
.
status
===
"
success
"
||
data
.
status
===
"
failed
"
)
{
callback
=
function
()
{
return
merge_request_widget
.
getMergeStatus
();
};
return
setTimeout
(
callback
,
2000
);
}
if
(
showNotification
&&
data
.
status
)
{
status
=
_this
.
ciLabelForStatus
(
data
.
status
);
if
(
status
===
"
preparing
"
)
{
...
...
app/services/merge_requests/refresh_service.rb
View file @
bf6633ef
...
...
@@ -12,6 +12,7 @@ module MergeRequests
close_merge_requests
reload_merge_requests
reset_merge_when_pipeline_succeeds
reset_merge_errors
mark_pending_todos_done
cache_merge_requests_closing_issues
...
...
@@ -99,6 +100,12 @@ module MergeRequests
merge_requests_for_source_branch
.
each
(
&
:reset_merge_when_pipeline_succeeds
)
end
def
reset_merge_errors
merge_requests_for_source_branch
.
each
do
|
merge_request
|
merge_request
.
update_attribute
(
:merge_error
,
nil
)
end
end
def
mark_pending_todos_done
merge_requests_for_source_branch
.
each
do
|
merge_request
|
todo_service
.
merge_request_push
(
merge_request
,
@current_user
)
...
...
app/views/projects/merge_requests/widget/_open.html.haml
View file @
bf6633ef
...
...
@@ -27,14 +27,16 @@
=
render
'projects/merge_requests/widget/open/conflicts'
-
elsif
@merge_request
.
work_in_progress?
=
render
'projects/merge_requests/widget/open/wip'
-
elsif
@merge_request
.
should_be_rebased?
=
render
'projects/merge_requests/widget/open/rebase'
-
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?
=
render
'projects/merge_requests/widget/open/merge_when_pipeline_succeeds'
-
elsif
!
@merge_request
.
can_be_merged_by?
(
current_user
)
=
render
'projects/merge_requests/widget/open/not_allowed'
-
elsif
!
@merge_request
.
mergeable_ci_state?
&&
(
@pipeline
.
failed?
||
@pipeline
.
canceled?
)
=
render
'projects/merge_requests/widget/open/build_failed'
-
elsif
@merge_request
.
should_be_rebased?
=
render
'projects/merge_requests/widget/open/rebase'
-
elsif
!
@merge_request
.
mergeable_discussions_state?
=
render
'projects/merge_requests/widget/open/unresolved_discussions'
-
elsif
@pipeline
&
.
blocked?
...
...
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