Commit e7f900a2 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Drop numeric support for AlertPayloadField

parent b41c91a6
......@@ -31,7 +31,8 @@ module Gitlab
)
end
# TODO: Code duplication with Gitlab::InlineHash#merge_keys ahead!
# Code duplication with Gitlab::InlineHash#merge_keys ahead!
# See https://gitlab.com/gitlab-org/gitlab/-/issues/299856
def deep_traverse(hash)
return to_enum(__method__, hash) unless block_given?
......@@ -54,8 +55,6 @@ module Gitlab
'datetime'
when String
'string'
when Numeric
'numeric'
when Array
'array'
end
......
......@@ -12,12 +12,10 @@ RSpec.describe Gitlab::AlertManagement::AlertPayloadFieldExtractor do
subject(:fields) { extractor.extract(json) }
context 'plain' do
describe '#extract' do
before do
payload.merge!(
str: 'value',
int: 23,
float: 23.5,
nested: {
key: 'level1',
deep: {
......@@ -32,11 +30,9 @@ RSpec.describe Gitlab::AlertManagement::AlertPayloadFieldExtractor do
)
end
it 'works' do
it 'returns all the possible field combination and types suggestions' do
expect(fields).to contain_exactly(
a_field(['str'], 'Str', 'string'),
a_field(['int'], 'Int', 'numeric'),
a_field(['float'], 'Float', 'numeric'),
a_field(%w(nested key), 'Key', 'string'),
a_field(%w(nested deep key), 'Key', 'string'),
a_field(['time'], 'Time', 'datetime'),
......
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