From 3ac527b4889b9465b2d55ca0c9317a3e8479a625 Mon Sep 17 00:00:00 2001 From: Fabio Pitino Date: Fri, 7 Jun 2019 12:51:42 +0100 Subject: Expose ci_default_git_depth via project 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 --- lib/api/entities.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/api/entities.rb') 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, -- cgit v1.2.3