Commit c307d504 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '220988-fix-problem-with-duplicated-feedback-links' into 'master'

Return individual links to issue for each finding in Pipeline Security

See merge request gitlab-org/gitlab!34612
parents 5b19eb8c 3fbcc8ad
......@@ -204,7 +204,7 @@ module Vulnerabilities
occurrence_keys.each do |occurrence_key|
loader.call(
occurrence_key,
feedback.select { |f| occurrence_key = f.occurrence_key }
feedback.select { |f| occurrence_key == f.occurrence_key }
)
end
end
......
......@@ -529,6 +529,32 @@ RSpec.describe Vulnerabilities::Occurrence do
subject(:load_feedback) { occurrence.load_feedback.to_a }
it { is_expected.to eq(expected_feedback) }
context 'when you have multiple occurrences' do
let_it_be(:occurrence_2) do
create(
:vulnerabilities_occurrence,
report_type: :dependency_scanning,
project: project
)
end
let_it_be(:feedback_2) do
create(
:vulnerability_feedback,
:dependency_scanning,
:dismissal,
project: project,
project_fingerprint: occurrence_2.project_fingerprint
)
end
let(:expected_feedback) { [[feedback], [feedback_2]] }
subject(:load_feedback) { [occurrence, occurrence_2].map(&:load_feedback) }
it { is_expected.to eq(expected_feedback) }
end
end
describe '#state' do
......
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