Commit 0e7baa35 authored by Imre Farkas's avatar Imre Farkas

Merge branch 'remove-duplicated-title-from-alert-details' into 'master'

Get rid of unnecessary duplication of alert’s title

See merge request gitlab-org/gitlab!19214
parents 1afac734 244b35c4
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Projects module Projects
module Prometheus module Prometheus
class AlertPresenter < Gitlab::View::Presenter::Delegated 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 GENERIC_ALERT_SUMMARY_ANNOTATIONS = %w(monitoring_tool service hosts).freeze
MARKDOWN_LINE_BREAK = " \n".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 ...@@ -56,7 +56,7 @@ describe Projects::Prometheus::AlertPresenter do
context 'with annotations' do context 'with annotations' do
before do before do
payload['annotations'] = { 'foo' => 'value1', 'bar' => 'value2' } payload['annotations'] = { 'title' => 'Alert Title', 'foo' => 'value1', 'bar' => 'value2' }
end end
it do it do
...@@ -120,7 +120,6 @@ describe Projects::Prometheus::AlertPresenter do ...@@ -120,7 +120,6 @@ describe Projects::Prometheus::AlertPresenter do
#### Alert Details #### Alert Details
**title:** The Generic Alert Title#{markdown_line_break}
**description:** The Generic Alert Description **description:** The Generic Alert Description
MARKDOWN MARKDOWN
) )
......
...@@ -41,7 +41,7 @@ describe IncidentManagement::CreateIssueService do ...@@ -41,7 +41,7 @@ describe IncidentManagement::CreateIssueService do
expect(issue.author).to eq(user) expect(issue.author).to eq(user)
expect(issue.title).to eq(alert_title) 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 expect(separator_count(issue.description)).to eq 0
end end
end end
...@@ -170,7 +170,7 @@ describe IncidentManagement::CreateIssueService do ...@@ -170,7 +170,7 @@ describe IncidentManagement::CreateIssueService do
expect(issue.title).to include(gitlab_alert.environment.name) expect(issue.title).to include(gitlab_alert.environment.name)
expect(issue.title).to include(query_title) expect(issue.title).to include(query_title)
expect(issue.title).to include('for 5 minutes') 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 expect(separator_count(issue.description)).to eq 0
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