Commit d9aa3605 authored by Kassio Borges's avatar Kassio Borges

BulkImports: Rename "end_cursor" to "next_page"

This decouples the ExtractedData object from what type of Extractor is
being used. Using "end_cursor" is too coupled with GraphQL vocabulary.
parent 549ea1d9
...@@ -14,7 +14,7 @@ module EE ...@@ -14,7 +14,7 @@ module EE
epic(iid: $epic_iid) { epic(iid: $epic_iid) {
award_emoji: awardEmoji(first: 100, after: $cursor) { award_emoji: awardEmoji(first: 100, after: $cursor) {
page_info: pageInfo { page_info: pageInfo {
end_cursor: endCursor next_page: endCursor
has_next_page: hasNextPage has_next_page: hasNextPage
} }
nodes { nodes {
......
...@@ -14,7 +14,7 @@ module EE ...@@ -14,7 +14,7 @@ module EE
epic(iid: $epic_iid) { epic(iid: $epic_iid) {
events(first: 100, after: $cursor) { events(first: 100, after: $cursor) {
page_info: pageInfo { page_info: pageInfo {
end_cursor: endCursor next_page: endCursor
has_next_page: hasNextPage has_next_page: hasNextPage
} }
nodes { nodes {
......
...@@ -17,7 +17,7 @@ module EE ...@@ -17,7 +17,7 @@ module EE
after: $cursor after: $cursor
) { ) {
page_info: pageInfo { page_info: pageInfo {
end_cursor: endCursor next_page: endCursor
has_next_page: hasNextPage has_next_page: hasNextPage
} }
nodes { nodes {
......
...@@ -13,7 +13,7 @@ module EE ...@@ -13,7 +13,7 @@ module EE
group(fullPath: $full_path) { group(fullPath: $full_path) {
iterations(first: 100, after: $cursor, includeAncestors: false) { iterations(first: 100, after: $cursor, includeAncestors: false) {
page_info: pageInfo { page_info: pageInfo {
end_cursor: endCursor next_page: endCursor
has_next_page: hasNextPage has_next_page: hasNextPage
} }
nodes { nodes {
......
...@@ -125,7 +125,7 @@ RSpec.describe EE::BulkImports::Groups::Pipelines::EpicAwardEmojiPipeline do ...@@ -125,7 +125,7 @@ RSpec.describe EE::BulkImports::Groups::Pipelines::EpicAwardEmojiPipeline do
page_info = { page_info = {
'has_next_page' => has_next_page, 'has_next_page' => has_next_page,
'end_cursor' => has_next_page ? 'cursor' : nil 'next_page' => has_next_page ? 'cursor' : nil
} }
BulkImports::Pipeline::ExtractedData.new(data: data, page_info: page_info) BulkImports::Pipeline::ExtractedData.new(data: data, page_info: page_info)
......
...@@ -171,7 +171,7 @@ RSpec.describe EE::BulkImports::Groups::Pipelines::EpicEventsPipeline do ...@@ -171,7 +171,7 @@ RSpec.describe EE::BulkImports::Groups::Pipelines::EpicEventsPipeline do
page_info = { page_info = {
'has_next_page' => has_next_page, 'has_next_page' => has_next_page,
'end_cursor' => has_next_page ? 'cursor' : nil 'next_page' => has_next_page ? 'cursor' : nil
} }
BulkImports::Pipeline::ExtractedData.new( BulkImports::Pipeline::ExtractedData.new(
......
...@@ -146,7 +146,7 @@ RSpec.describe EE::BulkImports::Groups::Pipelines::EpicsPipeline, :clean_gitlab_ ...@@ -146,7 +146,7 @@ RSpec.describe EE::BulkImports::Groups::Pipelines::EpicsPipeline, :clean_gitlab_
page_info = { page_info = {
'has_next_page' => has_next_page, 'has_next_page' => has_next_page,
'end_cursor' => has_next_page ? 'cursor' : nil 'next_page' => has_next_page ? 'cursor' : nil
} }
BulkImports::Pipeline::ExtractedData.new(data: data, page_info: page_info) BulkImports::Pipeline::ExtractedData.new(data: data, page_info: page_info)
......
...@@ -112,7 +112,7 @@ RSpec.describe EE::BulkImports::Groups::Pipelines::IterationsPipeline do ...@@ -112,7 +112,7 @@ RSpec.describe EE::BulkImports::Groups::Pipelines::IterationsPipeline do
def extracted_data(title:, start_date: Date.today, has_next_page: false) def extracted_data(title:, start_date: Date.today, has_next_page: false)
page_info = { page_info = {
'has_next_page' => has_next_page, 'has_next_page' => has_next_page,
'end_cursor' => has_next_page ? 'cursor' : nil 'next_page' => has_next_page ? 'cursor' : nil
} }
BulkImports::Pipeline::ExtractedData.new( BulkImports::Pipeline::ExtractedData.new(
......
...@@ -12,7 +12,7 @@ module BulkImports ...@@ -12,7 +12,7 @@ module BulkImports
group(fullPath: $full_path) { group(fullPath: $full_path) {
labels(first: 100, after: $cursor, onlyGroupLabels: true) { labels(first: 100, after: $cursor, onlyGroupLabels: true) {
page_info: pageInfo { page_info: pageInfo {
end_cursor: endCursor next_page: endCursor
has_next_page: hasNextPage has_next_page: hasNextPage
} }
nodes { nodes {
......
...@@ -11,7 +11,7 @@ module BulkImports ...@@ -11,7 +11,7 @@ module BulkImports
group(fullPath: $full_path) { group(fullPath: $full_path) {
group_members: groupMembers(relations: DIRECT, first: 100, after: $cursor) { group_members: groupMembers(relations: DIRECT, first: 100, after: $cursor) {
page_info: pageInfo { page_info: pageInfo {
end_cursor: endCursor next_page: endCursor
has_next_page: hasNextPage has_next_page: hasNextPage
} }
nodes { nodes {
......
...@@ -12,7 +12,7 @@ module BulkImports ...@@ -12,7 +12,7 @@ module BulkImports
group(fullPath: $full_path) { group(fullPath: $full_path) {
milestones(first: 100, after: $cursor, includeDescendants: false) { milestones(first: 100, after: $cursor, includeDescendants: false) {
page_info: pageInfo { page_info: pageInfo {
end_cursor: endCursor next_page: endCursor
has_next_page: hasNextPage has_next_page: hasNextPage
} }
nodes { nodes {
......
...@@ -18,7 +18,7 @@ module BulkImports ...@@ -18,7 +18,7 @@ module BulkImports
end end
def next_page def next_page
@page_info&.dig('end_cursor') @page_info&.dig('next_page')
end end
def each(&block) def each(&block)
......
...@@ -94,7 +94,7 @@ RSpec.describe BulkImports::Groups::Pipelines::LabelsPipeline do ...@@ -94,7 +94,7 @@ RSpec.describe BulkImports::Groups::Pipelines::LabelsPipeline do
def extracted_data(title:, has_next_page: false) def extracted_data(title:, has_next_page: false)
page_info = { page_info = {
'has_next_page' => has_next_page, 'has_next_page' => has_next_page,
'end_cursor' => has_next_page ? 'cursor' : nil 'next_page' => has_next_page ? 'cursor' : nil
} }
BulkImports::Pipeline::ExtractedData.new(data: [label_data(title)], page_info: page_info) BulkImports::Pipeline::ExtractedData.new(data: [label_data(title)], page_info: page_info)
......
...@@ -103,7 +103,7 @@ RSpec.describe BulkImports::Groups::Pipelines::MembersPipeline do ...@@ -103,7 +103,7 @@ RSpec.describe BulkImports::Groups::Pipelines::MembersPipeline do
page_info = { page_info = {
'has_next_page' => has_next_page, 'has_next_page' => has_next_page,
'end_cursor' => has_next_page ? 'cursor' : nil 'next_page' => has_next_page ? 'cursor' : nil
} }
BulkImports::Pipeline::ExtractedData.new(data: data, page_info: page_info) BulkImports::Pipeline::ExtractedData.new(data: data, page_info: page_info)
......
...@@ -111,7 +111,7 @@ RSpec.describe BulkImports::Groups::Pipelines::MilestonesPipeline do ...@@ -111,7 +111,7 @@ RSpec.describe BulkImports::Groups::Pipelines::MilestonesPipeline do
def extracted_data(title:, has_next_page: false) def extracted_data(title:, has_next_page: false)
page_info = { page_info = {
'has_next_page' => has_next_page, 'has_next_page' => has_next_page,
'end_cursor' => has_next_page ? 'cursor' : nil 'next_page' => has_next_page ? 'cursor' : nil
} }
BulkImports::Pipeline::ExtractedData.new( BulkImports::Pipeline::ExtractedData.new(
......
...@@ -9,7 +9,7 @@ RSpec.describe BulkImports::Pipeline::ExtractedData do ...@@ -9,7 +9,7 @@ RSpec.describe BulkImports::Pipeline::ExtractedData do
let(:page_info) do let(:page_info) do
{ {
'has_next_page' => has_next_page, 'has_next_page' => has_next_page,
'end_cursor' => cursor 'next_page' => cursor
} }
end end
......
...@@ -245,7 +245,7 @@ RSpec.describe BulkImports::Pipeline::Runner do ...@@ -245,7 +245,7 @@ RSpec.describe BulkImports::Pipeline::Runner do
data: { foo: :bar }, data: { foo: :bar },
page_info: { page_info: {
'has_next_page' => has_next_page, 'has_next_page' => has_next_page,
'end_cursor' => has_next_page ? 'cursor' : nil 'next_page' => has_next_page ? 'cursor' : nil
} }
) )
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