Commit 4b8101dc authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'closer-ci-integration' into 'master'

Use CI commit status for merge request widget

For temporary compatibility with other services like Jenkins we ask for
CI status via AJAX request if there is no commit status in GitLab
database
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>


cc @ayufan 

See merge request !1517
parents 10d7c367 e6ab50a7
...@@ -31,6 +31,7 @@ v 8.1.0 (unreleased) ...@@ -31,6 +31,7 @@ v 8.1.0 (unreleased)
- Move CI web hooks page to project settings area - Move CI web hooks page to project settings area
- Fix User Identities API. It now allows you to properly create or update user's identities. - Fix User Identities API. It now allows you to properly create or update user's identities.
- Add user preference to change layout width (Peter Göbel) - Add user preference to change layout width (Peter Göbel)
- Use commit status in merge request widget as preffered source of CI status
v 8.0.4 v 8.0.4
- Fix Message-ID header to be RFC 2111-compliant to prevent e-mails being dropped (Stan Hu) - Fix Message-ID header to be RFC 2111-compliant to prevent e-mails being dropped (Stan Hu)
......
- if @merge_request.has_ci? - if @merge_request.has_ci?
.mr-widget-heading - ci_commit = @merge_request.source_project.ci_commit(@merge_request.source_sha)
- [:success, :skipped, :canceled, :failed, :running, :pending].each do |status| - if ci_commit
.ci_widget{class: "ci-#{status}", style: "display:none"} - status = ci_commit.status
- if status == :success .mr-widget-heading
- status = "passed" .ci_widget{class: "ci-#{status}"}
= icon("check-circle") = ci_status_icon(ci_commit)
- else
= icon("circle")
%span CI build #{status} %span CI build #{status}
for #{@merge_request.last_commit_short_sha}. for #{@merge_request.last_commit_short_sha}.
%span.ci-coverage %span.ci-coverage
- if ci_build_details_path(@merge_request) = link_to "View build details", ci_status_path(ci_commit)
= link_to "View build details", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget - else
= icon("spinner spin") - # Compatibility with old CI integrations (ex jenkins) when you request status from CI server via AJAX
Checking CI status for #{@merge_request.last_commit_short_sha}&hellip; - # Remove in later versions when services like Jenkins will set CI status via Commit status API
.mr-widget-heading
- [:success, :skipped, :canceled, :failed, :running, :pending].each do |status|
.ci_widget{class: "ci-#{status}", style: "display:none"}
- if status == :success
- status = "passed"
= icon("check-circle")
- else
= icon("circle")
%span CI build #{status}
for #{@merge_request.last_commit_short_sha}.
%span.ci-coverage
- if ci_build_details_path(@merge_request)
= link_to "View build details", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget.ci-not_found{style: "display:none"} .ci_widget
= icon("times-circle") = icon("spinner spin")
Could not find CI status for #{@merge_request.last_commit_short_sha}. Checking CI status for #{@merge_request.last_commit_short_sha}&hellip;
.ci_widget.ci-error{style: "display:none"} .ci_widget.ci-not_found{style: "display:none"}
= icon("times-circle") = icon("times-circle")
Could not connect to the CI server. Please check your settings and try again. Could not find CI status for #{@merge_request.last_commit_short_sha}.
:coffeescript .ci_widget.ci-error{style: "display:none"}
$ -> = icon("times-circle")
merge_request_widget.getCiStatus() Could not connect to the CI server. Please check your settings and try again.
:coffeescript
$ ->
merge_request_widget.getCiStatus()
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