Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ad120393
Commit
ad120393
authored
Sep 14, 2020
by
Tristan Read
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove alert detail markdown sections
parent
3c20647e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
62 deletions
+2
-62
app/presenters/alert_management/alert_presenter.rb
app/presenters/alert_management/alert_presenter.rb
+1
-18
app/presenters/projects/prometheus/alert_presenter.rb
app/presenters/projects/prometheus/alert_presenter.rb
+1
-20
spec/presenters/alert_management/alert_presenter_spec.rb
spec/presenters/alert_management/alert_presenter_spec.rb
+0
-6
spec/presenters/projects/prometheus/alert_presenter_spec.rb
spec/presenters/projects/prometheus/alert_presenter_spec.rb
+0
-18
No files found.
app/presenters/alert_management/alert_presenter.rb
View file @
ad120393
...
...
@@ -46,7 +46,7 @@ module AlertManagement
def
issue_summary_markdown
<<~
MARKDOWN
.
chomp
#{
metadata_list
}
#{
alert_details
}#{
metric_embed_for_alert
}
#{
metric_embed_for_alert
}
MARKDOWN
end
...
...
@@ -65,23 +65,6 @@ module AlertManagement
metadata
.
join
(
MARKDOWN_LINE_BREAK
)
end
def
alert_details
if
details
.
present?
<<~
MARKDOWN
.
chomp
#### Alert Details
#{
details_list
}
MARKDOWN
end
end
def
details_list
details
.
map
{
|
label
,
value
|
list_item
(
label
,
value
)
}
.
join
(
MARKDOWN_LINE_BREAK
)
end
def
metric_embed_for_alert
"
\n
[](
#{
metrics_dashboard_url
}
)"
if
metrics_dashboard_url
end
...
...
app/presenters/projects/prometheus/alert_presenter.rb
View file @
ad120393
...
...
@@ -51,18 +51,10 @@ module Projects
def
issue_summary_markdown
<<~
MARKDOWN
.
chomp
#{
metadata_list
}
#{
alert_details
}#{
metric_embed_for_alert
}
#{
metric_embed_for_alert
}
MARKDOWN
end
def
details_list
strong_memoize
(
:details_list
)
do
details
.
map
{
|
label
,
value
|
list_item
(
label
,
value
)
}
.
join
(
MARKDOWN_LINE_BREAK
)
end
end
def
metric_embed_for_alert
"
\n
[](
#{
metrics_dashboard_url
}
)"
if
metrics_dashboard_url
end
...
...
@@ -111,17 +103,6 @@ module Projects
Gitlab
::
Utils
::
InlineHash
.
merge_keys
(
payload
)
end
def
alert_details
if
details
.
present?
<<~
MARKDOWN
.
chomp
#### Alert Details
#{
details_list
}
MARKDOWN
end
end
def
list_item
(
key
,
value
)
"**
#{
key
}
:**
#{
value
}
"
.
strip
end
...
...
spec/presenters/alert_management/alert_presenter_spec.rb
View file @
ad120393
...
...
@@ -65,12 +65,6 @@ RSpec.describe AlertManagement::AlertPresenter do
**Description:**
#{
alert
.
description
}#{
markdown_line_break
}
**GitLab alert:**
#{
alert_url
}
#### Alert Details
**title:** Alert title
#{
markdown_line_break
}
**start_time:** 2020-04-27T10:10:22.265949279Z
#{
markdown_line_break
}
**custom.alert.fields:** ["one", "two"]
#{
markdown_line_break
}
**yet.another:** 73
MARKDOWN
)
end
...
...
spec/presenters/projects/prometheus/alert_presenter_spec.rb
View file @
ad120393
...
...
@@ -65,9 +65,6 @@ RSpec.describe Projects::Prometheus::AlertPresenter do
<<~
MARKDOWN
.
chomp
**Start time:**
#{
presenter
.
start_time
}
#### Alert Details
**startsAt:**
#{
presenter
.
starts_at_raw
}
MARKDOWN
)
end
...
...
@@ -96,17 +93,6 @@ RSpec.describe Projects::Prometheus::AlertPresenter do
**Monitoring tool:** monitoring_tool_name
#{
markdown_line_break
}
**Hosts:** http://localhost:3000 http://localhost:3001
#### Alert Details
**annotations.hosts:** ["http://localhost:3000", "http://localhost:3001"]
#{
markdown_line_break
}
**annotations.service:** service_name
#{
markdown_line_break
}
**annotations.monitoring_tool:** monitoring_tool_name
#{
markdown_line_break
}
**annotations.description:** Alert Description
#{
markdown_line_break
}
**annotations.bar:** value2
#{
markdown_line_break
}
**annotations.foo:** value1
#{
markdown_line_break
}
**annotations.title:** Alert Title
#{
markdown_line_break
}
**generatorURL:** http://host?g0.expr=query
#{
markdown_line_break
}
**startsAt:**
#{
presenter
.
starts_at_raw
}
MARKDOWN
)
end
...
...
@@ -123,10 +109,6 @@ RSpec.describe Projects::Prometheus::AlertPresenter do
**Start time:**
#{
presenter
.
start_time
}#{
markdown_line_break
}
**Hosts:** http://localhost:3000
#### Alert Details
**annotations.hosts:** http://localhost:3000
#{
markdown_line_break
}
**startsAt:**
#{
presenter
.
starts_at_raw
}
MARKDOWN
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment