Commit 98416ec9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Show proper message for new MR when satellite fails

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent c827af21
...@@ -74,9 +74,17 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -74,9 +74,17 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request.source_branch @merge_request.source_branch
) )
@compare_failed = false
@commits = compare_action.commits @commits = compare_action.commits
@commits.map! { |commit| Commit.new(commit) }
@commit = @commits.first if @commits
@commits.map! { |commit| Commit.new(commit) }
@commit = @commits.first
else
# false value because failed to get commits from satellite
@commits = []
@compare_failed = true
end
@diffs = compare_action.diffs @diffs = compare_action.diffs
@merge_request.title = @merge_request.source_branch.titleize.humanize @merge_request.title = @merge_request.source_branch.titleize.humanize
......
...@@ -33,18 +33,23 @@ ...@@ -33,18 +33,23 @@
%div= msg %div= msg
- if @merge_request.source_branch.present? && @merge_request.target_branch.present? - if @merge_request.source_branch.present? && @merge_request.target_branch.present?
.light-well - if @compare_failed
%center .alert.alert-danger
%h4 %h4 Compare failed
There isn't anything to merge. %p We can't compare selected branches. It may be because of huge diff or satellite timeout. Please try again or select different branches.
%p.slead - else
- if @merge_request.source_branch == @merge_request.target_branch .light-well
You'll need to use different branch names to get a valid comparison. %center
- else %h4
%span.label-branch #{@merge_request.source_branch} There isn't anything to merge.
and %p.slead
%span.label-branch #{@merge_request.target_branch} - if @merge_request.source_branch == @merge_request.target_branch
are the same. You'll need to use different branch names to get a valid comparison.
- else
%span.label-branch #{@merge_request.source_branch}
and
%span.label-branch #{@merge_request.target_branch}
are the same.
%hr %hr
......
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