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
496c2a8d
Commit
496c2a8d
authored
Jan 30, 2020
by
Francisco Javier López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Storage::HashedProject to Storage::Hashed
parent
6180d91a
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
22 additions
and
22 deletions
+22
-22
app/models/pool_repository.rb
app/models/pool_repository.rb
+2
-2
app/models/project.rb
app/models/project.rb
+1
-1
app/models/storage/hashed.rb
app/models/storage/hashed.rb
+1
-1
app/uploaders/file_uploader.rb
app/uploaders/file_uploader.rb
+2
-2
ee/app/models/geo/fdw/project.rb
ee/app/models/geo/fdw/project.rb
+1
-1
ee/spec/factories/geo/event_log.rb
ee/spec/factories/geo/event_log.rb
+1
-1
ee/spec/services/geo/hashed_storage_attachments_migration_service_spec.rb
.../geo/hashed_storage_attachments_migration_service_spec.rb
+1
-1
ee/spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb
...ojects/hashed_storage/migrate_attachments_service_spec.rb
+1
-1
ee/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb
...rojects/hashed_storage/migrate_repository_service_spec.rb
+1
-1
ee/spec/services/projects/hashed_storage/rollback_repository_service_spec.rb
...ojects/hashed_storage/rollback_repository_service_spec.rb
+1
-1
lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config.rb
...und_migration/backfill_project_fullpath_in_repo_config.rb
+2
-2
lib/gitlab/background_migration/backfill_project_repositories.rb
...lab/background_migration/backfill_project_repositories.rb
+2
-2
spec/lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config_spec.rb
...igration/backfill_project_fullpath_in_repo_config_spec.rb
+1
-1
spec/services/projects/after_rename_service_spec.rb
spec/services/projects/after_rename_service_spec.rb
+1
-1
spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb
...ojects/hashed_storage/migrate_attachments_service_spec.rb
+1
-1
spec/services/projects/hashed_storage/migrate_repository_service_spec.rb
...rojects/hashed_storage/migrate_repository_service_spec.rb
+1
-1
spec/services/projects/hashed_storage/rollback_attachments_service_spec.rb
...jects/hashed_storage/rollback_attachments_service_spec.rb
+1
-1
spec/services/projects/hashed_storage/rollback_repository_service_spec.rb
...ojects/hashed_storage/rollback_repository_service_spec.rb
+1
-1
No files found.
app/models/pool_repository.rb
View file @
496c2a8d
...
...
@@ -110,8 +110,8 @@ class PoolRepository < ApplicationRecord
end
def
storage
Storage
::
Hashed
Project
.
new
(
self
,
prefix:
Storage
::
Hashed
Project
::
POOL_PATH_PREFIX
)
Storage
::
Hashed
.
new
(
self
,
prefix:
Storage
::
Hashed
::
POOL_PATH_PREFIX
)
end
end
...
...
app/models/project.rb
View file @
496c2a8d
...
...
@@ -2288,7 +2288,7 @@ class Project < ApplicationRecord
def
storage
@storage
||=
if
hashed_storage?
(
:repository
)
Storage
::
Hashed
Project
.
new
(
self
)
Storage
::
Hashed
.
new
(
self
)
else
Storage
::
LegacyProject
.
new
(
self
)
end
...
...
app/models/storage/hashed
_project
.rb
→
app/models/storage/hashed.rb
View file @
496c2a8d
# frozen_string_literal: true
module
Storage
class
Hashed
Project
class
Hashed
attr_accessor
:project
delegate
:gitlab_shell
,
:repository_storage
,
to: :project
...
...
app/uploaders/file_uploader.rb
View file @
496c2a8d
...
...
@@ -36,7 +36,7 @@ class FileUploader < GitlabUploader
def
self
.
base_dir
(
model
,
store
=
Store
::
LOCAL
)
decorated_model
=
model
decorated_model
=
Storage
::
Hashed
Project
.
new
(
model
)
if
store
==
Store
::
REMOTE
decorated_model
=
Storage
::
Hashed
.
new
(
model
)
if
store
==
Store
::
REMOTE
model_path_segment
(
decorated_model
)
end
...
...
@@ -57,7 +57,7 @@ class FileUploader < GitlabUploader
# Returns a String without a trailing slash
def
self
.
model_path_segment
(
model
)
case
model
when
Storage
::
Hashed
Project
then
model
.
disk_path
when
Storage
::
Hashed
then
model
.
disk_path
else
model
.
hashed_storage?
(
:attachments
)
?
model
.
disk_path
:
model
.
full_path
end
...
...
ee/app/models/geo/fdw/project.rb
View file @
496c2a8d
...
...
@@ -36,7 +36,7 @@ module Geo
def
storage
@storage
||=
if
hashed_storage?
(
:repository
)
Storage
::
Hashed
Project
.
new
(
self
)
Storage
::
Hashed
.
new
(
self
)
else
Storage
::
LegacyProject
.
new
(
self
)
end
...
...
ee/spec/factories/geo/event_log.rb
View file @
496c2a8d
...
...
@@ -119,7 +119,7 @@ FactoryBot.define do
project
{
create
(
:project
,
:repository
)
}
old_attachments_path
{
Storage
::
LegacyProject
.
new
(
project
).
disk_path
}
new_attachments_path
{
Storage
::
Hashed
Project
.
new
(
project
).
disk_path
}
new_attachments_path
{
Storage
::
Hashed
.
new
(
project
).
disk_path
}
end
factory
:geo_lfs_object_deleted_event
,
class:
'Geo::LfsObjectDeletedEvent'
do
...
...
ee/spec/services/geo/hashed_storage_attachments_migration_service_spec.rb
View file @
496c2a8d
...
...
@@ -10,7 +10,7 @@ describe Geo::HashedStorageAttachmentsMigrationService do
let!
(
:project
)
{
create
(
:project
,
:legacy_storage
)
}
let
(
:legacy_storage
)
{
Storage
::
LegacyProject
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
Project
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
.
new
(
project
)
}
let!
(
:upload
)
{
Upload
.
find_by
(
path:
file_uploader
.
upload_path
)
}
let
(
:file_uploader
)
{
build
(
:file_uploader
,
project:
project
)
}
...
...
ee/spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb
View file @
496c2a8d
...
...
@@ -7,7 +7,7 @@ describe Projects::HashedStorage::MigrateAttachmentsService do
let
(
:project
)
{
create
(
:project
,
storage_version:
1
)
}
let
(
:legacy_storage
)
{
Storage
::
LegacyProject
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
Project
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
.
new
(
project
)
}
let
(
:old_attachments_path
)
{
legacy_storage
.
disk_path
}
let
(
:new_attachments_path
)
{
hashed_storage
.
disk_path
}
...
...
ee/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb
View file @
496c2a8d
...
...
@@ -8,7 +8,7 @@ describe Projects::HashedStorage::MigrateRepositoryService do
let
(
:gitlab_shell
)
{
Gitlab
::
Shell
.
new
}
let
(
:project
)
{
create
(
:project
,
:empty_repo
,
:wiki_repo
,
:design_repo
,
:legacy_storage
)
}
let
(
:legacy_storage
)
{
Storage
::
LegacyProject
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
Project
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
.
new
(
project
)
}
let
(
:old_disk_path
)
{
legacy_storage
.
disk_path
}
let
(
:new_disk_path
)
{
hashed_storage
.
disk_path
}
...
...
ee/spec/services/projects/hashed_storage/rollback_repository_service_spec.rb
View file @
496c2a8d
...
...
@@ -8,7 +8,7 @@ describe Projects::HashedStorage::RollbackRepositoryService, :clean_gitlab_redis
let
(
:gitlab_shell
)
{
Gitlab
::
Shell
.
new
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
,
:design_repo
,
storage_version:
::
Project
::
HASHED_STORAGE_FEATURES
[
:repository
])
}
let
(
:legacy_storage
)
{
Storage
::
LegacyProject
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
Project
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
.
new
(
project
)
}
let
(
:old_disk_path
)
{
hashed_storage
.
disk_path
}
let
(
:new_disk_path
)
{
legacy_storage
.
disk_path
}
...
...
lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config.rb
View file @
496c2a8d
...
...
@@ -11,7 +11,7 @@ module Gitlab
module
Storage
# Class that returns the disk path for a project using hashed storage
class
Hashed
Project
class
Hashed
attr_accessor
:project
ROOT_PATH_PREFIX
=
'@hashed'
...
...
@@ -121,7 +121,7 @@ module Gitlab
def
storage
@storage
||=
if
hashed_storage?
Storage
::
Hashed
Project
.
new
(
self
)
Storage
::
Hashed
.
new
(
self
)
else
Storage
::
LegacyProject
.
new
(
self
)
end
...
...
lib/gitlab/background_migration/backfill_project_repositories.rb
View file @
496c2a8d
...
...
@@ -46,7 +46,7 @@ module Gitlab
module
Storage
# Class that returns the disk path for a project using hashed storage
class
Hashed
Project
class
Hashed
attr_accessor
:project
ROOT_PATH_PREFIX
=
'@hashed'
...
...
@@ -176,7 +176,7 @@ module Gitlab
def
storage
@storage
||=
if
hashed_storage?
Storage
::
Hashed
Project
.
new
(
self
)
Storage
::
Hashed
.
new
(
self
)
else
Storage
::
LegacyProject
.
new
(
self
)
end
...
...
spec/lib/gitlab/background_migration/backfill_project_fullpath_in_repo_config_spec.rb
View file @
496c2a8d
...
...
@@ -8,7 +8,7 @@ describe Gitlab::BackgroundMigration::BackfillProjectFullpathInRepoConfig, :migr
let
(
:group
)
{
namespaces
.
create!
(
name:
'foo'
,
path:
'foo'
)
}
let
(
:subgroup
)
{
namespaces
.
create!
(
name:
'bar'
,
path:
'bar'
,
parent_id:
group
.
id
)
}
describe
described_class
::
Storage
::
Hashed
Project
do
describe
described_class
::
Storage
::
Hashed
do
let
(
:project
)
{
double
(
id:
555
)
}
subject
(
:project_storage
)
{
described_class
.
new
(
project
)
}
...
...
spec/services/projects/after_rename_service_spec.rb
View file @
496c2a8d
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
Projects
::
AfterRenameService
do
let
(
:rugged_config
)
{
rugged_repo
(
project
.
repository
).
config
}
let
(
:legacy_storage
)
{
Storage
::
LegacyProject
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
Project
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
.
new
(
project
)
}
let!
(
:path_before_rename
)
{
project
.
path
}
let!
(
:full_path_before_rename
)
{
project
.
full_path
}
let!
(
:path_after_rename
)
{
"
#{
project
.
path
}
-renamed"
}
...
...
spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb
View file @
496c2a8d
...
...
@@ -7,7 +7,7 @@ describe Projects::HashedStorage::MigrateAttachmentsService do
let
(
:project
)
{
create
(
:project
,
:repository
,
storage_version:
1
,
skip_disk_validation:
true
)
}
let
(
:legacy_storage
)
{
Storage
::
LegacyProject
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
Project
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
.
new
(
project
)
}
let!
(
:upload
)
{
Upload
.
find_by
(
path:
file_uploader
.
upload_path
)
}
let
(
:file_uploader
)
{
build
(
:file_uploader
,
project:
project
)
}
...
...
spec/services/projects/hashed_storage/migrate_repository_service_spec.rb
View file @
496c2a8d
...
...
@@ -8,7 +8,7 @@ describe Projects::HashedStorage::MigrateRepositoryService do
let
(
:gitlab_shell
)
{
Gitlab
::
Shell
.
new
}
let
(
:project
)
{
create
(
:project
,
:legacy_storage
,
:repository
,
:wiki_repo
)
}
let
(
:legacy_storage
)
{
Storage
::
LegacyProject
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
Project
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
.
new
(
project
)
}
subject
(
:service
)
{
described_class
.
new
(
project:
project
,
old_disk_path:
project
.
disk_path
)
}
...
...
spec/services/projects/hashed_storage/rollback_attachments_service_spec.rb
View file @
496c2a8d
...
...
@@ -7,7 +7,7 @@ describe Projects::HashedStorage::RollbackAttachmentsService do
let
(
:project
)
{
create
(
:project
,
:repository
,
skip_disk_validation:
true
)
}
let
(
:legacy_storage
)
{
Storage
::
LegacyProject
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
Project
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
.
new
(
project
)
}
let!
(
:upload
)
{
Upload
.
find_by
(
path:
file_uploader
.
upload_path
)
}
let
(
:file_uploader
)
{
build
(
:file_uploader
,
project:
project
)
}
...
...
spec/services/projects/hashed_storage/rollback_repository_service_spec.rb
View file @
496c2a8d
...
...
@@ -8,7 +8,7 @@ describe Projects::HashedStorage::RollbackRepositoryService, :clean_gitlab_redis
let
(
:gitlab_shell
)
{
Gitlab
::
Shell
.
new
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
,
storage_version:
::
Project
::
HASHED_STORAGE_FEATURES
[
:repository
])
}
let
(
:legacy_storage
)
{
Storage
::
LegacyProject
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
Project
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
Hashed
.
new
(
project
)
}
subject
(
:service
)
{
described_class
.
new
(
project:
project
,
old_disk_path:
project
.
disk_path
)
}
...
...
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