diff options
Diffstat (limited to 'lib/api/ci/pipelines.rb')
-rw-r--r-- | lib/api/ci/pipelines.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/ci/pipelines.rb b/lib/api/ci/pipelines.rb index 6416de6d2a9..809a9bd781b 100644 --- a/lib/api/ci/pipelines.rb +++ b/lib/api/ci/pipelines.rb @@ -329,7 +329,8 @@ module API post ':id/pipelines/:pipeline_id/cancel', urgency: :low, feature_category: :continuous_integration do authorize! :update_pipeline, pipeline - pipeline.cancel_running + # TODO: inconsistent behavior: when pipeline is not cancelable we should return an error + ::Ci::CancelPipelineService.new(pipeline: pipeline, current_user: current_user).execute status 200 present pipeline.reset, with: Entities::Ci::Pipeline |