Skip to content
Snippets Groups Projects
Commit 5ff3c2de authored by Douwe Maan's avatar Douwe Maan
Browse files

Allow all failed commit builds to be retried.

parent b3d380ec
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -39,6 +39,16 @@ class Projects::CommitController < Projects::ApplicationController
redirect_to ci_namespace_project_commit_path(project.namespace, project, commit.sha)
end
 
def retry_builds
@ci_commit = @project.ci_commit(@commit.sha)
@ci_commit.builds.latest.failed.each do |build|
if build.retryable?
Ci::Build.retry(build)
end
end
redirect_to ci_namespace_project_commit_path(project.namespace, project, commit.sha)
end
 
def branches
@branches = @project.repository.branch_names_contains(commit.id)
Loading
Loading
Loading
Loading
@@ -26,6 +26,9 @@
&nbsp;
 
- if @ci_project && current_user && can?(current_user, :manage_builds, @project)
- if @ci_commit.builds.latest.failed.any?(&:retryable?)
= link_to "Retry failed", retry_ci_namespace_project_commit_path(@project.namespace, @project, @commit.sha), class: 'btn btn-xs btn-primary', method: :post
- if @ci_commit.builds.running_or_pending.any?
= link_to "Cancel all", cancel_builds_namespace_project_commit_path(@project.namespace, @project, @commit.sha), class: 'btn btn-xs btn-danger'
 
Loading
Loading
Loading
Loading
@@ -475,6 +475,7 @@ Gitlab::Application.routes.draw do
get :branches
get :ci
get :cancel_builds
post :retry_builds
end
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment