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
def create_issue
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(
project,
user,
title: alert_presenter.title,
description: alert_presenter.issue_description,
**extra_params
label_ids: [label_result.payload[:label].id]
).execute
return error(object_errors(issue), issue) unless issue.valid?
......
......@@ -23,17 +23,12 @@ module IncidentManagement
def create_issue
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(
project,
current_user,
title: issue_title,
description: issue_description,
**extra_params
label_ids: [label_result.payload[:label].id]
).execute
end
......
......@@ -25,17 +25,12 @@ module IncidentManagement
def create_issue
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(
project,
current_user,
title: issue_title,
description: issue_description,
**extra_params
label_ids: [label_result.payload[:label].id]
).execute
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