From 26b7b475586b67c9e9aee7ec7311cca712901dbc Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Wed, 15 May 2019 13:19:16 +0200 Subject: Add *_access_level to project API - issues_access_level - repository_access_level - merge_requests_access_level - builds_access_level - wiki_access_level - snippets_access_level --- lib/api/helpers/projects_helpers.rb | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'lib/api/helpers/projects_helpers.rb') diff --git a/lib/api/helpers/projects_helpers.rb b/lib/api/helpers/projects_helpers.rb index f242f1fea0e..36d93d9457f 100644 --- a/lib/api/helpers/projects_helpers.rb +++ b/lib/api/helpers/projects_helpers.rb @@ -9,11 +9,21 @@ module API params :optional_project_params_ce do optional :description, type: String, desc: 'The description of the project' optional :ci_config_path, type: String, desc: 'The path to CI config file. Defaults to `.gitlab-ci.yml`' + + # TODO: remove in API v5, replaced by *_access_level optional :issues_enabled, type: Boolean, desc: 'Flag indication if the issue tracker is enabled' optional :merge_requests_enabled, type: Boolean, desc: 'Flag indication if merge requests are enabled' optional :wiki_enabled, type: Boolean, desc: 'Flag indication if the wiki is enabled' optional :jobs_enabled, type: Boolean, desc: 'Flag indication if jobs are enabled' optional :snippets_enabled, type: Boolean, desc: 'Flag indication if snippets are enabled' + + optional :issues_access_level, type: String, values: %w(disabled private enabled), desc: 'Issues access level. One of `disabled`, `private` or `enabled`' + optional :repository_access_level, type: String, values: %w(disabled private enabled), desc: 'Repository access level. One of `disabled`, `private` or `enabled`' + optional :merge_requests_access_level, type: String, values: %w(disabled private enabled), desc: 'Merge requests access level. One of `disabled`, `private` or `enabled`' + optional :wiki_access_level, type: String, values: %w(disabled private enabled), desc: 'Wiki access level. One of `disabled`, `private` or `enabled`' + optional :builds_access_level, type: String, values: %w(disabled private enabled), desc: 'Builds access level. One of `disabled`, `private` or `enabled`' + optional :snippets_access_level, type: String, values: %w(disabled private enabled), desc: 'Snippets access level. One of `disabled`, `private` or `enabled`' + optional :shared_runners_enabled, type: Boolean, desc: 'Flag indication if shared runners are enabled for that project' optional :resolve_outdated_diff_discussions, type: Boolean, desc: 'Automatically resolve merge request diffs discussions on lines changed with a push' optional :container_registry_enabled, type: Boolean, desc: 'Flag indication if the container registry is enabled for that project' @@ -48,15 +58,14 @@ module API def self.update_params_at_least_one_of [ - :jobs_enabled, - :resolve_outdated_diff_discussions, + :builds_access_level, :ci_config_path, :container_registry_enabled, :default_branch, :description, - :issues_enabled, + :issues_access_level, :lfs_enabled, - :merge_requests_enabled, + :merge_requests_access_level, :merge_method, :name, :only_allow_merge_if_all_discussions_are_resolved, @@ -64,14 +73,24 @@ module API :path, :printing_merge_request_link_enabled, :public_builds, + :repository_access_level, :request_access_enabled, + :resolve_outdated_diff_discussions, :shared_runners_enabled, - :snippets_enabled, + :snippets_access_level, :tag_list, :visibility, - :wiki_enabled, + :wiki_access_level, :avatar, - :external_authorization_classification_label + :external_authorization_classification_label, + + # TODO: remove in API v5, replaced by *_access_level + :issues_enabled, + :jobs_enabled, + :merge_requests_enabled, + :wiki_enabled, + :jobs_enabled, + :snippets_enabled ] end end -- cgit v1.2.1 From 353e68772c8b57ef4a98be094f2674d28a2dedcd Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Wed, 15 May 2019 14:35:55 +0200 Subject: Add build_git_strategy attribute to project API We map the boolean to the string 'fetch' or 'clone', to be more explicit. --- lib/api/helpers/projects_helpers.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/api/helpers/projects_helpers.rb') diff --git a/lib/api/helpers/projects_helpers.rb b/lib/api/helpers/projects_helpers.rb index 36d93d9457f..bc847968c25 100644 --- a/lib/api/helpers/projects_helpers.rb +++ b/lib/api/helpers/projects_helpers.rb @@ -8,6 +8,7 @@ module API params :optional_project_params_ce do 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 :ci_config_path, type: String, desc: 'The path to CI config file. Defaults to `.gitlab-ci.yml`' # TODO: remove in API v5, replaced by *_access_level @@ -58,6 +59,7 @@ module API def self.update_params_at_least_one_of [ + :build_git_strategy, :builds_access_level, :ci_config_path, :container_registry_enabled, -- cgit v1.2.1 From a7892e71714ad0f425547db12f205771dc270da5 Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Wed, 15 May 2019 15:32:18 +0200 Subject: Add build_timeout to project API --- lib/api/helpers/projects_helpers.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/api/helpers/projects_helpers.rb') diff --git a/lib/api/helpers/projects_helpers.rb b/lib/api/helpers/projects_helpers.rb index bc847968c25..7a806839856 100644 --- a/lib/api/helpers/projects_helpers.rb +++ b/lib/api/helpers/projects_helpers.rb @@ -9,6 +9,7 @@ module API params :optional_project_params_ce do 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 :ci_config_path, type: String, desc: 'The path to CI config file. Defaults to `.gitlab-ci.yml`' # TODO: remove in API v5, replaced by *_access_level @@ -60,6 +61,7 @@ module API def self.update_params_at_least_one_of [ :build_git_strategy, + :build_timeout, :builds_access_level, :ci_config_path, :container_registry_enabled, -- cgit v1.2.1 From 5f04d24934770e9aa366aac1400a302232eefd89 Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Wed, 15 May 2019 15:36:17 +0200 Subject: Add build_coverage_regex to project API --- lib/api/helpers/projects_helpers.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/api/helpers/projects_helpers.rb') diff --git a/lib/api/helpers/projects_helpers.rb b/lib/api/helpers/projects_helpers.rb index 7a806839856..956158b39a6 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 :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`' # TODO: remove in API v5, replaced by *_access_level @@ -60,6 +61,7 @@ module API def self.update_params_at_least_one_of [ + :build_coverage_regex, :build_git_strategy, :build_timeout, :builds_access_level, -- cgit v1.2.1 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/helpers/projects_helpers.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/api/helpers/projects_helpers.rb') 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 From e44167004dd44cf727829d0fc9df59fe3404bb49 Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Wed, 15 May 2019 16:27:54 +0200 Subject: Add auto_devops_* to project API The auto_devops object sometimes doesn't exists. We may need to create it. --- lib/api/helpers/projects_helpers.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/api/helpers/projects_helpers.rb') diff --git a/lib/api/helpers/projects_helpers.rb b/lib/api/helpers/projects_helpers.rb index 390c694e21b..0e21a7a66fd 100644 --- a/lib/api/helpers/projects_helpers.rb +++ b/lib/api/helpers/projects_helpers.rb @@ -44,6 +44,8 @@ module API optional :initialize_with_readme, type: Boolean, desc: "Initialize a project with a README.md" optional :external_authorization_classification_label, type: String, desc: 'The classification label for the project' optional :ci_default_git_depth, type: Integer, desc: 'Default number of revisions for shallow cloning' + optional :auto_devops_enabled, type: Boolean, desc: 'Flag indication if Auto DevOps is enabled' + optional :auto_devops_deploy_strategy, type: String, values: %w(continuous manual timed_incremental), desc: 'Auto Deploy strategy' end params :optional_project_params_ee do @@ -62,6 +64,8 @@ module API def self.update_params_at_least_one_of [ + :auto_devops_enabled, + :auto_devops_deploy_strategy, :auto_cancel_pending_pipelines, :build_coverage_regex, :build_git_strategy, -- cgit v1.2.1