summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-14 13:04:10 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-14 13:04:10 +0200
commit3656a6edf37f9e24e6c080223cbfddff464e7962 (patch)
treed2bc1ffb2249fd64b65db6d1dd5e2e5110c9ed8f /app
parent7d9e8b04c025278e26904e061e8b0a005cd81ab0 (diff)
downloadgitlab-ce-3656a6edf37f9e24e6c080223cbfddff464e7962.tar.gz
Make retry action on pipeline to save a user
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/pipelines_controller.rb2
-rw-r--r--app/models/ci/pipeline.rb6
2 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index cac440ae53e..127bd1a4318 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -32,7 +32,7 @@ class Projects::PipelinesController < Projects::ApplicationController
end
def retry
- pipeline.retry_failed
+ pipeline.retry_failed(current_user)
redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project)
end
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 85d9e0856d1..4bbfb4cc806 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -76,8 +76,10 @@ module Ci
builds.running_or_pending.each(&:cancel)
end
- def retry_failed
- builds.latest.failed.select(&:retryable?).each(&:retry)
+ def retry_failed(user)
+ builds.latest.failed.select(&:retryable?).each do |build|
+ Ci::Build.retry(build, user)
+ end
end
def latest?