Commit e6ab50a7 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

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>
parent b2803a5e
......@@ -33,6 +33,7 @@ v 8.1.0 (unreleased)
- 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.
- 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.3
- Fix URL shown in Slack notifications
......
- if @merge_request.has_ci?
- ci_commit = @merge_request.source_project.ci_commit(@merge_request.source_sha)
- if ci_commit
- status = ci_commit.status
.mr-widget-heading
.ci_widget{class: "ci-#{status}"}
= ci_status_icon(ci_commit)
%span CI build #{status}
for #{@merge_request.last_commit_short_sha}.
%span.ci-coverage
= link_to "View build details", ci_status_path(ci_commit)
- else
- # Compatibility with old CI integrations (ex jenkins) when you request status from CI server via AJAX
- # 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"}
......
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