Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-06-12 14:02:36 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2019-06-12 14:02:36 +0300
commit991976642f180fbc855ebb27b03cbe0c9217f7a5 (patch)
tree6c10bd81a9b3ef4baec560b69849202709170a43 /app
parent06e89d786c4ac67d9262c576b9aadb7d40dee9c2 (diff)
parent3ac527b4889b9465b2d55ca0c9317a3e8479a625 (diff)
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 'app')
-rw-r--r--app/models/project.rb2
-rw-r--r--app/presenters/ci/build_runner_presenter.rb2
-rw-r--r--app/services/projects/fork_service.rb6
3 files changed, 5 insertions, 5 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index e64a4b313aa..9d17d68eee2 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -311,7 +311,7 @@ class Project < ApplicationRecord
delegate :root_ancestor, to: :namespace, allow_nil: true
delegate :last_pipeline, to: :commit, allow_nil: true
delegate :external_dashboard_url, to: :metrics_setting, allow_nil: true, prefix: true
- delegate :default_git_depth, :default_git_depth=, to: :ci_cd_settings
+ delegate :default_git_depth, :default_git_depth=, to: :ci_cd_settings, prefix: :ci
# Validations
validates :creator, presence: true, on: :create
diff --git a/app/presenters/ci/build_runner_presenter.rb b/app/presenters/ci/build_runner_presenter.rb
index c75f62149f8..b928988ed8c 100644
--- a/app/presenters/ci/build_runner_presenter.rb
+++ b/app/presenters/ci/build_runner_presenter.rb
@@ -28,7 +28,7 @@ module Ci
if git_depth_variable
git_depth_variable[:value]
elsif Feature.enabled?(:ci_project_git_depth, default_enabled: true)
- project.default_git_depth
+ project.ci_default_git_depth
end.to_i
end
diff --git a/app/services/projects/fork_service.rb b/app/services/projects/fork_service.rb
index 0b4ab7b8e4d..d8fa9d37359 100644
--- a/app/services/projects/fork_service.rb
+++ b/app/services/projects/fork_service.rb
@@ -43,10 +43,10 @@ module Projects
shared_runners_enabled: @project.shared_runners_enabled,
namespace_id: target_namespace.id,
fork_network: fork_network,
- # We need to set default_git_depth to 0 for the forked project when
- # @project.default_git_depth is nil in order to keep the same behaviour
+ # We need to set ci_default_git_depth to 0 for the forked project when
+ # @project.ci_default_git_depth is nil in order to keep the same behaviour
# and not get ProjectCiCdSetting::DEFAULT_GIT_DEPTH set on create
- ci_cd_settings_attributes: { default_git_depth: @project.default_git_depth || 0 },
+ ci_cd_settings_attributes: { default_git_depth: @project.ci_default_git_depth || 0 },
# We need to assign the fork network membership after the project has
# been instantiated to avoid ActiveRecord trying to create it when
# initializing the project, as that would cause a foreign key constraint