diff options
author | Fabio Pitino <fpitino@gitlab.com> | 2019-06-07 12:51:42 +0100 |
---|---|---|
committer | Fabio Pitino <fpitino@gitlab.com> | 2019-06-12 09:51:45 +0100 |
commit | 3ac527b4889b9465b2d55ca0c9317a3e8479a625 (patch) | |
tree | 2cf311b5a19d9c1d4a2f25922fa55ec2a29351ab /lib/api | |
parent | 641d332351907b77b53b0cb23ff51ccea2489824 (diff) | |
download | gitlab-ce-3ac527b4889b9465b2d55ca0c9317a3e8479a625.tar.gz |
Expose ci_default_git_depth via project APIexpose-project-git-depth-via-api
Enable Get and Update of ci_default_git_depth for
Project API.
Renaming Project#default_git_depth to :ci_default_git_depth
to give more context through the API usage.
Add API documentation
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/entities.rb | 2 | ||||
-rw-r--r-- | lib/api/helpers/projects_helpers.rb | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index f8b950cb55d..82aa8310a1c 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -265,6 +265,7 @@ module API expose :open_issues_count, if: lambda { |project, options| project.feature_available?(:issues, options[:current_user]) } expose :runners_token, if: lambda { |_project, options| options[:user_can_admin_project] } + expose :ci_default_git_depth expose :public_builds, as: :public_jobs expose :ci_config_path, if: -> (project, options) { Ability.allowed?(options[:current_user], :download_code, project) } expose :shared_with_groups do |project, options| @@ -287,6 +288,7 @@ module API # N+1 is solved then by using `subject.tags.map(&:name)` # MR describing the solution: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20555 super(projects_relation).preload(:group) + .preload(:ci_cd_settings) .preload(project_group_links: { group: :route }, fork_network: :root_project, fork_network_member: :forked_from_project, diff --git a/lib/api/helpers/projects_helpers.rb b/lib/api/helpers/projects_helpers.rb index 813e46e9520..f242f1fea0e 100644 --- a/lib/api/helpers/projects_helpers.rb +++ b/lib/api/helpers/projects_helpers.rb @@ -29,6 +29,7 @@ module API optional :merge_method, type: String, values: %w(ff rebase_merge merge), desc: 'The merge method used when merging merge requests' 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' end params :optional_project_params_ee do |