Commit 41559a1a authored by Vitali Tatarintev's avatar Vitali Tatarintev

Move .auto_resolve_prometheus_alert to CE

Move `SystemNoteService.auto_resolve_prometheus_alert` from EE to CE.

Contributes to migration of Prometheus alerts to Core
parent 2c75a5c4
...@@ -241,6 +241,10 @@ module SystemNoteService ...@@ -241,6 +241,10 @@ module SystemNoteService
def zoom_link_removed(issue, project, author) def zoom_link_removed(issue, project, author)
::SystemNotes::ZoomService.new(noteable: issue, project: project, author: author).zoom_link_removed ::SystemNotes::ZoomService.new(noteable: issue, project: project, author: author).zoom_link_removed
end end
def auto_resolve_prometheus_alert(noteable, project, author)
::SystemNotes::IssuablesService.new(noteable: noteable, project: project, author: author).auto_resolve_prometheus_alert
end
end end
SystemNoteService.prepend_if_ee('EE::SystemNoteService') SystemNoteService.prepend_if_ee('EE::SystemNoteService')
...@@ -159,9 +159,5 @@ module EE ...@@ -159,9 +159,5 @@ module EE
def abort_add_to_merge_train_when_pipeline_succeeds(noteable, project, author, reason) def abort_add_to_merge_train_when_pipeline_succeeds(noteable, project, author, reason)
EE::SystemNotes::MergeTrainService.new(noteable: noteable, project: project, author: author).abort_add_when_pipeline_succeeds(reason) EE::SystemNotes::MergeTrainService.new(noteable: noteable, project: project, author: author).abort_add_when_pipeline_succeeds(reason)
end end
def auto_resolve_prometheus_alert(noteable, project, author)
::SystemNotes::IssuablesService.new(noteable: noteable, project: project, author: author).auto_resolve_prometheus_alert
end
end end
end end
...@@ -220,14 +220,4 @@ describe SystemNoteService do ...@@ -220,14 +220,4 @@ describe SystemNoteService do
described_class.abort_add_to_merge_train_when_pipeline_succeeds(noteable, project, author, message) described_class.abort_add_to_merge_train_when_pipeline_succeeds(noteable, project, author, message)
end end
end end
describe '.auto_resolve_prometheus_alert' do
it 'calls IssuableService' do
expect_next_instance_of(::SystemNotes::IssuablesService) do |service|
expect(service).to receive(:auto_resolve_prometheus_alert)
end
described_class.auto_resolve_prometheus_alert(noteable, project, author)
end
end
end end
...@@ -625,4 +625,14 @@ describe SystemNoteService do ...@@ -625,4 +625,14 @@ describe SystemNoteService do
described_class.discussion_lock(issuable, double) described_class.discussion_lock(issuable, double)
end end
end end
describe '.auto_resolve_prometheus_alert' do
it 'calls IssuableService' do
expect_next_instance_of(::SystemNotes::IssuablesService) do |service|
expect(service).to receive(:auto_resolve_prometheus_alert)
end
described_class.auto_resolve_prometheus_alert(noteable, project, author)
end
end
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