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
<<-'GRAPHQL'
query ($full_path: ID!, $cursor: String) {
group(fullPath: $full_path) {
labels(first: 100, after: $cursor) {
labels(first: 100, after: $cursor, onlyGroupLabels: true) {
page_info: pageInfo {
end_cursor: endCursor
has_next_page: hasNextPage
......
......@@ -3,15 +3,18 @@
require 'spec_helper'
RSpec.describe BulkImports::Groups::Graphql::GetLabelsQuery do
describe '#variables' do
let(:entity) { double(source_full_path: 'test', next_page_for: 'next_page', bulk_import: nil) }
let(:context) { BulkImports::Pipeline::Context.new(entity) }
it 'returns query variables based on entity information' do
expected = { full_path: entity.source_full_path, cursor: entity.next_page_for }
expect(described_class.variables(context)).to eq(expected)
end
it 'has a valid query' do
entity = create(:bulk_import_entity)
context = BulkImports::Pipeline::Context.new(entity)
query = GraphQL::Query.new(
GitlabSchema,
described_class.to_s,
variables: described_class.variables(context)
)
result = GitlabSchema.static_validator.validate(query)
expect(result[:errors]).to be_empty
end
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