Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-06-01 17:21:03 +0300
committerDouwe Maan <douwe@gitlab.com>2016-06-01 17:21:03 +0300
commitef6fe42ec05d40935154d2bb22a44fdb7d1eac8e (patch)
tree5cd5193484c3bb42e41b97831d9277381d1f3943 /app
parent4581e71c44c72d1e5e40e9ad00f3d136334ac931 (diff)
parent57992f3d03115e391322f53839f5121e7a740120 (diff)
Merge branch 'fix-cancelable-retryable' into 'master'
Fix cancelability and retriablity of pipeline with generic statuses Currently it's not possible to cancel or retry generic status since this is external thing to GitLab. This fixes shown actions of pipelines containing only these actions. See merge request !4380
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/commit.rb4
-rw-r--r--app/views/projects/ci/commits/_commit.html.haml4
2 files changed, 6 insertions, 2 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index 6675a3f5d53..f22b573a94c 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -66,6 +66,10 @@ module Ci
end
end
+ def cancelable?
+ builds.running_or_pending.any?
+ end
+
def cancel_running
builds.running_or_pending.each(&:cancel)
end
diff --git a/app/views/projects/ci/commits/_commit.html.haml b/app/views/projects/ci/commits/_commit.html.haml
index 5b6b940a0c4..5e3a4123a8e 100644
--- a/app/views/projects/ci/commits/_commit.html.haml
+++ b/app/views/projects/ci/commits/_commit.html.haml
@@ -63,9 +63,9 @@
%span #{build.name}
- if can?(current_user, :update_pipeline, @project)
- - if commit.retryable? && commit.builds.failed.any?
+ - if commit.retryable?
= link_to retry_namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: 'btn has-tooltip', title: "Retry", method: :post do
= icon("repeat")
- - if commit.active?
+ - if commit.cancelable?
= 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")