Commit 002047cb authored by Toon Claes's avatar Toon Claes

Merge branch '238456-fix-broken-populate-vulnerability-statistics-migrations' into 'master'

Fix error in migration to populate historical vulnerability statistics

See merge request gitlab-org/gitlab!40835
parents b5dd57fa 260793db
---
title: Fix error in migration to populate historical vulnerability statistics
merge_request: 40835
author:
type: fixed
......@@ -5,7 +5,10 @@ module EE
module BackgroundMigration
# This class creates/updates those project historical vulnerability statistics
# that haven't been created nor initialized.
class PopulateVulnerabilityHistoricalStatistics
module PopulateVulnerabilityHistoricalStatistics
extend ::Gitlab::Utils::Override
override :perform
def perform(project_ids)
project_ids.each do |project_id|
upsert_vulnerability_historical_statistics(project_id)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe EE::Gitlab::BackgroundMigration::PopulateVulnerabilityHistoricalStatistics, schema: 2020_08_21_224343 do
RSpec.describe Gitlab::BackgroundMigration::PopulateVulnerabilityHistoricalStatistics, schema: 2020_08_21_224343 do
let(:users) { table(:users) }
let(:namespaces) { table(:namespaces) }
let(:vulnerabilities) { table(:vulnerabilities) }
......
# frozen_string_literal: true
module Gitlab
module BackgroundMigration
# This class creates/updates those project historical vulnerability statistics
# that haven't been created nor initialized. It should only be executed in EE.
class PopulateVulnerabilityHistoricalStatistics
def perform(project_ids)
end
end
end
end
Gitlab::BackgroundMigration::PopulateVulnerabilityHistoricalStatistics.prepend_if_ee('EE::Gitlab::BackgroundMigration::PopulateVulnerabilityHistoricalStatistics')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment