Commit 90dad7a2 authored by charlieablett's avatar charlieablett

Move migrations to post_migrate

- bump docs to 13.2
- remove unneeded spec
parent 6857e1d0
...@@ -259,7 +259,7 @@ Ties are broken arbitrarily. ...@@ -259,7 +259,7 @@ Ties are broken arbitrarily.
In specific circumstances it was possible to create labels with duplicate titles in the same In specific circumstances it was possible to create labels with duplicate titles in the same
namespace. namespace.
To resolve the duplication, [in GitLab 13.1](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21384) To resolve the duplication, [in GitLab 13.2](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21384)
and later, some duplicate labels have `_duplicate<number>` appended to their titles. and later, some duplicate labels have `_duplicate<number>` appended to their titles.
You can safely change these labels' titles if you prefer. You can safely change these labels' titles if you prefer.
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
require Rails.root.join('db', 'migrate', '20200305082754_remove_duplicate_labels_from_project.rb') require Rails.root.join('db', 'post_migrate', '20200305082754_remove_duplicate_labels_from_project.rb')
describe RemoveDuplicateLabelsFromProject do RSpec.describe RemoveDuplicateLabelsFromProject do
let(:labels_table) { table(:labels) } let(:labels_table) { table(:labels) }
let(:labels) { labels_table.all } let(:labels) { labels_table.all }
let(:projects_table) { table(:projects) } let(:projects_table) { table(:projects) }
......
...@@ -54,29 +54,5 @@ RSpec.describe IncidentManagement::CreateIncidentLabelService do ...@@ -54,29 +54,5 @@ RSpec.describe IncidentManagement::CreateIncidentLabelService do
context 'without label' do context 'without label' do
it_behaves_like 'new label' it_behaves_like 'new label'
end end
context 'with duplicate labels', issue: 'https://gitlab.com/gitlab-org/gitlab-foss/issues/65042' do
before do
# Replicate race condition to create duplicates
build(:label, project: project, title: title).save!(validate: false)
build(:label, project: project, title: title).save!(validate: false)
end
it 'create an issue without labels' do
# Verify we have duplicates
expect(project.labels.size).to eq(2)
expect(project.labels.map(&:title)).to all(eq(title))
message = <<~MESSAGE.chomp
Cannot create incident label "incident" \
for "#{project.full_name}": Title has already been taken.
MESSAGE
expect(service).to receive(:log_info).with(message)
expect(execute).to be_error
expect(execute.payload[:label]).to be_kind_of(Label)
expect(execute.message).to eq('Title has already been taken')
end
end
end end
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