From 5028f5d73d8fa69f72ac8d2b1cc493d82cf6f3e4 Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Wed, 15 May 2019 16:17:25 +0200 Subject: Add auto_cancel_pending_pipelines to project API --- lib/api/entities.rb | 1 + lib/api/helpers/projects_helpers.rb | 2 ++ 2 files changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 3eb2d19c624..c6c7023042f 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -279,6 +279,7 @@ module API project.build_allow_git_fetch ? 'fetch' : 'clone' end expose :build_timeout + expose :auto_cancel_pending_pipelines expose :build_coverage_regex expose :ci_config_path, if: -> (project, options) { Ability.allowed?(options[:current_user], :download_code, project) } expose :shared_with_groups do |project, options| diff --git a/lib/api/helpers/projects_helpers.rb b/lib/api/helpers/projects_helpers.rb index 956158b39a6..390c694e21b 100644 --- a/lib/api/helpers/projects_helpers.rb +++ b/lib/api/helpers/projects_helpers.rb @@ -10,6 +10,7 @@ module API optional :description, type: String, desc: 'The description of the project' optional :build_git_strategy, type: String, values: %w(fetch clone), desc: 'The Git strategy. Defaults to `fetch`' optional :build_timeout, type: Integer, desc: 'Build timeout' + optional :auto_cancel_pending_pipelines, type: String, values: %w(disabled enabled), desc: 'Auto-cancel pending pipelines' optional :build_coverage_regex, type: String, desc: 'Test coverage parsing' optional :ci_config_path, type: String, desc: 'The path to CI config file. Defaults to `.gitlab-ci.yml`' @@ -61,6 +62,7 @@ module API def self.update_params_at_least_one_of [ + :auto_cancel_pending_pipelines, :build_coverage_regex, :build_git_strategy, :build_timeout, -- cgit v1.2.1