Commit 244b35c4 authored by Vitali Tatarintev's avatar Vitali Tatarintev Committed by Imre Farkas

Remove unnecessary duplication of alert’s title

There is no need to display an Alert's title as a separate parameter
for the Generic and Prometheus-specific alerts.
It is already set as an issue title.
parent 1afac734
......@@ -3,7 +3,7 @@
module Projects
module Prometheus
class AlertPresenter < Gitlab::View::Presenter::Delegated
RESERVED_ANNOTATIONS = %w(gitlab_incident_markdown).freeze
RESERVED_ANNOTATIONS = %w(gitlab_incident_markdown title).freeze
GENERIC_ALERT_SUMMARY_ANNOTATIONS = %w(monitoring_tool service hosts).freeze
MARKDOWN_LINE_BREAK = " \n".freeze
......
---
title: Get rid of unnecessary duplication of alert’s title from Alert Details
merge_request: 19214
author:
type: changed
......@@ -56,7 +56,7 @@ describe Projects::Prometheus::AlertPresenter do
context 'with annotations' do
before do
payload['annotations'] = { 'foo' => 'value1', 'bar' => 'value2' }
payload['annotations'] = { 'title' => 'Alert Title', 'foo' => 'value1', 'bar' => 'value2' }
end
it do
......@@ -120,7 +120,6 @@ describe Projects::Prometheus::AlertPresenter do
#### Alert Details
**title:** The Generic Alert Title#{markdown_line_break}
**description:** The Generic Alert Description
MARKDOWN
)
......
......@@ -41,7 +41,7 @@ describe IncidentManagement::CreateIssueService do
expect(issue.author).to eq(user)
expect(issue.title).to eq(alert_title)
expect(issue.description).to include(alert_presenter.issue_summary_markdown)
expect(issue.description).to include(alert_presenter.issue_summary_markdown.strip)
expect(separator_count(issue.description)).to eq 0
end
end
......@@ -170,7 +170,7 @@ describe IncidentManagement::CreateIssueService do
expect(issue.title).to include(gitlab_alert.environment.name)
expect(issue.title).to include(query_title)
expect(issue.title).to include('for 5 minutes')
expect(issue.description).to include(alert_presenter.issue_summary_markdown)
expect(issue.description).to include(alert_presenter.issue_summary_markdown.strip)
expect(separator_count(issue.description)).to eq 0
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