Commit 49d11485 authored by Aleksei Lipniagov's avatar Aleksei Lipniagov

Merge branch '343843-prevent-update' into 'master'

Does not update persisted feedback when dismissing existing vulnerability

See merge request gitlab-org/gitlab!73311
parents 93310098 18861c42
......@@ -134,7 +134,9 @@ module VulnerabilityFeedback
dismiss_findings: false).execute
end
raise ActiveRecord::Rollback unless vulnerability_feedback.save
unless vulnerability_feedback.persisted?
raise ActiveRecord::Rollback unless vulnerability_feedback.save
end
end
end
......
......@@ -146,6 +146,19 @@ RSpec.describe VulnerabilityFeedback::CreateService, '#execute' do
end
end
end
context 'when we already have persisted feedback' do
let!(:feedback) do
create(:vulnerability_feedback, :dismissal,
project: project,
pipeline: pipeline,
project_fingerprint: project_fingerprint)
end
it 'does not update the feedback' do
expect { result }.not_to change { feedback.reload.updated_at }
end
end
end
context 'when feedback_type is issue' 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