Commit 46b80182 authored by James Fargher's avatar James Fargher

Merge branch '330882-dont-ingest-links' into 'master'

Put vulnerability finding link ingestion behind feature flag

See merge request gitlab-org/gitlab!76167
parents 0e84ed65 654fb040
......@@ -9,6 +9,12 @@ module Security
self.model = Vulnerabilities::FindingLink
def execute
return unless Feature.enabled?(:vulnerability_finding_replace_metadata)
super
end
private
def attributes
......
......@@ -20,9 +20,26 @@ RSpec.describe Security::Ingestion::Tasks::IngestFindingLinks do
create(:finding_link, finding: finding_2, url: finding_link.url)
end
it 'creates finding links for the new records' do
expect { ingest_finding_links }.to change { Vulnerabilities::FindingLink.count }.by(1)
.and change { finding_1.finding_links.count }.by(1)
context 'when the replace raw metadata flag is on' do
before do
stub_feature_flags(vulnerability_finding_replace_metadata: true)
end
it 'creates finding links for the new records' do
expect { ingest_finding_links }.to change { Vulnerabilities::FindingLink.count }.by(1)
.and change { finding_1.finding_links.count }.by(1)
end
end
context 'when the replace raw metadata flag is off' do
before do
stub_feature_flags(vulnerability_finding_replace_metadata: false)
end
it 'does not create finding links for the new records' do
expect { ingest_finding_links }.to change { Vulnerabilities::FindingLink.count }.by(0)
.and change { finding_1.finding_links.count }.by(0)
end
end
end
end
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