Commit da520bc4 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Remove race condition check for incident label

parent 787d3514
...@@ -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?
......
...@@ -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
......
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment