Commit 701c618a authored by Nick Thomas's avatar Nick Thomas

Merge branch 'kassio/bulkimports-import-milestone-iid' into 'master'

BulkImports: Import milestone iid

See merge request gitlab-org/gitlab!58107
parents 9c3311b4 dd40a4be
---
title: 'BulkImports: Import milestone iid'
merge_request: 58107
author:
type: changed
...@@ -57,6 +57,7 @@ The following resources are migrated to the target instance: ...@@ -57,6 +57,7 @@ The following resources are migrated to the target instance:
- due date - due date
- created at - created at
- updated at - updated at
- iid ([Introduced in 13.11](https://gitlab.com/gitlab-org/gitlab/-/issues/326157))
- Iterations ([Introduced in 13.10](https://gitlab.com/gitlab-org/gitlab/-/issues/292428)) - Iterations ([Introduced in 13.10](https://gitlab.com/gitlab-org/gitlab/-/issues/292428))
- iid - iid
- title - title
......
...@@ -16,6 +16,7 @@ module BulkImports ...@@ -16,6 +16,7 @@ module BulkImports
has_next_page: hasNextPage has_next_page: hasNextPage
} }
nodes { nodes {
iid
title title
description description
state state
......
...@@ -30,8 +30,8 @@ RSpec.describe BulkImports::Groups::Pipelines::MilestonesPipeline do ...@@ -30,8 +30,8 @@ RSpec.describe BulkImports::Groups::Pipelines::MilestonesPipeline do
describe '#run' do describe '#run' do
it 'imports group milestones' do it 'imports group milestones' do
first_page = extracted_data(title: 'milestone1', has_next_page: true) first_page = extracted_data(title: 'milestone1', iid: 1, has_next_page: true)
last_page = extracted_data(title: 'milestone2') last_page = extracted_data(title: 'milestone2', iid: 2)
allow_next_instance_of(BulkImports::Common::Extractors::GraphqlExtractor) do |extractor| allow_next_instance_of(BulkImports::Common::Extractors::GraphqlExtractor) do |extractor|
allow(extractor) allow(extractor)
...@@ -96,10 +96,11 @@ RSpec.describe BulkImports::Groups::Pipelines::MilestonesPipeline do ...@@ -96,10 +96,11 @@ RSpec.describe BulkImports::Groups::Pipelines::MilestonesPipeline do
end end
end end
def milestone_data(title) def milestone_data(title, iid: 1)
{ {
'title' => title, 'title' => title,
'description' => 'desc', 'description' => 'desc',
'iid' => iid,
'state' => 'closed', 'state' => 'closed',
'start_date' => '2020-10-21', 'start_date' => '2020-10-21',
'due_date' => '2020-10-22', 'due_date' => '2020-10-22',
...@@ -108,14 +109,14 @@ RSpec.describe BulkImports::Groups::Pipelines::MilestonesPipeline do ...@@ -108,14 +109,14 @@ RSpec.describe BulkImports::Groups::Pipelines::MilestonesPipeline do
} }
end end
def extracted_data(title:, has_next_page: false) def extracted_data(title:, iid: 1, has_next_page: false)
page_info = { page_info = {
'has_next_page' => has_next_page, 'has_next_page' => has_next_page,
'next_page' => has_next_page ? 'cursor' : nil 'next_page' => has_next_page ? 'cursor' : nil
} }
BulkImports::Pipeline::ExtractedData.new( BulkImports::Pipeline::ExtractedData.new(
data: milestone_data(title), data: milestone_data(title, iid: iid),
page_info: page_info page_info: page_info
) )
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