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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
7b7969bf
Commit
7b7969bf
authored
Aug 21, 2018
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename feature flag to skip_hashed_storage_upgrade to be less confusing
parent
61c35b6c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
app/models/project.rb
app/models/project.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+2
-2
spec/services/projects/update_service_spec.rb
spec/services/projects/update_service_spec.rb
+3
-3
No files found.
app/models/project.rb
View file @
7b7969bf
...
...
@@ -2074,7 +2074,7 @@ class Project < ActiveRecord::Base
def
rename_or_migrate_repository!
if
Gitlab
::
CurrentSettings
.
hashed_storage_enabled?
&&
storage_upgradable?
&&
Feature
.
disabled?
(
:
disable
_hashed_storage_upgrade
)
# kill switch in case we need to disable upgrade behavior
Feature
.
disabled?
(
:
skip
_hashed_storage_upgrade
)
# kill switch in case we need to disable upgrade behavior
::
Projects
::
HashedStorageMigrationService
.
new
(
self
,
full_path_was
).
execute
else
storage
.
rename_repo
...
...
spec/models/project_spec.rb
View file @
7b7969bf
...
...
@@ -2989,7 +2989,7 @@ describe Project do
# call. This makes testing a bit easier.
allow
(
project
).
to
receive
(
:gitlab_shell
).
and_return
(
gitlab_shell
)
allow
(
project
).
to
receive
(
:previous_changes
).
and_return
(
'path'
=>
[
'foo'
])
stub_feature_flags
(
disable
_hashed_storage_upgrade:
false
)
stub_feature_flags
(
skip
_hashed_storage_upgrade:
false
)
end
it
'renames a repository'
do
...
...
@@ -3161,7 +3161,7 @@ describe Project do
# call. This makes testing a bit easier.
allow
(
project
).
to
receive
(
:gitlab_shell
).
and_return
(
gitlab_shell
)
allow
(
project
).
to
receive
(
:previous_changes
).
and_return
(
'path'
=>
[
'foo'
])
stub_feature_flags
(
disable
_hashed_storage_upgrade:
false
)
stub_feature_flags
(
skip
_hashed_storage_upgrade:
false
)
end
context
'migration to hashed storage'
do
...
...
spec/services/projects/update_service_spec.rb
View file @
7b7969bf
...
...
@@ -262,7 +262,7 @@ describe Projects::UpdateService do
context
'when hashed storage is enabled'
do
before
do
stub_application_setting
(
hashed_storage_enabled:
true
)
stub_feature_flags
(
disable
_hashed_storage_upgrade:
false
)
stub_feature_flags
(
skip
_hashed_storage_upgrade:
false
)
end
it
'migrates project to a hashed storage instead of renaming the repo to another legacy name'
do
...
...
@@ -274,9 +274,9 @@ describe Projects::UpdateService do
expect
(
project
.
reload
.
hashed_storage?
(
:repository
)).
to
be_truthy
end
context
'when
disable
_hashed_storage_upgrade feature flag is enabled'
do
context
'when
skip
_hashed_storage_upgrade feature flag is enabled'
do
before
do
stub_feature_flags
(
disable
_hashed_storage_upgrade:
true
)
stub_feature_flags
(
skip
_hashed_storage_upgrade:
true
)
end
it
'renames the project without upgrading it'
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