Commit bbd42c20 authored by Igor Drozdov's avatar Igor Drozdov Committed by Douglas Barbosa Alexandre

Fix alert management fingerprints

ActionController::Parameters class is prefixed with `#`.
The fingerprint in this case is totally different.

Let's rely on the .to_json output instead of .to_s
Its format is unlikely to change
parent 809f0965
...@@ -18,7 +18,7 @@ module Gitlab ...@@ -18,7 +18,7 @@ module Gitlab
fpayload = fpayload['flow'].except('time', 'Summary') fpayload = fpayload['flow'].except('time', 'Summary')
fpayload['l4']['TCP'].delete('flags') if fpayload.dig('l4', 'TCP', 'flags') fpayload['l4']['TCP'].delete('flags') if fpayload.dig('l4', 'TCP', 'flags')
fpayload.to_s fpayload.to_json
end end
end end
end end
......
...@@ -13,7 +13,7 @@ RSpec.describe Gitlab::AlertManagement::Payload::Cilium do ...@@ -13,7 +13,7 @@ RSpec.describe Gitlab::AlertManagement::Payload::Cilium do
it 'parses cilium specific fields' do it 'parses cilium specific fields' do
expect(parsed_payload.title).to eq('Cilium Alert') expect(parsed_payload.title).to eq('Cilium Alert')
expect(parsed_payload.description).to eq('POLICY_DENIED') expect(parsed_payload.description).to eq('POLICY_DENIED')
expect(parsed_payload.gitlab_fingerprint).to eq('b2ad2a791756abe01692270c6a846129a09891b3') expect(parsed_payload.gitlab_fingerprint).to eq('23907c66f431ae66aad738553ccbd03e26f6838f')
end end
context 'when title is not provided' do context 'when title is not provided' do
......
...@@ -31,7 +31,7 @@ RSpec.describe AlertManagement::NetworkAlertService do ...@@ -31,7 +31,7 @@ RSpec.describe AlertManagement::NetworkAlertService do
ended_at: nil, ended_at: nil,
environment_id: nil, environment_id: nil,
events: 1, events: 1,
fingerprint: '89269ffa3902af37f036a77bc9ea57cdee3a52c2', fingerprint: '23907c66f431ae66aad738553ccbd03e26f6838f',
hosts: [], hosts: [],
issue_id: nil, issue_id: nil,
monitoring_tool: 'Cilium', monitoring_tool: 'Cilium',
...@@ -62,7 +62,7 @@ RSpec.describe AlertManagement::NetworkAlertService do ...@@ -62,7 +62,7 @@ RSpec.describe AlertManagement::NetworkAlertService do
it_behaves_like 'never-before-seen network alert' it_behaves_like 'never-before-seen network alert'
context 'for an existing alert with the same fingerprint' do context 'for an existing alert with the same fingerprint' do
let_it_be(:fingerprint_sha) { '89269ffa3902af37f036a77bc9ea57cdee3a52c2' } let_it_be(:fingerprint_sha) { '23907c66f431ae66aad738553ccbd03e26f6838f' }
context 'which is triggered' do context 'which is triggered' do
let_it_be(:alert) do let_it_be(:alert) 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