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:
- due date
- created 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))
- iid
- title
......
......@@ -16,6 +16,7 @@ module BulkImports
has_next_page: hasNextPage
}
nodes {
iid
title
description
state
......
......@@ -30,8 +30,8 @@ RSpec.describe BulkImports::Groups::Pipelines::MilestonesPipeline do
describe '#run' do
it 'imports group milestones' do
first_page = extracted_data(title: 'milestone1', has_next_page: true)
last_page = extracted_data(title: 'milestone2')
first_page = extracted_data(title: 'milestone1', iid: 1, has_next_page: true)
last_page = extracted_data(title: 'milestone2', iid: 2)
allow_next_instance_of(BulkImports::Common::Extractors::GraphqlExtractor) do |extractor|
allow(extractor)
......@@ -96,10 +96,11 @@ RSpec.describe BulkImports::Groups::Pipelines::MilestonesPipeline do
end
end
def milestone_data(title)
def milestone_data(title, iid: 1)
{
'title' => title,
'description' => 'desc',
'iid' => iid,
'state' => 'closed',
'start_date' => '2020-10-21',
'due_date' => '2020-10-22',
......@@ -108,14 +109,14 @@ RSpec.describe BulkImports::Groups::Pipelines::MilestonesPipeline do
}
end
def extracted_data(title:, has_next_page: false)
def extracted_data(title:, iid: 1, has_next_page: false)
page_info = {
'has_next_page' => has_next_page,
'next_page' => has_next_page ? 'cursor' : nil
}
BulkImports::Pipeline::ExtractedData.new(
data: milestone_data(title),
data: milestone_data(title, iid: iid),
page_info: page_info
)
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