_heading.html.haml 2.11 KB
Newer Older
1
- if @pipeline
2
  .mr-widget-heading
Phil Hughes's avatar
Phil Hughes committed
3
    - %w[success skipped canceled failed running pending].each do |status|
4
      .ci_widget{ class: "ci-#{status}", style: ("display:none" unless @pipeline.status == status) }
Phil Hughes's avatar
Phil Hughes committed
5
        = ci_icon_for_status(status)
6
        %span
Phil Hughes's avatar
Phil Hughes committed
7 8 9 10 11
          CI build
          = ci_label_for_status(status)
        for
        - commit = @merge_request.last_commit
        = succeed "." do
12
          = link_to @pipeline.short_sha, namespace_project_commit_path(@merge_request.source_project.namespace, @merge_request.source_project, @pipeline.sha), class: "monospace"
Phil Hughes's avatar
Phil Hughes committed
13 14 15 16 17 18 19
        %span.ci-coverage
        = link_to "View details", builds_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: "js-show-tab", data: {action: 'builds'}

- elsif @merge_request.has_ci?
  - # 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
20
    - %w[success skipped canceled failed running pending].each do |status|
Phil Hughes's avatar
Phil Hughes committed
21
      .ci_widget{class: "ci-#{status}", style: "display:none"}
22 23 24 25
        = ci_icon_for_status(status)
        %span
          CI build
          = ci_label_for_status(status)
26 27 28 29
        for
        - commit = @merge_request.last_commit
        = succeed "." do
          = link_to commit.short_id, namespace_project_commit_path(@merge_request.source_project.namespace, @merge_request.source_project, commit), class: "monospace"
30
        %span.ci-coverage
Phil Hughes's avatar
Phil Hughes committed
31
        - if details_path = ci_build_details_path(@merge_request)
32
          = link_to "View details", details_path, :"data-no-turbolink" => "data-no-turbolink"
33

Phil Hughes's avatar
Phil Hughes committed
34 35 36 37 38 39 40 41 42 43
    .ci_widget
      = icon("spinner spin")
      Checking CI status for #{@merge_request.last_commit_short_sha}…

    .ci_widget.ci-not_found{style: "display:none"}
      = icon("times-circle")
      Could not find CI status for #{@merge_request.last_commit_short_sha}.

    .ci_widget.ci-error{style: "display:none"}
      = icon("times-circle")
44
      Could not connect to the CI server. Please check your settings and try again.