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
bf85c3f7
Commit
bf85c3f7
authored
Oct 10, 2019
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't convert hosts into Markdown links explicitly
Let Markdown auto-linking feature handle that.
parent
0b77441a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
ee/app/presenters/projects/prometheus/alert_presenter.rb
ee/app/presenters/projects/prometheus/alert_presenter.rb
+2
-6
ee/spec/presenters/projects/prometheus/alert_presenter_spec.rb
...ec/presenters/projects/prometheus/alert_presenter_spec.rb
+2
-2
No files found.
ee/app/presenters/projects/prometheus/alert_presenter.rb
View file @
bf85c3f7
...
...
@@ -63,7 +63,7 @@ module Projects
metadata
<<
list_item
(
'full_query'
,
backtick
(
full_query
))
if
full_query
metadata
<<
list_item
(
service
.
label
.
humanize
,
service
.
value
)
if
service
metadata
<<
list_item
(
monitoring_tool
.
label
.
humanize
,
monitoring_tool
.
value
)
if
monitoring_tool
metadata
<<
list_item
(
hosts
.
label
.
humanize
,
host_links
.
join
(
' '
)
)
if
hosts
metadata
<<
list_item
(
hosts
.
label
.
humanize
,
host_links
)
if
hosts
metadata
.
join
(
MARKDOWN_LINE_BREAK
)
end
...
...
@@ -96,10 +96,6 @@ module Projects
"`
#{
value
}
`"
end
def
markdown_link
(
title
,
url
)
"[
#{
title
}
](
#{
url
}
)"
end
GENERIC_ALERT_SUMMARY_ANNOTATIONS
.
each
do
|
annotation_name
|
define_method
(
annotation_name
)
do
annotations
.
find
{
|
a
|
a
.
label
==
annotation_name
}
...
...
@@ -107,7 +103,7 @@ module Projects
end
def
host_links
Array
(
hosts
.
value
).
map
{
|
host
|
markdown_link
(
host
,
host
)
}
Array
(
hosts
.
value
).
join
(
' '
)
end
end
end
...
...
ee/spec/presenters/projects/prometheus/alert_presenter_spec.rb
View file @
bf85c3f7
...
...
@@ -116,7 +116,7 @@ describe Projects::Prometheus::AlertPresenter do
**Start time:**
#{
presenter
.
starts_at
}#{
markdown_line_break
}
**Service:** service_name
#{
markdown_line_break
}
**Monitoring tool:** monitoring_tool_name
#{
markdown_line_break
}
**Hosts:**
[http://localhost:3000](http://localhost:3000) [http://localhost:3001](http://localhost:3001)
**Hosts:**
http://localhost:3000 http://localhost:3001
#### Alert Details
...
...
@@ -137,7 +137,7 @@ describe Projects::Prometheus::AlertPresenter do
#### Summary
**Start time:**
#{
presenter
.
starts_at
}#{
markdown_line_break
}
**Hosts:**
[http://localhost:3000](http://localhost:3000)
**Hosts:**
http://localhost:3000
MARKDOWN
)
...
...
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