diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-14 13:04:10 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-14 13:04:10 +0200 |
commit | 3656a6edf37f9e24e6c080223cbfddff464e7962 (patch) | |
tree | d2bc1ffb2249fd64b65db6d1dd5e2e5110c9ed8f /app | |
parent | 7d9e8b04c025278e26904e061e8b0a005cd81ab0 (diff) | |
download | gitlab-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.rb | 2 | ||||
-rw-r--r-- | app/models/ci/pipeline.rb | 6 |
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? |