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
ebdabb5f
Commit
ebdabb5f
authored
Feb 18, 2020
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix markdown layout of incident issues
parent
2e069f6e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
app/services/incident_management/create_issue_service.rb
app/services/incident_management/create_issue_service.rb
+1
-1
changelogs/unreleased/pl-incident-issue-hline.yml
changelogs/unreleased/pl-incident-issue-hline.yml
+5
-0
spec/services/incident_management/create_issue_service_spec.rb
...services/incident_management/create_issue_service_spec.rb
+7
-6
No files found.
app/services/incident_management/create_issue_service.rb
View file @
ebdabb5f
...
...
@@ -58,7 +58,7 @@ module IncidentManagement
end
def
issue_description
horizontal_line
=
"
\n
---
\n\n
"
horizontal_line
=
"
\n
\n
---
\n\n
"
[
alert_summary
,
...
...
changelogs/unreleased/pl-incident-issue-hline.yml
0 → 100644
View file @
ebdabb5f
---
title
:
Fix markdown layout of incident issues
merge_request
:
25352
author
:
type
:
fixed
spec/services/incident_management/create_issue_service_spec.rb
View file @
ebdabb5f
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
describe
IncidentManagement
::
CreateIssueService
do
let
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
let
(
:user
)
{
User
.
alert_bot
}
let
_it_be
(
:user
)
{
User
.
alert_bot
}
let
(
:service
)
{
described_class
.
new
(
project
,
alert_payload
)
}
let
(
:alert_starts_at
)
{
Time
.
now
}
let
(
:alert_title
)
{
'TITLE'
}
...
...
@@ -29,7 +29,6 @@ describe IncidentManagement::CreateIssueService do
context
'when create_issue enabled'
do
let
(
:issue
)
{
subject
[
:issue
]
}
let
(
:summary_separator
)
{
"
\n
---
\n\n
"
}
before
do
setting
.
update!
(
create_issue:
true
)
...
...
@@ -42,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
.
strip
)
expect
(
separator_count
(
issue
.
description
)).
to
eq
0
expect
(
separator_count
(
issue
.
description
)).
to
eq
(
0
)
end
end
...
...
@@ -74,7 +73,7 @@ describe IncidentManagement::CreateIssueService do
expect
(
subject
).
to
include
(
status: :success
)
expect
(
issue
.
description
).
to
include
(
alert_presenter
.
issue_summary_markdown
)
expect
(
separator_count
(
issue
.
description
)).
to
eq
1
expect
(
separator_count
(
issue
.
description
)).
to
eq
(
1
)
expect
(
issue
.
description
).
to
include
(
template_content
)
end
end
...
...
@@ -134,7 +133,7 @@ describe IncidentManagement::CreateIssueService do
expect
(
issue
.
description
).
to
include
(
alert_presenter
.
issue_summary_markdown
)
expect
(
issue
.
description
).
to
include
(
template_content
)
expect
(
issue
.
description
).
to
include
(
alt_template
)
expect
(
separator_count
(
issue
.
description
)).
to
eq
2
expect
(
separator_count
(
issue
.
description
)).
to
eq
(
2
)
end
end
...
...
@@ -171,7 +170,7 @@ describe IncidentManagement::CreateIssueService do
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
.
strip
)
expect
(
separator_count
(
issue
.
description
)).
to
eq
0
expect
(
separator_count
(
issue
.
description
)).
to
eq
(
0
)
end
end
...
...
@@ -306,6 +305,8 @@ describe IncidentManagement::CreateIssueService do
end
def
separator_count
(
text
)
summary_separator
=
"
\n\n
---
\n\n
"
text
.
scan
(
summary_separator
).
size
end
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