diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-06-12 11:02:36 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-06-12 11:02:36 +0000 |
commit | 991976642f180fbc855ebb27b03cbe0c9217f7a5 (patch) | |
tree | 6c10bd81a9b3ef4baec560b69849202709170a43 /lib | |
parent | 06e89d786c4ac67d9262c576b9aadb7d40dee9c2 (diff) | |
parent | 3ac527b4889b9465b2d55ca0c9317a3e8479a625 (diff) | |
download | gitlab-ce-991976642f180fbc855ebb27b03cbe0c9217f7a5.tar.gz |
Merge branch 'expose-project-git-depth-via-api' into 'master'
Expose default_git_depth via project API
Closes #62908
See merge request gitlab-org/gitlab-ce!29353
Diffstat (limited to 'lib')
-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 880b07d0a84..8840accf675 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 |