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

Use POST rather than GET for canceling and retrying builds.

parent d6d4c2ef
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -6,7 +6,7 @@
- if @ci_project && current_user && can?(current_user, :manage_builds, @project)
.pull-left.hidden-xs
- if @all_builds.running_or_pending.any?
= link_to 'Cancel all', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger'
= link_to 'Cancel all', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
 
%ul.center-top-menu
%li{class: ('active' if @scope.nil?)}
Loading
Loading
Loading
Loading
@@ -93,10 +93,10 @@
Build
- if current_user && can?(current_user, :manage_builds, @project)
.pull-right
- if @build.active?
= link_to "Cancel", cancel_namespace_project_build_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-danger'
- elsif @build.commands.present?
= link_to "Retry", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'btn btn-sm btn-primary', method: :post
- if @build.cancel_url
= link_to "Cancel", @build.cancel_url, class: 'btn btn-sm btn-danger', method: :post
- elsif @build.retry_url
= link_to "Retry", @build.retry_url, class: 'btn btn-sm btn-primary', method: :post
 
- if @build.duration
%p
Loading
Loading
Loading
Loading
@@ -30,7 +30,7 @@
= 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'
= link_to "Cancel running", cancel_ci_namespace_project_commit_path(@project.namespace, @project, @commit.sha), class: 'btn btn-xs btn-danger', method: :post
 
%table.table.builds
%thead
Loading
Loading
Loading
Loading
@@ -59,9 +59,10 @@
%td
.pull-right
- if current_user && can?(current_user, :manage_builds, commit_status.gl_project)
- if commit_status.cancel_url
= link_to commit_status.cancel_url, title: 'Cancel' do
%i.fa.fa-remove.cred
- if commit_status.active?
- if commit_status.cancel_url
= link_to commit_status.cancel_url, method: :post, title: 'Cancel' do
%i.fa.fa-remove.cred
- elsif defined?(allow_retry) && allow_retry && commit_status.retry_url
= link_to commit_status.retry_url, method: :post, title: 'Retry' do
%i.fa.fa-repeat
Loading
Loading
@@ -474,7 +474,7 @@ Gitlab::Application.routes.draw do
member do
get :branches
get :ci
get :cancel_builds
post :cancel_builds
post :retry_builds
end
end
Loading
Loading
@@ -590,12 +590,12 @@ Gitlab::Application.routes.draw do
 
resources :builds, only: [:index, :show] do
collection do
get :cancel_all
post :cancel_all
end
 
member do
get :cancel
get :status
post :cancel
post :retry
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