Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3df74a40
Commit
3df74a40
authored
Jun 10, 2019
by
Fabio Pitino
Committed by
Kamil Trzciński
Jun 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move project default git depth behind feature flags
parent
9254b5d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
1 deletion
+25
-1
app/models/project_ci_cd_setting.rb
app/models/project_ci_cd_setting.rb
+2
-0
app/presenters/ci/build_runner_presenter.rb
app/presenters/ci/build_runner_presenter.rb
+1
-1
spec/models/project_ci_cd_setting_spec.rb
spec/models/project_ci_cd_setting_spec.rb
+12
-0
spec/presenters/ci/build_runner_presenter_spec.rb
spec/presenters/ci/build_runner_presenter_spec.rb
+10
-0
No files found.
app/models/project_ci_cd_setting.rb
View file @
3df74a40
...
...
@@ -31,6 +31,8 @@ class ProjectCiCdSetting < ApplicationRecord
private
def
set_default_git_depth
return
unless
Feature
.
enabled?
(
:ci_set_project_default_git_depth
,
default_enabled:
true
)
self
.
default_git_depth
||=
DEFAULT_GIT_DEPTH
end
end
app/presenters/ci/build_runner_presenter.rb
View file @
3df74a40
...
...
@@ -27,7 +27,7 @@ module Ci
def
git_depth
if
git_depth_variable
git_depth_variable
[
:value
]
els
e
els
if
Feature
.
enabled?
(
:ci_project_git_depth
,
default_enabled:
true
)
project
.
default_git_depth
end
.
to_i
end
...
...
spec/models/project_ci_cd_setting_spec.rb
View file @
3df74a40
...
...
@@ -48,5 +48,17 @@ describe ProjectCiCdSetting do
expect
(
project
.
reload
.
ci_cd_settings
.
default_git_depth
).
to
eq
(
0
)
end
context
'when feature flag :ci_set_project_default_git_depth is disabled'
do
let
(
:project
)
{
create
(
:project
)
}
before
do
stub_feature_flags
(
ci_set_project_default_git_depth:
{
enabled:
false
}
)
end
it
'does not set default value for new records'
do
expect
(
project
.
ci_cd_settings
.
default_git_depth
).
to
eq
(
nil
)
end
end
end
end
spec/presenters/ci/build_runner_presenter_spec.rb
View file @
3df74a40
...
...
@@ -136,6 +136,16 @@ describe Ci::BuildRunnerPresenter do
it
'defaults to git depth setting for the project'
do
expect
(
git_depth
).
to
eq
(
build
.
project
.
default_git_depth
)
end
context
'when feature flag :ci_project_git_depth is disabled'
do
before
do
stub_feature_flags
(
ci_project_git_depth:
{
enabled:
false
})
end
it
'defaults to 0'
do
expect
(
git_depth
).
to
eq
(
0
)
end
end
end
describe
'#refspecs'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment