Commit 7d72d038 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Use Alert#starts_at_raw for gitlab_fingerprint

Fixes `gitlab_fingerprint` by using `starts_at_row`
parent 9c382b63
...@@ -121,9 +121,9 @@ module Gitlab ...@@ -121,9 +121,9 @@ module Gitlab
def plain_gitlab_fingerprint def plain_gitlab_fingerprint
if gitlab_managed? if gitlab_managed?
[metric_id, starts_at].join('/') [metric_id, starts_at_raw].join('/')
else # self managed else # self managed
[starts_at, title, full_query].join('/') [starts_at_raw, title, full_query].join('/')
end end
end end
......
...@@ -253,7 +253,7 @@ describe Gitlab::Alerting::Alert do ...@@ -253,7 +253,7 @@ describe Gitlab::Alerting::Alert do
include_context 'gitlab alert' include_context 'gitlab alert'
it 'returns a fingerprint' do it 'returns a fingerprint' do
plain_fingerprint = [alert.metric_id, alert.starts_at].join('/') plain_fingerprint = [alert.metric_id, alert.starts_at_raw].join('/')
is_expected.to eq(Digest::SHA1.hexdigest(plain_fingerprint)) is_expected.to eq(Digest::SHA1.hexdigest(plain_fingerprint))
end end
...@@ -263,7 +263,7 @@ describe Gitlab::Alerting::Alert do ...@@ -263,7 +263,7 @@ describe Gitlab::Alerting::Alert do
include_context 'full query' include_context 'full query'
it 'returns a fingerprint' do it 'returns a fingerprint' do
plain_fingerprint = [alert.starts_at, alert.title, alert.full_query].join('/') plain_fingerprint = [alert.starts_at_raw, alert.title, alert.full_query].join('/')
is_expected.to eq(Digest::SHA1.hexdigest(plain_fingerprint)) is_expected.to eq(Digest::SHA1.hexdigest(plain_fingerprint))
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