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
58b12b3d
Commit
58b12b3d
authored
Jan 08, 2021
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Iterate through all feedback records on migration
parent
b48df2a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
db/post_migrate/20201211090634_schedule_populate_finding_uuid_for_vulnerability_feedback.rb
...edule_populate_finding_uuid_for_vulnerability_feedback.rb
+1
-1
lib/gitlab/background_migration/populate_finding_uuid_for_vulnerability_feedback.rb
...ation/populate_finding_uuid_for_vulnerability_feedback.rb
+1
-1
spec/migrations/schedule_populate_finding_uuid_for_vulnerability_feedback_spec.rb
..._populate_finding_uuid_for_vulnerability_feedback_spec.rb
+2
-1
No files found.
db/post_migrate/20201211090634_schedule_populate_finding_uuid_for_vulnerability_feedback.rb
View file @
58b12b3d
...
...
@@ -12,7 +12,7 @@ class SchedulePopulateFindingUuidForVulnerabilityFeedback < ActiveRecord::Migrat
def
up
queue_background_migration_jobs_by_range_at_intervals
(
Gitlab
::
BackgroundMigration
::
PopulateFindingUuidForVulnerabilityFeedback
::
VulnerabilityFeedback
.
without_uuid
,
Gitlab
::
BackgroundMigration
::
PopulateFindingUuidForVulnerabilityFeedback
::
VulnerabilityFeedback
,
MIGRATION_CLASS
,
DELAY_INTERVAL
,
batch_size:
BATCH_SIZE
...
...
lib/gitlab/background_migration/populate_finding_uuid_for_vulnerability_feedback.rb
View file @
58b12b3d
...
...
@@ -22,7 +22,7 @@ module Gitlab
enum
category:
REPORT_TYPES
scope
:in_range
,
->
(
start
,
stop
)
{
where
(
'id BETWEEN ? AND ?'
,
start
,
stop
)
}
scope
:in_range
,
->
(
start
,
stop
)
{
where
(
id:
start
..
stop
)
}
scope
:without_uuid
,
->
{
where
(
finding_uuid:
nil
)
}
def
self
.
load_vulnerability_findings
...
...
spec/migrations/schedule_populate_finding_uuid_for_vulnerability_feedback_spec.rb
View file @
58b12b3d
...
...
@@ -29,8 +29,9 @@ RSpec.describe SchedulePopulateFindingUuidForVulnerabilityFeedback do
it
'schedules the background jobs'
,
:aggregate_failures
do
migrate!
expect
(
BackgroundMigrationWorker
.
jobs
.
size
).
to
be
(
2
)
expect
(
BackgroundMigrationWorker
.
jobs
.
size
).
to
be
(
3
)
expect
(
described_class
::
MIGRATION_CLASS
).
to
be_scheduled_delayed_migration
(
2
.
minutes
,
feedback_1
.
id
,
feedback_1
.
id
)
expect
(
described_class
::
MIGRATION_CLASS
).
to
be_scheduled_delayed_migration
(
4
.
minutes
,
feedback_2
.
id
,
feedback_2
.
id
)
expect
(
described_class
::
MIGRATION_CLASS
).
to
be_scheduled_delayed_migration
(
6
.
minutes
,
feedback_3
.
id
,
feedback_3
.
id
)
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