Commit 1cc2ff17 authored by Sean Arnold's avatar Sean Arnold

Never show error when a non fingerprinted alert

- Add specs to test fix
parent 08963142
...@@ -150,6 +150,8 @@ module AlertManagement ...@@ -150,6 +150,8 @@ module AlertManagement
end end
def duplicate_alert? def duplicate_alert?
return if alert.fingerprint.blank?
open_alerts.any? && open_alerts.exclude?(alert) open_alerts.any? && open_alerts.exclude?(alert)
end end
......
...@@ -209,6 +209,19 @@ RSpec.describe AlertManagement::Alerts::UpdateService do ...@@ -209,6 +209,19 @@ RSpec.describe AlertManagement::Alerts::UpdateService do
expect(response).to be_error expect(response).to be_error
expect(response.message).to eq(message) expect(response.message).to eq(message)
end end
context 'fingerprints are blank' do
let_it_be(:alert) { create(:alert_management_alert, :resolved, project: project, fingerprint: nil) }
let_it_be(:existing_alert) { create(:alert_management_alert, :triggered, fingerprint: alert.fingerprint, project: project) }
it 'successfully changes the status' do
expect { response }.to change { alert.acknowledged? }.to(true)
expect(response).to be_success
expect(response.payload[:alert]).to eq(alert)
end
it_behaves_like 'adds a system note'
end
end end
context 'two existing closed alerts' do context 'two existing closed alerts' 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