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
3fb6f6af
Commit
3fb6f6af
authored
Jul 29, 2021
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create issue of type incident from alert factory
Also renames alert's `with_issue` trait to `with_incident`
parent
05476fef
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
9 deletions
+9
-9
spec/factories/alert_management/alerts.rb
spec/factories/alert_management/alerts.rb
+3
-3
spec/mailers/emails/projects_spec.rb
spec/mailers/emails/projects_spec.rb
+1
-1
spec/requests/api/graphql/project/alert_management/alert/issue_spec.rb
.../api/graphql/project/alert_management/alert/issue_spec.rb
+2
-2
spec/requests/api/graphql/project/issues_spec.rb
spec/requests/api/graphql/project/issues_spec.rb
+1
-1
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+1
-1
spec/services/system_notes/alert_management_service_spec.rb
spec/services/system_notes/alert_management_service_spec.rb
+1
-1
No files found.
spec/factories/alert_management/alerts.rb
View file @
3fb6f6af
...
...
@@ -15,9 +15,9 @@ FactoryBot.define do
end
end
trait
:with_i
ssue
do
trait
:with_i
ncident
do
after
(
:create
)
do
|
alert
|
create
(
:i
ssue
,
alert_management_alert:
alert
,
project:
alert
.
project
)
create
(
:i
ncident
,
alert_management_alert:
alert
,
project:
alert
.
project
)
end
end
...
...
@@ -128,7 +128,7 @@ FactoryBot.define do
end
trait
:all_fields
do
with_i
ssue
with_i
ncident
with_assignee
with_fingerprint
with_service
...
...
spec/mailers/emails/projects_spec.rb
View file @
3fb6f6af
...
...
@@ -48,7 +48,7 @@ RSpec.describe Emails::Projects do
end
context
'with incident'
do
let
(
:alert
)
{
create
(
:alert_management_alert
,
:with_i
ssue
,
:from_payload
,
payload:
payload
,
project:
project
)
}
let
(
:alert
)
{
create
(
:alert_management_alert
,
:with_i
ncident
,
:from_payload
,
payload:
payload
,
project:
project
)
}
let
(
:incident
)
{
alert
.
issue
}
it
'has expected X-GitLab incident headers'
,
:aggregate_failures
do
...
...
spec/requests/api/graphql/project/alert_management/alert/issue_spec.rb
View file @
3fb6f6af
...
...
@@ -40,7 +40,7 @@ RSpec.describe 'getting Alert Management Alert Issue' do
context
'with gitlab alert'
do
before
do
create
(
:alert_management_alert
,
:with_i
ssue
,
project:
project
,
payload:
payload
)
create
(
:alert_management_alert
,
:with_i
ncident
,
project:
project
,
payload:
payload
)
end
it
'includes the correct alert issue payload data'
do
...
...
@@ -57,7 +57,7 @@ RSpec.describe 'getting Alert Management Alert Issue' do
context
'with gitlab alert'
do
before
do
create
(
:alert_management_alert
,
:with_i
ssue
,
project:
project
,
payload:
payload
)
create
(
:alert_management_alert
,
:with_i
ncident
,
project:
project
,
payload:
payload
)
end
it
'avoids N+1 queries'
do
...
...
spec/requests/api/graphql/project/issues_spec.rb
View file @
3fb6f6af
...
...
@@ -323,7 +323,7 @@ RSpec.describe 'getting an issue list for a project' do
it
'avoids N+1 queries'
do
control
=
ActiveRecord
::
QueryRecorder
.
new
{
post_graphql
(
query
,
current_user:
current_user
)
}
create
(
:alert_management_alert
,
:with_i
ssue
,
project:
project
)
create
(
:alert_management_alert
,
:with_i
ncident
,
project:
project
)
expect
{
post_graphql
(
query
,
current_user:
current_user
)
}.
not_to
exceed_query_limit
(
control
)
end
...
...
spec/services/system_note_service_spec.rb
View file @
3fb6f6af
...
...
@@ -745,7 +745,7 @@ RSpec.describe SystemNoteService do
end
describe
'.new_alert_issue'
do
let
(
:alert
)
{
build
(
:alert_management_alert
,
:with_i
ssue
)
}
let
(
:alert
)
{
build
(
:alert_management_alert
,
:with_i
ncident
)
}
it
'calls AlertManagementService'
do
expect_next_instance_of
(
SystemNotes
::
AlertManagementService
)
do
|
service
|
...
...
spec/services/system_notes/alert_management_service_spec.rb
View file @
3fb6f6af
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec
.
describe
::
SystemNotes
::
AlertManagementService
do
let_it_be
(
:author
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:noteable
)
{
create
(
:alert_management_alert
,
:with_i
ssue
,
:acknowledged
,
project:
project
)
}
let_it_be
(
:noteable
)
{
create
(
:alert_management_alert
,
:with_i
ncident
,
:acknowledged
,
project:
project
)
}
describe
'#create_new_alert'
do
subject
{
described_class
.
new
(
noteable:
noteable
,
project:
project
).
create_new_alert
(
'Some Service'
)
}
...
...
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