summaryrefslogtreecommitdiff
path: root/app/views/projects
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-04-13 13:01:08 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-04-13 13:01:08 +0200
commitf5d24e60f842096f670593fb4dd0d29c3f5d4fcc (patch)
tree36b7efa37b742c10be518d872bd2501b48d17af9 /app/views/projects
parent406a796f76824e18f4dca2d29c41dcc3d2e4d457 (diff)
downloadgitlab-ce-f5d24e60f842096f670593fb4dd0d29c3f5d4fcc.tar.gz
Pipeline view
Diffstat (limited to 'app/views/projects')
-rw-r--r--app/views/projects/ci/builds/_build.html.haml4
-rw-r--r--app/views/projects/ci/commits/_commit.html.haml41
-rw-r--r--app/views/projects/commit/_ci_commit.html.haml30
-rw-r--r--app/views/projects/pipelines/index.html.haml33
-rw-r--r--app/views/projects/pipelines/show.html.haml3
5 files changed, 50 insertions, 61 deletions
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index 218d396b898..7ded4828b2f 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -13,7 +13,9 @@
%strong ##{build.id}
- if build.stuck?
- %i.fa.fa-warning.text-warning
+ %i.fa.fa-warning.text-warning.has-tooltip(title="Build is stuck. Check runners.")
+ - if defined?(retried) && retried
+ %i.fa.fa-warning.has-tooltip(title="Build was retried")
- if defined?(commit_sha) && commit_sha
%td
diff --git a/app/views/projects/ci/commits/_commit.html.haml b/app/views/projects/ci/commits/_commit.html.haml
index 7c6ba216386..32f85cb8f8c 100644
--- a/app/views/projects/ci/commits/_commit.html.haml
+++ b/app/views/projects/ci/commits/_commit.html.haml
@@ -1,19 +1,21 @@
- status = commit.status
%tr.commit
%td.commit-link
- = link_to namespace_project_commit_path(@project.namespace, @project, commit.sha), class: "ci-status ci-#{status}" do
+ = link_to namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: "ci-status ci-#{status}" do
= ci_icon_for_status(status)
%strong ##{commit.id}
%td
- %div
+ %div.branch-commit
- if commit.ref
- = link_to commit.ref, namespace_project_commits_path(@project.namespace, @project, commit.ref)
+ = link_to commit.ref, namespace_project_commits_path(@project.namespace, @project, commit.ref), class: "monospace"
+ &middot;
+ = link_to commit.short_sha, namespace_project_commit_path(@project.namespace, @project, commit.sha), class: "commit-id monospace"
&nbsp;
+ - if commit.latest?
+ %span.label.label-success latest
- if commit.tag?
%span.label.label-primary tag
- - if commit.branch?
- %span.label.label-primary branch
- if commit.triggered?
%span.label.label-primary triggered
- if commit.yaml_errors.present?
@@ -21,32 +23,36 @@
- if commit.builds.any?(&:stuck?)
%span.label.label-warning stuck
- - if commit_data = commit.commit_data
- = render 'projects/branches/commit', commit: commit_data, project: @project
- - else
- %p
- Cant find HEAD commit for this branch
+ %p
+ %span
+ - if commit_data = commit.commit_data
+ = link_to_gfm commit_data.title, namespace_project_commit_path(@project.namespace, @project, commit_data.id), class: "commit-row-message"
+ - else
+ Cant find HEAD commit for this branch
+
- stages_status = commit.statuses.stages_status
- stages.each do |stage|
%td
- if status = stages_status[stage]
- %span.has-tooltip(title="#{status}"){class: "ci-status-icon-#{status}"}
+ %span.has-tooltip(title="#{stage.titleize}: #{status}"){class: "ci-status-icon-#{status}"}
= ci_icon_for_status(status)
%td
- if commit.started_at && commit.finished_at
%p
- %i.fa.fa-late-o
+ %i.fa.fa-clock-o
+ &nbsp;
#{duration_in_words(commit.finished_at, commit.started_at)}
- if commit.finished_at
%p
- %i.fa.fa-date-o
+ %i.fa.fa-calendar
+ &nbsp;
#{time_ago_with_tooltip(commit.finished_at)}
- %td.content
+ %td
.controls.hidden-xs.pull-right
- - artifacts = commit.builds.latest.select { |status| status.artifacts? }
+ - artifacts = commit.builds.latest
- if artifacts.present?
.dropdown.inline
%button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'}
@@ -58,15 +64,12 @@
= link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, build), rel: 'nofollow' do
%i.fa.fa-download
%span #{build.name}
- &nbsp;
- if can?(current_user, :update_pipeline, @project)
- - if commit.retryable?
+ - if commit.retryable? && commit.builds.failed.any?
= link_to retry_namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: 'btn has-tooltip', title: "Retry", method: :post do
= icon("repeat")
-
&nbsp;
-
- if commit.active?
= link_to cancel_namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: 'btn btn-remove has-tooltip', title: "Cancel", method: :post do
= icon("remove cred")
diff --git a/app/views/projects/commit/_ci_commit.html.haml b/app/views/projects/commit/_ci_commit.html.haml
index 06520e40bd9..582ce61a64a 100644
--- a/app/views/projects/commit/_ci_commit.html.haml
+++ b/app/views/projects/commit/_ci_commit.html.haml
@@ -2,12 +2,15 @@
.pull-right
- if can?(current_user, :update_build, @project)
- if ci_commit.builds.latest.failed.any?(&:retryable?)
- = link_to "Retry failed", retry_builds_namespace_project_commit_path(@project.namespace, @project, @commit.id), class: 'btn btn-grouped btn-primary', method: :post
+ = link_to "Retry failed", retry_namespace_project_pipeline_path(@project.namespace, @project, ci_commit.id), class: 'btn btn-grouped btn-primary', method: :post
- if ci_commit.builds.running_or_pending.any?
- = link_to "Cancel running", cancel_builds_namespace_project_commit_path(@project.namespace, @project, @commit.id), data: { confirm: 'Are you sure?' }, class: 'btn btn-grouped btn-danger', method: :post
+ = link_to "Cancel running", cancel_namespace_project_pipeline_path(@project.namespace, @project, ci_commit.id), data: { confirm: 'Are you sure?' }, class: 'btn btn-grouped btn-danger', method: :post
.oneline
+ Pipeline
+ = link_to "##{ci_commit.id}", namespace_project_pipeline_path(@project.namespace, @project, ci_commit.id), class: "monospace"
+ with
= pluralize ci_commit.statuses.count(:id), "build"
- if ci_commit.ref
for
@@ -17,7 +20,7 @@
for commit
= link_to @commit.short_id, namespace_project_commit_path(@project.namespace, @project, @commit.id), class: "monospace"
- if ci_commit.duration > 0
- in
+ took
= time_interval_in_words ci_commit.duration
- if ci_commit.yaml_errors.present?
@@ -47,23 +50,4 @@
%th
- builds = ci_commit.statuses.latest.ordered
= render builds, coverage: @project.build_coverage_enabled?, stage: true, ref: false, allow_retry: true
-
-- if ci_commit.retried.any?
- .gray-content-block.second-block
- Retried builds
-
- .table-holder
- %table.table.builds
- %thead
- %tr
- %th Status
- %th Build ID
- %th Ref
- %th Stage
- %th Name
- %th Duration
- %th Finished at
- - if @project.build_coverage_enabled?
- %th Coverage
- %th
- = render ci_commit.retried, coverage: @project.build_coverage_enabled?, stage: true, ref: false
+ = render ci_commit.retried, coverage: @project.build_coverage_enabled?, stage: true, ref: false, retried: true
diff --git a/app/views/projects/pipelines/index.html.haml b/app/views/projects/pipelines/index.html.haml
index b9877cd37be..838b2986d4f 100644
--- a/app/views/projects/pipelines/index.html.haml
+++ b/app/views/projects/pipelines/index.html.haml
@@ -7,25 +7,21 @@
= link_to project_pipelines_path(@project) do
All
%span.badge.js-totalbuilds-count
- = number_with_delimiter(@all_commits.count(:id))
+ = number_with_delimiter(@all_pipelines.count)
+
+ %li{class: ('active' if @scope == 'running')}
+ = link_to project_pipelines_path(@project, scope: :running) do
+ Running
+ %span.badge.js-running-count
+ = number_with_delimiter(@all_pipelines.running_or_pending.count)
%li{class: ('active' if @scope == 'branches')}
= link_to project_pipelines_path(@project, scope: :branches) do
Branches
- %span.badge.js-running-count
- = number_with_delimiter(@all_commits.running_or_pending.count(:id))
%li{class: ('active' if @scope == 'tags')}
= link_to project_pipelines_path(@project, scope: :tags) do
Tags
- %span.badge.js-running-count
- = number_with_delimiter(@all_commits.running_or_pending.count(:id))
-
- %li{class: ('active' if @scope == 'running')}
- = link_to project_pipelines_path(@project, scope: :running) do
- Failed
- %span.badge.js-running-count
- = number_with_delimiter(@all_commits.running_or_pending.count(:id))
.nav-controls
- if can? current_user, :create_pipeline, @project
@@ -45,8 +41,8 @@
Pipelines for #{(@scope || 'changes')} on this project
%ul.content-list
- - stages = @commits.stages
- - if @commits.blank?
+ - stages = @pipelines.stages
+ - if @pipelines.blank?
%li
.nothing-here-block No pipelines to show
- else
@@ -55,11 +51,12 @@
%tbody
%th Pipeline ID
%th Commit
- - @commits.stages.each do |stage|
- %th.rotate
- = stage.titleize
+ - @pipelines.stages.each do |stage|
+ %th
+ %span.has-tooltip(title="#{stage.titleize}")
+ = truncate(stage.titleize.pluralize, length: 8)
%th
%th
- = render @commits, commit_sha: true, stage: true, allow_retry: true, stages: stages
+ = render @pipelines, commit_sha: true, stage: true, allow_retry: true, stages: stages
- = paginate @commits, theme: 'gitlab'
+ = paginate @pipelines, theme: 'gitlab'
diff --git a/app/views/projects/pipelines/show.html.haml b/app/views/projects/pipelines/show.html.haml
new file mode 100644
index 00000000000..9f33e2ad624
--- /dev/null
+++ b/app/views/projects/pipelines/show.html.haml
@@ -0,0 +1,3 @@
+- page_title "Pipeline"
+= render "header_title"
+= render "projects/commit/ci_commit", ci_commit: @pipeline