Commit cda761e2 authored by Alex Kalderimis's avatar Alex Kalderimis

Merge branch 'kassio/bulkimports-filter-group-labels' into 'master'

BulkImports: Avoid import ProjectLabels in the Group import level

See merge request gitlab-org/gitlab!54580
parents 0a58a266 c50cd027
---
title: 'BulkImports: Avoid import ProjectLabels in the Group import level'
merge_request: 54580
author:
type: changed
...@@ -10,7 +10,7 @@ module BulkImports ...@@ -10,7 +10,7 @@ module BulkImports
<<-'GRAPHQL' <<-'GRAPHQL'
query ($full_path: ID!, $cursor: String) { query ($full_path: ID!, $cursor: String) {
group(fullPath: $full_path) { group(fullPath: $full_path) {
labels(first: 100, after: $cursor) { labels(first: 100, after: $cursor, onlyGroupLabels: true) {
page_info: pageInfo { page_info: pageInfo {
end_cursor: endCursor end_cursor: endCursor
has_next_page: hasNextPage has_next_page: hasNextPage
......
...@@ -3,15 +3,18 @@ ...@@ -3,15 +3,18 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe BulkImports::Groups::Graphql::GetLabelsQuery do RSpec.describe BulkImports::Groups::Graphql::GetLabelsQuery do
describe '#variables' do it 'has a valid query' do
let(:entity) { double(source_full_path: 'test', next_page_for: 'next_page', bulk_import: nil) } entity = create(:bulk_import_entity)
let(:context) { BulkImports::Pipeline::Context.new(entity) } context = BulkImports::Pipeline::Context.new(entity)
it 'returns query variables based on entity information' do query = GraphQL::Query.new(
expected = { full_path: entity.source_full_path, cursor: entity.next_page_for } GitlabSchema,
described_class.to_s,
expect(described_class.variables(context)).to eq(expected) variables: described_class.variables(context)
end )
result = GitlabSchema.static_validator.validate(query)
expect(result[:errors]).to be_empty
end end
describe '#data_path' do describe '#data_path' do
......
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