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
fa0860e5
Commit
fa0860e5
authored
May 08, 2020
by
James Fargher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove kwargs from storage move worker
Sidekiq does not support kwargs
parent
f6dd05a5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
6 deletions
+12
-6
app/models/project_repository_storage_move.rb
app/models/project_repository_storage_move.rb
+3
-2
app/workers/project_update_repository_storage_worker.rb
app/workers/project_update_repository_storage_worker.rb
+1
-1
changelogs/unreleased/remove_kwargs_from_storage_move_worker.yml
...ogs/unreleased/remove_kwargs_from_storage_move_worker.yml
+5
-0
spec/models/project_repository_storage_move_spec.rb
spec/models/project_repository_storage_move_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
spec/workers/project_update_repository_storage_worker_spec.rb
.../workers/project_update_repository_storage_worker_spec.rb
+1
-1
No files found.
app/models/project_repository_storage_move.rb
View file @
fa0860e5
...
...
@@ -39,8 +39,9 @@ class ProjectRepositoryStorageMove < ApplicationRecord
after_transition
initial: :scheduled
do
|
storage_move
,
_
|
storage_move
.
run_after_commit
do
ProjectUpdateRepositoryStorageWorker
.
perform_async
(
storage_move
.
project_id
,
storage_move
.
destination_storage_name
,
repository_storage_move_id:
storage_move
.
id
storage_move
.
project_id
,
storage_move
.
destination_storage_name
,
storage_move
.
id
)
end
end
...
...
app/workers/project_update_repository_storage_worker.rb
View file @
fa0860e5
...
...
@@ -5,7 +5,7 @@ class ProjectUpdateRepositoryStorageWorker # rubocop:disable Scalability/Idempot
feature_category
:gitaly
def
perform
(
project_id
,
new_repository_storage_key
,
repository_storage_move_id
:
nil
)
def
perform
(
project_id
,
new_repository_storage_key
,
repository_storage_move_id
=
nil
)
repository_storage_move
=
if
repository_storage_move_id
ProjectRepositoryStorageMove
.
find
(
repository_storage_move_id
)
...
...
changelogs/unreleased/remove_kwargs_from_storage_move_worker.yml
0 → 100644
View file @
fa0860e5
---
title
:
Remove kwargs from storage move worker
merge_request
:
31412
author
:
type
:
fixed
spec/models/project_repository_storage_move_spec.rb
View file @
fa0860e5
...
...
@@ -46,7 +46,7 @@ RSpec.describe ProjectRepositoryStorageMove, type: :model do
context
'and transits to scheduled'
do
it
'triggers ProjectUpdateRepositoryStorageWorker'
do
expect
(
ProjectUpdateRepositoryStorageWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
,
'test_second_storage'
,
repository_storage_move_id:
storage_move
.
id
)
expect
(
ProjectUpdateRepositoryStorageWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
,
'test_second_storage'
,
storage_move
.
id
)
storage_move
.
schedule!
end
...
...
spec/models/project_spec.rb
View file @
fa0860e5
...
...
@@ -2844,7 +2844,7 @@ describe Project do
end
it
'schedules the transfer of the repository to the new storage and locks the project'
do
expect
(
ProjectUpdateRepositoryStorageWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
,
'test_second_storage'
,
repository_storage_move_id:
anything
)
expect
(
ProjectUpdateRepositoryStorageWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
,
'test_second_storage'
,
anything
)
project
.
change_repository_storage
(
'test_second_storage'
)
project
.
save!
...
...
spec/workers/project_update_repository_storage_worker_spec.rb
View file @
fa0860e5
...
...
@@ -40,7 +40,7 @@ describe ProjectUpdateRepositoryStorageWorker do
expect
(
service
).
to
receive
(
:execute
)
expect
do
subject
.
perform
(
nil
,
nil
,
repository_storage_move
_id:
repository_storage_move
.
id
)
subject
.
perform
(
nil
,
nil
,
repository_storage_move
.
id
)
end
.
not_to
change
(
ProjectRepositoryStorageMove
,
:count
)
end
end
...
...
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