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
23dd285a
Commit
23dd285a
authored
Jun 19, 2020
by
James Fargher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure original repository is archived after a shard move
parent
5b81f9dc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
7 deletions
+17
-7
app/services/projects/update_repository_storage_service.rb
app/services/projects/update_repository_storage_service.rb
+7
-7
changelogs/unreleased/fix_shard_move_archive.yml
changelogs/unreleased/fix_shard_move_archive.yml
+5
-0
spec/services/projects/update_repository_storage_service_spec.rb
...rvices/projects/update_repository_storage_service_spec.rb
+2
-0
spec/support/shared_examples/services/projects/update_repository_storage_service_shared_examples.rb
...ects/update_repository_storage_service_shared_examples.rb
+3
-0
No files found.
app/services/projects/update_repository_storage_service.rb
View file @
23dd285a
...
...
@@ -93,25 +93,25 @@ module Projects
old_repository_storage
=
project
.
repository_storage
new_project_path
=
moved_path
(
project
.
disk_path
)
# Notice that the block passed to `run_after_commit` will run with `
project
`
# Notice that the block passed to `run_after_commit` will run with `
repository_storage_move
`
# as its context
project
.
run_after_commit
do
repository_storage_move
.
run_after_commit
do
GitlabShellWorker
.
perform_async
(
:mv_repository
,
old_repository_storage
,
disk_path
,
project
.
disk_path
,
new_project_path
)
if
wiki
.
repository_exists?
if
project
.
wiki
.
repository_exists?
GitlabShellWorker
.
perform_async
(
:mv_repository
,
old_repository_storage
,
wiki
.
disk_path
,
project
.
wiki
.
disk_path
,
"
#{
new_project_path
}
.wiki"
)
end
if
design_repository
.
exists?
if
project
.
design_repository
.
exists?
GitlabShellWorker
.
perform_async
(
:mv_repository
,
old_repository_storage
,
design_repository
.
disk_path
,
project
.
design_repository
.
disk_path
,
"
#{
new_project_path
}
.design"
)
end
end
...
...
changelogs/unreleased/fix_shard_move_archive.yml
0 → 100644
View file @
23dd285a
---
title
:
Ensure original repository is archived after a shard move
merge_request
:
34895
author
:
type
:
fixed
spec/services/projects/update_repository_storage_service_spec.rb
View file @
23dd285a
...
...
@@ -43,6 +43,8 @@ describe Projects::UpdateRepositoryStorageService do
.
with
(
project
.
repository
.
raw
)
expect
(
project_repository_double
).
to
receive
(
:checksum
)
.
and_return
(
checksum
)
expect
(
GitlabShellWorker
).
to
receive
(
:perform_async
).
with
(
:mv_repository
,
'default'
,
anything
,
anything
)
.
and_call_original
result
=
subject
.
execute
...
...
spec/support/shared_examples/services/projects/update_repository_storage_service_shared_examples.rb
View file @
23dd285a
...
...
@@ -38,6 +38,9 @@ RSpec.shared_examples 'moves repository to another storage' do |repository_type|
.
with
(
repository
.
raw
)
allow
(
repository_double
).
to
receive
(
:checksum
)
.
and_return
(
repository_checksum
)
expect
(
GitlabShellWorker
).
to
receive
(
:perform_async
).
with
(
:mv_repository
,
'default'
,
anything
,
anything
)
.
twice
.
and_call_original
end
it
"moves the project and its
#{
repository_type
}
repository to the new storage and unmarks the repository as read only"
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