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
90dad7a2
Commit
90dad7a2
authored
Jun 22, 2020
by
charlieablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move migrations to post_migrate
- bump docs to 13.2 - remove unneeded spec
parent
6857e1d0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
27 deletions
+3
-27
db/post_migrate/20200305082754_remove_duplicate_labels_from_project.rb
...te/20200305082754_remove_duplicate_labels_from_project.rb
+0
-0
db/post_migrate/20200305082858_add_uniqueness_index_to_label_title_and_project.rb
...082858_add_uniqueness_index_to_label_title_and_project.rb
+0
-0
doc/user/project/labels.md
doc/user/project/labels.md
+1
-1
spec/migrations/remove_duplicate_labels_from_project_spec.rb
spec/migrations/remove_duplicate_labels_from_project_spec.rb
+2
-2
spec/services/incident_management/create_incident_label_service_spec.rb
...incident_management/create_incident_label_service_spec.rb
+0
-24
No files found.
db/migrate/20200305082754_remove_duplicate_labels_from_project.rb
→
db/
post_
migrate/20200305082754_remove_duplicate_labels_from_project.rb
View file @
90dad7a2
File moved
db/migrate/20200305082858_add_uniqueness_index_to_label_title_and_project.rb
→
db/
post_
migrate/20200305082858_add_uniqueness_index_to_label_title_and_project.rb
View file @
90dad7a2
File moved
doc/user/project/labels.md
View file @
90dad7a2
...
...
@@ -259,7 +259,7 @@ Ties are broken arbitrarily.
In specific circumstances it was possible to create labels with duplicate titles in the same
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.
You can safely change these labels' titles if you prefer.
...
...
spec/migrations/remove_duplicate_labels_from_project_spec.rb
View file @
90dad7a2
# frozen_string_literal: true
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
)
{
labels_table
.
all
}
let
(
:projects_table
)
{
table
(
:projects
)
}
...
...
spec/services/incident_management/create_incident_label_service_spec.rb
View file @
90dad7a2
...
...
@@ -54,29 +54,5 @@ RSpec.describe IncidentManagement::CreateIncidentLabelService do
context
'without label'
do
it_behaves_like
'new label'
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
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