mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-20 10:06:04 +10:00
This MR simplifies CI permission model: - read_build: allows to read a list of builds, artifacts and trace - update_build: allows to cancel and retry builds - create_build: allows to create builds from gitlab-ci.yml (not yet implemented) - admin_build: allows to manage triggers, runners and variables - read_commit_status: allows to read a list of commit statuses (including the overall of builds) - create_commit_status: allows to create a new commit status using API Remove all extra methods to manage permission. Made all controllers to use explicitly the new permissions.
80 lines
2.6 KiB
Plaintext
80 lines
2.6 KiB
Plaintext
%tr.commit_status
|
|
%td.status
|
|
- if commit_status.target_url
|
|
= link_to commit_status.target_url, class: "ci-status ci-#{commit_status.status}" do
|
|
= ci_icon_for_status(commit_status.status)
|
|
= commit_status.status
|
|
- else
|
|
= ci_status_with_icon(commit_status.status)
|
|
|
|
%td.commit_status-link
|
|
- if can?(current_user, :read_build, commit_status.project) && commit_status.target_url
|
|
= link_to commit_status.target_url do
|
|
%strong ##{commit_status.id}
|
|
- else
|
|
%strong ##{commit_status.id}
|
|
|
|
- if commit_status.show_warning?
|
|
%i.fa.fa-warning.text-warning
|
|
|
|
- if defined?(commit_sha) && commit_sha
|
|
%td
|
|
= link_to commit_status.short_sha, namespace_project_commit_path(commit_status.project.namespace, commit_status.project, commit_status.sha), class: "monospace"
|
|
|
|
%td
|
|
- if commit_status.ref
|
|
= link_to commit_status.ref, namespace_project_commits_path(commit_status.project.namespace, commit_status.project, commit_status.ref)
|
|
- else
|
|
.light none
|
|
|
|
- if defined?(runner) && runner
|
|
%td
|
|
- if commit_status.try(:runner)
|
|
= runner_link(commit_status.runner)
|
|
- else
|
|
.light none
|
|
|
|
- if defined?(stage) && stage
|
|
%td
|
|
= commit_status.stage
|
|
|
|
%td
|
|
= commit_status.name
|
|
|
|
.pull-right
|
|
- if commit_status.tags.any?
|
|
- commit_status.tags.each do |tag|
|
|
%span.label.label-primary
|
|
= tag
|
|
- if commit_status.try(:trigger_request)
|
|
%span.label.label-info triggered
|
|
- if commit_status.try(:allow_failure)
|
|
%span.label.label-danger allowed to fail
|
|
|
|
%td.duration
|
|
- if commit_status.duration
|
|
#{duration_in_words(commit_status.finished_at, commit_status.started_at)}
|
|
|
|
%td.timestamp
|
|
- if commit_status.finished_at
|
|
%span #{time_ago_with_tooltip(commit_status.finished_at)}
|
|
|
|
- if defined?(coverage) && coverage
|
|
%td.coverage
|
|
- if commit_status.try(:coverage)
|
|
#{commit_status.coverage}%
|
|
|
|
%td
|
|
.pull-right
|
|
- if can?(current_user, :read_build, commit_status.project) && commit_status.artifacts_download_url
|
|
= link_to commit_status.artifacts_download_url, title: 'Download artifacts' do
|
|
%i.fa.fa-download
|
|
- if can?(current_user, :update_build, commit_status.project)
|
|
- if commit_status.active?
|
|
- if commit_status.cancel_url
|
|
= link_to commit_status.cancel_url, method: :post, title: 'Cancel' do
|
|
%i.fa.fa-remove.cred
|
|
- elsif defined?(allow_retry) && allow_retry && commit_status.retry_url
|
|
= link_to commit_status.retry_url, method: :post, title: 'Retry' do
|
|
%i.fa.fa-repeat
|