Commit a99ddab6 authored by Mehmet Emin INAC's avatar Mehmet Emin INAC

Cover the case when pipeline has multiple scans of same type

parent baa4de47
......@@ -260,7 +260,7 @@ module EE
def missing_security_scan_types
return [] unless actual_head_pipeline && base_pipeline
base_pipeline.security_scans.pluck(:scan_type) - actual_head_pipeline.security_scans.pluck(:scan_type)
(base_pipeline.security_scans.pluck(:scan_type) - actual_head_pipeline.security_scans.pluck(:scan_type)).uniq
end
private
......
......@@ -975,6 +975,15 @@ RSpec.describe MergeRequest do
end
it { is_expected.to eq(['sast']) }
context 'when there are multiple scans for the same type for base pipeline' do
before do
build = create(:ci_build, :success, pipeline: base_pipeline, project: project)
create(:security_scan, build: build, scan_type: 'sast')
end
it { is_expected.to eq(['sast']) }
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