debian-mirror-gitlab/app/views/projects/ci/builds/_build.html.haml

136 lines
5.7 KiB
Text
Raw Normal View History

2017-08-17 22:00:37 +05:30
- job = build.present(current_user: current_user)
- pipeline = job.pipeline
2016-09-29 09:46:39 +05:30
- admin = local_assigns.fetch(:admin, false)
- ref = local_assigns.fetch(:ref, nil)
- commit_sha = local_assigns.fetch(:commit_sha, nil)
- retried = local_assigns.fetch(:retried, false)
2017-08-17 22:00:37 +05:30
- pipeline_link = local_assigns.fetch(:pipeline_link, false)
2016-09-29 09:46:39 +05:30
- stage = local_assigns.fetch(:stage, false)
- allow_retry = local_assigns.fetch(:allow_retry, false)
2021-11-11 11:23:49 +05:30
-# This prevents initializing another Ci::Status object where 'status' is used
- status = job.detailed_status(current_user)
2016-09-29 09:46:39 +05:30
2017-08-17 22:00:37 +05:30
%tr.build.commit{ class: ('retried' if retried) }
2016-06-02 11:05:42 +05:30
%td.status
2021-11-11 11:23:49 +05:30
-# Sending 'status' prevents calling the user relation inside the presenter, generating N+1,
-# see https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68743
= render "ci/status/badge", status: status, title: job.status_title(status)
2016-06-02 11:05:42 +05:30
2021-10-27 15:23:28 +05:30
%td
2017-08-17 22:00:37 +05:30
- if can?(current_user, :read_build, job)
2021-10-27 15:23:28 +05:30
= link_to job.name, project_job_path(job.project, job), class: 'gl-text-blue-600!'
2016-11-03 12:29:30 +05:30
- else
2021-10-27 15:23:28 +05:30
%span.gl-text-blue-600!
= job.name
%td.branch-commit.gl-text-gray-900
%span.build-link ##{job.id}
2016-06-02 11:05:42 +05:30
2016-11-03 12:29:30 +05:30
- if ref
2017-08-17 22:00:37 +05:30
- if job.ref
2021-01-03 14:25:43 +05:30
.icon-container.gl-display-inline-block
= job.tag? ? sprite_icon('label', css_class: 'sprite') : sprite_icon('fork', css_class: 'sprite')
2017-09-10 17:25:29 +05:30
= link_to job.ref, project_ref_path(job.project, job.ref), class: "ref-name"
2016-11-03 12:29:30 +05:30
- else
2019-03-02 22:35:43 +05:30
.light= _('none')
2016-11-03 12:29:30 +05:30
.icon-container.commit-icon
= custom_icon("icon_commit")
- if commit_sha
2019-07-31 22:56:46 +05:30
= link_to job.short_sha, project_commit_path(job.project, job.sha), class: "commit-sha mr-0"
2016-08-24 12:49:21 +05:30
2017-08-17 22:00:37 +05:30
- if job.stuck?
2021-01-03 14:25:43 +05:30
%span.has-tooltip{ title: _('Job is stuck. Check runners.') }
= sprite_icon('warning', css_class: 'text-warning!')
2016-08-24 12:49:21 +05:30
2016-11-03 12:29:30 +05:30
- if retried
2021-01-03 14:25:43 +05:30
%span.has-tooltip{ title: _('Job was retried') }
= sprite_icon('retry', css_class: 'text-warning')
2016-09-13 17:45:13 +05:30
2016-11-03 12:29:30 +05:30
.label-container
2017-08-17 22:00:37 +05:30
- if job.tags.any?
- job.tags.each do |tag|
2022-01-26 12:08:38 +05:30
= gl_badge_tag tag, variant: :info, size: :sm
2017-08-17 22:00:37 +05:30
- if job.try(:trigger_request)
2022-01-26 12:08:38 +05:30
= gl_badge_tag _('triggered'), variant: :info, size: :sm
2020-04-08 14:13:33 +05:30
- if job.try(:allow_failure) && !job.success?
2022-01-26 12:08:38 +05:30
= gl_badge_tag _('allowed to fail'), variant: :warning, size: :sm
2018-12-05 23:21:45 +05:30
- if job.schedulable?
2022-01-26 12:08:38 +05:30
= gl_badge_tag s_('DelayedJobs|delayed'), variant: :info, size: :sm
2018-12-05 23:21:45 +05:30
- elsif job.action?
2022-01-26 12:08:38 +05:30
= gl_badge_tag _('manual'), variant: :info, size: :sm
2016-06-02 11:05:42 +05:30
2017-08-17 22:00:37 +05:30
- if pipeline_link
2016-09-29 09:46:39 +05:30
%td
2017-08-17 22:00:37 +05:30
= link_to pipeline_path(pipeline) do
%span.pipeline-id ##{pipeline.id}
%span by
- if pipeline.user
= user_avatar(user: pipeline.user, size: 20)
- else
2019-02-15 15:39:39 +05:30
%span.monospace API
2016-09-29 09:46:39 +05:30
- if admin
2016-06-02 11:05:42 +05:30
%td
2017-08-17 22:00:37 +05:30
- if job.project
2018-03-27 19:54:05 +05:30
= link_to job.project.full_name, admin_project_path(job.project)
2017-08-17 22:00:37 +05:30
%td
- if job.try(:runner)
= runner_link(job.runner)
2016-06-02 11:05:42 +05:30
- else
2019-03-02 22:35:43 +05:30
.light= _('none')
2016-06-02 11:05:42 +05:30
2016-09-29 09:46:39 +05:30
- if stage
2016-06-02 11:05:42 +05:30
%td
2017-08-17 22:00:37 +05:30
= job.stage
2016-06-02 11:05:42 +05:30
%td
2017-08-17 22:00:37 +05:30
- if job.duration
2016-08-24 12:49:21 +05:30
%p.duration
= custom_icon("icon_timer")
2017-08-17 22:00:37 +05:30
= duration_in_numbers(job.duration)
2016-09-29 09:46:39 +05:30
2017-08-17 22:00:37 +05:30
- if job.finished_at
2016-08-24 12:49:21 +05:30
%p.finished-at
2021-01-03 14:25:43 +05:30
= sprite_icon("calendar")
2017-08-17 22:00:37 +05:30
%span= time_ago_with_tooltip(job.finished_at)
2016-06-02 11:05:42 +05:30
2016-09-29 09:46:39 +05:30
%td.coverage
2017-08-17 22:00:37 +05:30
- if job.try(:coverage)
#{job.coverage}%
2016-06-02 11:05:42 +05:30
%td
2021-09-04 01:27:46 +05:30
.gl-text-right
2021-03-11 19:13:27 +05:30
.btn-group
- if can?(current_user, :read_job_artifacts, job) && job.artifacts?
= link_to download_project_job_artifacts_path(job.project, job), rel: 'nofollow', download: '', title: _('Download artifacts'), class: 'gl-button btn btn-default btn-icon' do
= sprite_icon('download', css_class: 'gl-icon')
- if can?(current_user, :update_build, job)
- if job.active?
= link_to cancel_project_job_path(job.project, job, continue: { to: request.fullpath }), method: :post, title: _('Cancel'), class: 'gl-button btn btn-default btn-icon' do
2021-10-27 15:23:28 +05:30
= sprite_icon('cancel', css_class: 'gl-icon')
2021-03-11 19:13:27 +05:30
- elsif job.scheduled?
.gl-button.btn.btn-default.btn-icon.disabled{ disabled: true }
= sprite_icon('planning', css_class: 'gl-icon')
2018-12-13 13:39:08 +05:30
%time.js-remaining-time{ datetime: job.scheduled_at.utc.iso8601 }
= duration_in_numbers(job.execute_in)
2018-12-05 23:21:45 +05:30
- confirmation_message = s_("DelayedJobs|Are you sure you want to run %{job_name} immediately? This job will run automatically after it's timer finishes.") % { job_name: job.name }
= link_to play_project_job_path(job.project, job, return_to: request.original_url),
method: :post,
title: s_('DelayedJobs|Start now'),
2021-03-11 19:13:27 +05:30
class: 'gl-button btn btn-default btn-icon has-tooltip',
2018-12-05 23:21:45 +05:30
data: { confirm: confirmation_message } do
2021-03-11 19:13:27 +05:30
= sprite_icon('play', css_class: 'gl-icon')
2018-12-05 23:21:45 +05:30
= link_to unschedule_project_job_path(job.project, job, return_to: request.original_url),
method: :post,
title: s_('DelayedJobs|Unschedule'),
2021-03-11 19:13:27 +05:30
class: 'gl-button btn btn-default btn-icon has-tooltip' do
= sprite_icon('time-out', css_class: 'gl-icon')
- elsif allow_retry
- if job.playable? && !admin && can?(current_user, :update_build, job)
= link_to play_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: _('Play'), class: 'gl-button btn btn-default btn-icon' do
= sprite_icon('play', css_class: 'gl-icon')
- elsif job.retryable?
= link_to retry_project_job_path(job.project, job, return_to: request.original_url), method: :post, title: _('Retry'), class: 'gl-button btn btn-default btn-icon' do
= sprite_icon('repeat', css_class: 'gl-icon')