BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
f677aa7d
Commit
f677aa7d
authored
Feb 02, 2018
by
James Lopez
Committed by
Stan Hu
Feb 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix label issue
parent
54a575f1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
relation_factory.rb
lib/gitlab/import_export/relation_factory.rb
+2
-3
project_tree_restorer_spec.rb
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+2
-0
No files found.
lib/gitlab/import_export/relation_factory.rb
View file @
f677aa7d
...
...
@@ -139,13 +139,12 @@ module Gitlab
end
def
setup_label
return
unless
@relation_hash
[
'type'
]
==
'GroupLabel'
# If there's no group, move the label to a project label
if
@relation_hash
[
'group_id'
]
if
@relation_hash
[
'
type'
]
==
'GroupLabel'
&&
@relation_hash
[
'
group_id'
]
@relation_hash
[
'project_id'
]
=
nil
@relation_name
=
:group_label
else
@relation_hash
[
'group_id'
]
=
nil
@relation_hash
[
'type'
]
=
'ProjectLabel'
end
end
...
...
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
View file @
f677aa7d
...
...
@@ -236,12 +236,14 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
labels
=
project
.
issues
.
first
.
labels
expect
(
labels
.
where
(
type:
"ProjectLabel"
).
count
).
to
eq
(
results
.
fetch
(
:first_issue_labels
,
0
))
expect
(
labels
.
where
(
type:
"ProjectLabel"
).
where
.
not
(
group_id:
nil
).
count
).
to
eq
(
0
)
end
end
shared_examples
'restores group correctly'
do
|**
results
|
it
'has group label'
do
expect
(
project
.
group
.
labels
.
size
).
to
eq
(
results
.
fetch
(
:labels
,
0
))
expect
(
project
.
group
.
labels
.
where
(
type:
"GroupLabel"
).
where
.
not
(
project_id:
nil
).
count
).
to
eq
(
0
)
end
it
'has group milestone'
do
...
...
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