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
f09c27dd
Commit
f09c27dd
authored
Oct 14, 2021
by
Allen Cook
Committed by
Doug Stull
Oct 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "GitLab Migration - Migrate Issue Boards"
parent
6eff0eaa
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
111 additions
and
56 deletions
+111
-56
ee/spec/lib/bulk_imports/common/pipelines/boards_pipeline_spec.rb
...lib/bulk_imports/common/pipelines/boards_pipeline_spec.rb
+2
-1
ee/spec/lib/ee/bulk_imports/groups/stage_spec.rb
ee/spec/lib/ee/bulk_imports/groups/stage_spec.rb
+1
-1
lib/bulk_imports/common/pipelines/boards_pipeline.rb
lib/bulk_imports/common/pipelines/boards_pipeline.rb
+1
-1
lib/bulk_imports/groups/stage.rb
lib/bulk_imports/groups/stage.rb
+1
-1
lib/bulk_imports/projects/stage.rb
lib/bulk_imports/projects/stage.rb
+5
-1
spec/lib/bulk_imports/common/pipelines/boards_pipeline_spec.rb
...lib/bulk_imports/common/pipelines/boards_pipeline_spec.rb
+98
-0
spec/lib/bulk_imports/groups/pipelines/boards_pipeline_spec.rb
...lib/bulk_imports/groups/pipelines/boards_pipeline_spec.rb
+0
-49
spec/lib/bulk_imports/groups/stage_spec.rb
spec/lib/bulk_imports/groups/stage_spec.rb
+1
-1
spec/lib/bulk_imports/projects/stage_spec.rb
spec/lib/bulk_imports/projects/stage_spec.rb
+2
-1
No files found.
ee/spec/lib/bulk_imports/
groups
/pipelines/boards_pipeline_spec.rb
→
ee/spec/lib/bulk_imports/
common
/pipelines/boards_pipeline_spec.rb
View file @
f09c27dd
...
@@ -2,11 +2,12 @@
...
@@ -2,11 +2,12 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
BulkImports
::
Groups
::
Pipelines
::
BoardsPipeline
do
RSpec
.
describe
BulkImports
::
Common
::
Pipelines
::
BoardsPipeline
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:bulk_import
)
{
create
(
:bulk_import
,
user:
user
)
}
let_it_be
(
:bulk_import
)
{
create
(
:bulk_import
,
user:
user
)
}
let_it_be
(
:filepath
)
{
'ee/spec/fixtures/bulk_imports/gz/boards.ndjson.gz'
}
let_it_be
(
:filepath
)
{
'ee/spec/fixtures/bulk_imports/gz/boards.ndjson.gz'
}
let_it_be
(
:entity
)
do
let_it_be
(
:entity
)
do
create
(
create
(
:bulk_import_entity
,
:bulk_import_entity
,
...
...
ee/spec/lib/ee/bulk_imports/groups/stage_spec.rb
View file @
f09c27dd
...
@@ -14,7 +14,7 @@ RSpec.describe BulkImports::Groups::Stage do
...
@@ -14,7 +14,7 @@ RSpec.describe BulkImports::Groups::Stage do
[
1
,
BulkImports
::
Groups
::
Pipelines
::
BadgesPipeline
],
[
1
,
BulkImports
::
Groups
::
Pipelines
::
BadgesPipeline
],
[
1
,
BulkImports
::
Groups
::
Pipelines
::
IterationsPipeline
],
[
1
,
BulkImports
::
Groups
::
Pipelines
::
IterationsPipeline
],
[
1
,
BulkImports
::
Groups
::
Pipelines
::
ProjectEntitiesPipeline
],
[
1
,
BulkImports
::
Groups
::
Pipelines
::
ProjectEntitiesPipeline
],
[
2
,
BulkImports
::
Groups
::
Pipelines
::
BoardsPipeline
],
[
2
,
BulkImports
::
Common
::
Pipelines
::
BoardsPipeline
],
[
2
,
BulkImports
::
Groups
::
Pipelines
::
EpicsPipeline
],
[
2
,
BulkImports
::
Groups
::
Pipelines
::
EpicsPipeline
],
[
4
,
BulkImports
::
Common
::
Pipelines
::
EntityFinisher
]
[
4
,
BulkImports
::
Common
::
Pipelines
::
EntityFinisher
]
]
]
...
...
lib/bulk_imports/
groups
/pipelines/boards_pipeline.rb
→
lib/bulk_imports/
common
/pipelines/boards_pipeline.rb
View file @
f09c27dd
# frozen_string_literal: true
# frozen_string_literal: true
module
BulkImports
module
BulkImports
module
Groups
module
Common
module
Pipelines
module
Pipelines
class
BoardsPipeline
class
BoardsPipeline
include
NdjsonPipeline
include
NdjsonPipeline
...
...
lib/bulk_imports/groups/stage.rb
View file @
f09c27dd
...
@@ -36,7 +36,7 @@ module BulkImports
...
@@ -36,7 +36,7 @@ module BulkImports
stage:
1
stage:
1
},
},
boards:
{
boards:
{
pipeline:
BulkImports
::
Groups
::
Pipelines
::
BoardsPipeline
,
pipeline:
BulkImports
::
Common
::
Pipelines
::
BoardsPipeline
,
stage:
2
stage:
2
},
},
finisher:
{
finisher:
{
...
...
lib/bulk_imports/projects/stage.rb
View file @
f09c27dd
...
@@ -23,9 +23,13 @@ module BulkImports
...
@@ -23,9 +23,13 @@ module BulkImports
pipeline:
BulkImports
::
Projects
::
Pipelines
::
IssuesPipeline
,
pipeline:
BulkImports
::
Projects
::
Pipelines
::
IssuesPipeline
,
stage:
3
stage:
3
},
},
boards:
{
pipeline:
BulkImports
::
Common
::
Pipelines
::
BoardsPipeline
,
stage:
4
},
finisher:
{
finisher:
{
pipeline:
BulkImports
::
Common
::
Pipelines
::
EntityFinisher
,
pipeline:
BulkImports
::
Common
::
Pipelines
::
EntityFinisher
,
stage:
4
stage:
5
}
}
}
}
end
end
...
...
spec/lib/bulk_imports/common/pipelines/boards_pipeline_spec.rb
0 → 100644
View file @
f09c27dd
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
BulkImports
::
Common
::
Pipelines
::
BoardsPipeline
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
group:
group
)
}
let_it_be
(
:bulk_import
)
{
create
(
:bulk_import
,
user:
user
)
}
let
(
:board_data
)
do
{
"name"
=>
"Test Board"
,
"lists"
=>
[
{
"list_type"
=>
"backlog"
,
"position"
=>
0
},
{
"list_type"
=>
"closed"
,
"position"
=>
1
},
{
"list_type"
=>
"label"
,
"position"
=>
2
,
"label"
=>
{
"title"
=>
"test"
,
"type"
=>
"GroupLabel"
,
"group_id"
=>
group
.
id
}
}
]
}
end
let
(
:tracker
)
{
create
(
:bulk_import_tracker
,
entity:
entity
)
}
let
(
:context
)
{
BulkImports
::
Pipeline
::
Context
.
new
(
tracker
)
}
subject
{
described_class
.
new
(
context
)
}
before
do
allow_next_instance_of
(
BulkImports
::
Common
::
Extractors
::
NdjsonExtractor
)
do
|
extractor
|
allow
(
extractor
).
to
receive
(
:extract
).
and_return
(
BulkImports
::
Pipeline
::
ExtractedData
.
new
(
data:
board_data
))
end
group
.
add_owner
(
user
)
end
context
'when issue board belongs to a project'
do
let_it_be
(
:entity
)
do
create
(
:bulk_import_entity
,
source_type: :project_entity
,
project:
project
,
bulk_import:
bulk_import
,
source_full_path:
'source/full/path'
,
destination_name:
'My Destination Group'
,
destination_namespace:
group
.
full_path
)
end
describe
'#run'
do
it
'imports issue boards into destination project'
do
expect
{
subject
.
run
}.
to
change
(
::
Board
,
:count
).
by
(
1
)
board
=
project
.
boards
.
find_by
(
name:
board_data
[
"name"
])
expect
(
board
).
to
be
expect
(
board
.
project
.
id
).
to
eq
(
project
.
id
)
expect
(
board
.
lists
.
count
).
to
eq
(
3
)
expect
(
board
.
lists
.
map
(
&
:list_type
).
sort
).
to
match_array
(
%w(backlog closed label)
)
expect
(
board
.
lists
.
find_by
(
list_type:
"label"
).
label
.
title
).
to
eq
(
"test"
)
end
end
end
context
'when issue board belongs to a group'
do
let_it_be
(
:entity
)
do
create
(
:bulk_import_entity
,
group:
group
,
bulk_import:
bulk_import
,
source_full_path:
'source/full/path'
,
destination_name:
'My Destination Group'
,
destination_namespace:
group
.
full_path
)
end
describe
'#run'
do
it
'imports issue boards into destination group'
do
expect
{
subject
.
run
}.
to
change
(
::
Board
,
:count
).
by
(
1
)
board
=
group
.
boards
.
find_by
(
name:
board_data
[
"name"
])
expect
(
board
).
to
be
expect
(
board
.
group
.
id
).
to
eq
(
group
.
id
)
expect
(
board
.
lists
.
count
).
to
eq
(
3
)
expect
(
board
.
lists
.
map
(
&
:list_type
).
sort
).
to
match_array
(
%w(backlog closed label)
)
expect
(
board
.
lists
.
find_by
(
list_type:
"label"
).
label
.
title
).
to
eq
(
"test"
)
end
end
end
end
spec/lib/bulk_imports/groups/pipelines/boards_pipeline_spec.rb
deleted
100644 → 0
View file @
6eff0eaa
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
BulkImports
::
Groups
::
Pipelines
::
BoardsPipeline
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:bulk_import
)
{
create
(
:bulk_import
,
user:
user
)
}
let_it_be
(
:filepath
)
{
'spec/fixtures/bulk_imports/gz/boards.ndjson.gz'
}
let_it_be
(
:entity
)
do
create
(
:bulk_import_entity
,
group:
group
,
bulk_import:
bulk_import
,
source_full_path:
'source/full/path'
,
destination_name:
'My Destination Group'
,
destination_namespace:
group
.
full_path
)
end
let_it_be
(
:tracker
)
{
create
(
:bulk_import_tracker
,
entity:
entity
)
}
let_it_be
(
:context
)
{
BulkImports
::
Pipeline
::
Context
.
new
(
tracker
)
}
let
(
:tmpdir
)
{
Dir
.
mktmpdir
}
before
do
FileUtils
.
copy_file
(
filepath
,
File
.
join
(
tmpdir
,
'boards.ndjson.gz'
))
group
.
add_owner
(
user
)
end
subject
{
described_class
.
new
(
context
)
}
describe
'#run'
do
it
'imports group boards into destination group and removes tmpdir'
do
allow
(
Dir
).
to
receive
(
:mktmpdir
).
and_return
(
tmpdir
)
allow_next_instance_of
(
BulkImports
::
FileDownloadService
)
do
|
service
|
allow
(
service
).
to
receive
(
:execute
)
end
expect
{
subject
.
run
}.
to
change
(
Board
,
:count
).
by
(
1
)
lists
=
group
.
boards
.
find_by
(
name:
'first board'
).
lists
expect
(
lists
.
count
).
to
eq
(
3
)
expect
(
lists
.
first
.
label
.
title
).
to
eq
(
'TSL'
)
expect
(
lists
.
second
.
label
.
title
).
to
eq
(
'Sosync'
)
end
end
end
spec/lib/bulk_imports/groups/stage_spec.rb
View file @
f09c27dd
...
@@ -14,7 +14,7 @@ RSpec.describe BulkImports::Groups::Stage do
...
@@ -14,7 +14,7 @@ RSpec.describe BulkImports::Groups::Stage do
[
1
,
BulkImports
::
Common
::
Pipelines
::
LabelsPipeline
],
[
1
,
BulkImports
::
Common
::
Pipelines
::
LabelsPipeline
],
[
1
,
BulkImports
::
Groups
::
Pipelines
::
MilestonesPipeline
],
[
1
,
BulkImports
::
Groups
::
Pipelines
::
MilestonesPipeline
],
[
1
,
BulkImports
::
Groups
::
Pipelines
::
BadgesPipeline
],
[
1
,
BulkImports
::
Groups
::
Pipelines
::
BadgesPipeline
],
[
2
,
BulkImports
::
Groups
::
Pipelines
::
BoardsPipeline
]
[
2
,
BulkImports
::
Common
::
Pipelines
::
BoardsPipeline
]
]
]
end
end
...
...
spec/lib/bulk_imports/projects/stage_spec.rb
View file @
f09c27dd
...
@@ -9,7 +9,8 @@ RSpec.describe BulkImports::Projects::Stage do
...
@@ -9,7 +9,8 @@ RSpec.describe BulkImports::Projects::Stage do
[
1
,
BulkImports
::
Projects
::
Pipelines
::
RepositoryPipeline
],
[
1
,
BulkImports
::
Projects
::
Pipelines
::
RepositoryPipeline
],
[
2
,
BulkImports
::
Common
::
Pipelines
::
LabelsPipeline
],
[
2
,
BulkImports
::
Common
::
Pipelines
::
LabelsPipeline
],
[
3
,
BulkImports
::
Projects
::
Pipelines
::
IssuesPipeline
],
[
3
,
BulkImports
::
Projects
::
Pipelines
::
IssuesPipeline
],
[
4
,
BulkImports
::
Common
::
Pipelines
::
EntityFinisher
]
[
4
,
BulkImports
::
Common
::
Pipelines
::
BoardsPipeline
],
[
5
,
BulkImports
::
Common
::
Pipelines
::
EntityFinisher
]
]
]
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