summaryrefslogtreecommitdiff
path: root/app/views/ci
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-10-02 13:46:38 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-10-05 09:52:35 +0200
commit546a3c6561fbe967cc37ccc3229b71893cd20c34 (patch)
tree0828ab3fb82e2b03921a8f4d1f745f430bae4bd6 /app/views/ci
parent0de7c83a78711601b40b5a739070da2e3af29b11 (diff)
downloadgitlab-ce-546a3c6561fbe967cc37ccc3229b71893cd20c34.tar.gz
Refactor commit and build
Diffstat (limited to 'app/views/ci')
-rw-r--r--app/views/ci/builds/_build.html.haml4
-rw-r--r--app/views/ci/builds/show.html.haml6
-rw-r--r--app/views/ci/commits/_commit.html.haml4
-rw-r--r--app/views/ci/commits/show.html.haml57
-rw-r--r--app/views/ci/notify/build_fail_email.html.haml2
-rw-r--r--app/views/ci/notify/build_fail_email.text.erb2
-rw-r--r--app/views/ci/notify/build_success_email.html.haml2
-rw-r--r--app/views/ci/notify/build_success_email.text.erb2
8 files changed, 41 insertions, 38 deletions
diff --git a/app/views/ci/builds/_build.html.haml b/app/views/ci/builds/_build.html.haml
index 515b862e992..8ccc0dff2fb 100644
--- a/app/views/ci/builds/_build.html.haml
+++ b/app/views/ci/builds/_build.html.haml
@@ -6,6 +6,10 @@
= link_to ci_project_build_path(build.project, build) do
%strong Build ##{build.id}
+ - if defined?(ref)
+ %td
+ = build.ref
+
%td
= build.stage
diff --git a/app/views/ci/builds/show.html.haml b/app/views/ci/builds/show.html.haml
index 839dbf5c554..f941143e2e0 100644
--- a/app/views/ci/builds/show.html.haml
+++ b/app/views/ci/builds/show.html.haml
@@ -1,7 +1,7 @@
#up-build-trace
-- if @commit.matrix?
+- if @commit.matrix_for_ref?(@build.ref)
%ul.center-top-menu
- - @commit.builds_without_retry_sorted.each do |build|
+ - @commit.builds_without_retry.for_ref(build.ref).each do |build|
%li{class: ('active' if build == @build) }
= link_to ci_project_build_url(@project, build) do
= ci_icon_for_status(build.status)
@@ -12,7 +12,7 @@
= build.id
- - unless @commit.builds_without_retry.include?(@build)
+ - unless @commit.builds_without_retry.for_ref(@build.ref).include?(@build)
%li.active
%a
Build ##{@build.id}
diff --git a/app/views/ci/commits/_commit.html.haml b/app/views/ci/commits/_commit.html.haml
index 1eacfca944f..f8a1fa50851 100644
--- a/app/views/ci/commits/_commit.html.haml
+++ b/app/views/ci/commits/_commit.html.haml
@@ -7,7 +7,7 @@
%td.build-link
- = link_to ci_project_ref_commits_path(commit.project, commit.ref, commit.sha) do
+ = link_to ci_project_commits_path(commit.project, commit.sha) do
%strong #{commit.short_sha}
%td.build-message
@@ -16,7 +16,7 @@
%td.build-branch
- unless @ref
%span
- = link_to truncate(commit.ref, length: 25), ci_project_path(@project, ref: commit.ref)
+ = link_to truncate(commit.last_ref, length: 25), ci_project_path(@project, ref: commit.last_ref)
%td.duration
- if commit.duration > 0
diff --git a/app/views/ci/commits/show.html.haml b/app/views/ci/commits/show.html.haml
index 8f38aa84676..4badb671287 100644
--- a/app/views/ci/commits/show.html.haml
+++ b/app/views/ci/commits/show.html.haml
@@ -17,14 +17,11 @@
%p
%span.attr-name Commit:
#{gitlab_commit_link(@project, @commit.sha)}
-
- %p
- %span.attr-name Branch:
- #{gitlab_ref_link(@project, @commit.ref)}
.col-sm-6
- %p
- %span.attr-name Author:
- #{@commit.git_author_name} (#{@commit.git_author_email})
+ - if @commit.git_author_name || @commit.git_author_email
+ %p
+ %span.attr-name Author:
+ #{@commit.git_author_name} (#{@commit.git_author_email})
- if @commit.created_at
%p
%span.attr-name Created at:
@@ -33,7 +30,7 @@
- if current_user && can?(current_user, :manage_builds, gl_project)
.pull-right
- if @commit.builds.running_or_pending.any?
- = link_to "Cancel", cancel_ci_project_ref_commits_path(@project, @commit.ref, @commit.sha), class: 'btn btn-sm btn-danger'
+ = link_to "Cancel", cancel_ci_project_commits_path(@project, @commit), class: 'btn btn-sm btn-danger'
- if @commit.yaml_errors.present?
@@ -43,30 +40,31 @@
- @commit.yaml_errors.split(",").each do |error|
%li= error
-- unless @commit.push_data[:ci_yaml_file]
+- unless @commit.ci_yaml_file
.bs-callout.bs-callout-warning
\.gitlab-ci.yml not found in this commit
-%h3
- Builds
- - if @commit.duration > 0
- %small.pull-right
- %i.fa.fa-time
- #{time_interval_in_words @commit.duration}
+- @commit.refs.each do |ref|
+ %h3
+ Builds for #{ref}
+ - if @commit.duration_for_ref(ref) > 0
+ %small.pull-right
+ %i.fa.fa-time
+ #{time_interval_in_words @commit.duration_for_ref(ref)}
-%table.table.builds
- %thead
- %tr
- %th Status
- %th Build ID
- %th Stage
- %th Name
- %th Duration
- %th Finished at
- - if @project.coverage_enabled?
- %th Coverage
- %th
- = render @commit.builds_without_retry_sorted, controls: true
+ %table.table.builds
+ %thead
+ %tr
+ %th Status
+ %th Build ID
+ %th Stage
+ %th Name
+ %th Duration
+ %th Finished at
+ - if @project.coverage_enabled?
+ %th Coverage
+ %th
+ = render @commit.builds_without_retry.for_ref(ref), controls: true
- if @commit.retried_builds.any?
%h3
@@ -77,6 +75,7 @@
%tr
%th Status
%th Build ID
+ %th Ref
%th Stage
%th Name
%th Duration
@@ -84,4 +83,4 @@
- if @project.coverage_enabled?
%th Coverage
%th
- = render @commit.retried_builds
+ = render @commit.retried_builds, ref: true
diff --git a/app/views/ci/notify/build_fail_email.html.haml b/app/views/ci/notify/build_fail_email.html.haml
index d818e8b6756..4ebdfa1b6c0 100644
--- a/app/views/ci/notify/build_fail_email.html.haml
+++ b/app/views/ci/notify/build_fail_email.html.haml
@@ -11,7 +11,7 @@
%p
Author: #{@build.commit.git_author_name}
%p
- Branch: #{@build.commit.ref}
+ Branch: #{@build.ref}
%p
Message: #{@build.commit.git_commit_message}
diff --git a/app/views/ci/notify/build_fail_email.text.erb b/app/views/ci/notify/build_fail_email.text.erb
index 1add215a1c8..177827f9a3c 100644
--- a/app/views/ci/notify/build_fail_email.text.erb
+++ b/app/views/ci/notify/build_fail_email.text.erb
@@ -3,7 +3,7 @@ Build failed for <%= @project.name %>
Status: <%= @build.status %>
Commit: <%= @build.commit.short_sha %>
Author: <%= @build.commit.git_author_name %>
-Branch: <%= @build.commit.ref %>
+Branch: <%= @build.ref %>
Message: <%= @build.commit.git_commit_message %>
Url: <%= ci_project_build_url(@build.project, @build) %>
diff --git a/app/views/ci/notify/build_success_email.html.haml b/app/views/ci/notify/build_success_email.html.haml
index a20dcaee24e..7cc43300e88 100644
--- a/app/views/ci/notify/build_success_email.html.haml
+++ b/app/views/ci/notify/build_success_email.html.haml
@@ -12,7 +12,7 @@
%p
Author: #{@build.commit.git_author_name}
%p
- Branch: #{@build.commit.ref}
+ Branch: #{@build.ref}
%p
Message: #{@build.commit.git_commit_message}
diff --git a/app/views/ci/notify/build_success_email.text.erb b/app/views/ci/notify/build_success_email.text.erb
index 7ebd17e7270..4d55c39b0fb 100644
--- a/app/views/ci/notify/build_success_email.text.erb
+++ b/app/views/ci/notify/build_success_email.text.erb
@@ -3,7 +3,7 @@ Build successful for <%= @project.name %>
Status: <%= @build.status %>
Commit: <%= @build.commit.short_sha %>
Author: <%= @build.commit.git_author_name %>
-Branch: <%= @build.commit.ref %>
+Branch: <%= @build.ref %>
Message: <%= @build.commit.git_commit_message %>
Url: <%= ci_project_build_url(@build.project, @build) %>