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
ef106794
Commit
ef106794
authored
Mar 29, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix rake migration task from ignoring Upload(store: nil)
parent
c88fe5a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
lib/tasks/gitlab/uploads/migrate.rake
lib/tasks/gitlab/uploads/migrate.rake
+2
-2
spec/tasks/gitlab/uploads/migrate_rake_spec.rb
spec/tasks/gitlab/uploads/migrate_rake_spec.rb
+14
-3
No files found.
lib/tasks/gitlab/uploads/migrate.rake
View file @
ef106794
...
@@ -25,8 +25,8 @@ namespace :gitlab do
...
@@ -25,8 +25,8 @@ namespace :gitlab do
Upload
.
class_eval
{
include
EachBatch
}
unless
Upload
<
EachBatch
Upload
.
class_eval
{
include
EachBatch
}
unless
Upload
<
EachBatch
Upload
Upload
.
where
.
not
(
store:
@to_store
)
.
where
(
store:
[
nil
,
1
],
.
where
(
uploader:
@uploader_class
.
to_s
,
uploader:
@uploader_class
.
to_s
,
model_type:
@model_class
.
base_class
.
sti_name
)
model_type:
@model_class
.
base_class
.
sti_name
)
end
end
end
end
...
...
spec/tasks/gitlab/uploads/migrate_rake_spec.rb
View file @
ef106794
...
@@ -20,9 +20,20 @@ describe 'gitlab:uploads:migrate rake tasks' do
...
@@ -20,9 +20,20 @@ describe 'gitlab:uploads:migrate rake tasks' do
run_rake_task
(
"gitlab:uploads:migrate"
,
*
args
)
run_rake_task
(
"gitlab:uploads:migrate"
,
*
args
)
end
end
it
'enqueue jobs in batch'
do
shared_examples
'enqueue jobs in batch'
do
|
batch
:|
expect
(
ObjectStorage
::
MigrateUploadsWorker
).
to
receive
(
:enqueue!
).
exactly
(
4
).
times
it
do
expect
(
ObjectStorage
::
MigrateUploadsWorker
)
.
to
receive
(
:enqueue!
).
exactly
(
batch
).
times
run
run
end
end
context
'Upload has store = nil'
do
before
do
Upload
.
where
(
model:
projects
.
first
(
5
)).
update_all
(
store:
nil
)
end
it_behaves_like
'enqueue jobs in batch'
,
batch:
4
end
end
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