Commit f6b9b770 authored by Sarah Yasonik's avatar Sarah Yasonik Committed by Douglas Barbosa Alexandre

Allow alert incident title to include iid for HTTP integrations

parent f64a7c35
...@@ -262,7 +262,6 @@ module EE ...@@ -262,7 +262,6 @@ module EE
def generic_alert_with_default_title? def generic_alert_with_default_title?
title == ::Gitlab::AlertManagement::Payload::Generic::DEFAULT_TITLE && title == ::Gitlab::AlertManagement::Payload::Generic::DEFAULT_TITLE &&
project.alerts_service_activated? &&
author == ::User.alert_bot author == ::User.alert_bot
end end
......
---
title: Include issue iid in default title for untitled incidents when created from
alert via HTTP integration
merge_request: 49274
author:
type: fixed
...@@ -30,11 +30,6 @@ RSpec.describe Issue do ...@@ -30,11 +30,6 @@ RSpec.describe Issue do
context 'when issue title is "New: Incident"' do context 'when issue title is "New: Incident"' do
let(:issue) { build(:issue, project: project, author: author, title: 'New: Incident', iid: 503503) } let(:issue) { build(:issue, project: project, author: author, title: 'New: Incident', iid: 503503) }
context 'when alerts service is active' do
before do
allow(project).to receive(:alerts_service_activated?).and_return(true)
end
context 'when the author is Alert Bot' do context 'when the author is Alert Bot' do
it 'updates issue title with the IID' do it 'updates issue title with the IID' do
expect { issue.save }.to change { issue.title }.to("New: Incident 503503") expect { issue.save }.to change { issue.title }.to("New: Incident 503503")
...@@ -50,17 +45,6 @@ RSpec.describe Issue do ...@@ -50,17 +45,6 @@ RSpec.describe Issue do
end end
end end
context 'when alerts service is not active' do
before do
allow(project).to receive(:alerts_service_activated?).and_return(false)
end
it 'does not change issue title' do
expect { issue.save }.not_to change { issue.title }
end
end
end
context 'when issue title is not "New: Incident"' do context 'when issue title is not "New: Incident"' do
let(:issue) { build(:issue, project: project, title: 'Not New: Incident') } let(:issue) { build(:issue, project: project, title: 'Not New: Incident') }
......
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