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
da520bc4
Commit
da520bc4
authored
Jul 21, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove race condition check for incident label
parent
787d3514
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
18 deletions
+3
-18
app/services/alert_management/create_alert_issue_service.rb
app/services/alert_management/create_alert_issue_service.rb
+1
-6
app/services/incident_management/create_issue_service.rb
app/services/incident_management/create_issue_service.rb
+1
-6
app/services/incident_management/pager_duty/create_incident_issue_service.rb
...nt_management/pager_duty/create_incident_issue_service.rb
+1
-6
No files found.
app/services/alert_management/create_alert_issue_service.rb
View file @
da520bc4
...
@@ -39,17 +39,12 @@ module AlertManagement
...
@@ -39,17 +39,12 @@ module AlertManagement
def
create_issue
def
create_issue
label_result
=
find_or_create_incident_label
label_result
=
find_or_create_incident_label
# Create an unlabelled issue if we couldn't create the label
# due to a race condition.
# See https://gitlab.com/gitlab-org/gitlab-foss/issues/65042
extra_params
=
label_result
.
success?
?
{
label_ids:
[
label_result
.
payload
[
:label
].
id
]
}
:
{}
issue
=
Issues
::
CreateService
.
new
(
issue
=
Issues
::
CreateService
.
new
(
project
,
project
,
user
,
user
,
title:
alert_presenter
.
title
,
title:
alert_presenter
.
title
,
description:
alert_presenter
.
issue_description
,
description:
alert_presenter
.
issue_description
,
**
extra_params
label_ids:
[
label_result
.
payload
[
:label
].
id
]
).
execute
).
execute
return
error
(
object_errors
(
issue
),
issue
)
unless
issue
.
valid?
return
error
(
object_errors
(
issue
),
issue
)
unless
issue
.
valid?
...
...
app/services/incident_management/create_issue_service.rb
View file @
da520bc4
...
@@ -23,17 +23,12 @@ module IncidentManagement
...
@@ -23,17 +23,12 @@ module IncidentManagement
def
create_issue
def
create_issue
label_result
=
find_or_create_incident_label
label_result
=
find_or_create_incident_label
# Create an unlabelled issue if we couldn't create the label
# due to a race condition.
# See https://gitlab.com/gitlab-org/gitlab-foss/issues/65042
extra_params
=
label_result
.
success?
?
{
label_ids:
[
label_result
.
payload
[
:label
].
id
]
}
:
{}
Issues
::
CreateService
.
new
(
Issues
::
CreateService
.
new
(
project
,
project
,
current_user
,
current_user
,
title:
issue_title
,
title:
issue_title
,
description:
issue_description
,
description:
issue_description
,
**
extra_params
label_ids:
[
label_result
.
payload
[
:label
].
id
]
).
execute
).
execute
end
end
...
...
app/services/incident_management/pager_duty/create_incident_issue_service.rb
View file @
da520bc4
...
@@ -25,17 +25,12 @@ module IncidentManagement
...
@@ -25,17 +25,12 @@ module IncidentManagement
def
create_issue
def
create_issue
label_result
=
find_or_create_incident_label
label_result
=
find_or_create_incident_label
# Create an unlabelled issue if we couldn't create the label
# due to a race condition.
# See https://gitlab.com/gitlab-org/gitlab-foss/issues/65042
extra_params
=
label_result
.
success?
?
{
label_ids:
[
label_result
.
payload
[
:label
].
id
]
}
:
{}
Issues
::
CreateService
.
new
(
Issues
::
CreateService
.
new
(
project
,
project
,
current_user
,
current_user
,
title:
issue_title
,
title:
issue_title
,
description:
issue_description
,
description:
issue_description
,
**
extra_params
label_ids:
[
label_result
.
payload
[
:label
].
id
]
).
execute
).
execute
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