[go: up one dir, main page]

Skip to content

BulkImports: do not attempt to run a pipeline if GraphQL schema does not have required fields

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

Currently when a change is made to GraphQL in order to enable BulkImport to import a certain relation it creates a 'minimum required version' of source GitLab instance (whichever ships that GraphQL changes) in order to support migration of said relation.

E.g. if a change to GraphQL query (to expose a new field) is introduced in 13.10 - a BulkImport pipeline that uses this query needs source GitLab instance to be 13.10 - otherwise a GraphQL syntax error will occur (e.g. "Field 'myField' doesn't exist on type 'Epic'").

This will generate a pipeline error when import is ran. Depending on the type of pipeline it can either be a hard failure (e.g. when gitlab instance does not have Group type present) or a soft one (e.g. epics are not present). If epics are not present that means all other pipelines that import epic relations will fail as well (e.g. epic notes/emojis/events).

We need to make sure we import what we can, skipping everything else that is not present.

Potential solutions

There are a few potential solutions that we can consider:

  1. Source GitLab GraphQL Schema introspection to check what is supported, which features are available and depending on the schema only run particular pipelines (suggestion from !55769 (comment 535674698))
  2. Introduce a 'minimum required version' per pipeline where we check source gitlab version and only run it if source version is greater than the minimum required one. There are a few concerns regarding deprecations in future versions and it's not directly connected to the GraphQL schema. GraphQL schema of a particular instance should be a single source of truth of what is or is not available so this solution is probably not the best one 😄
Edited by 🤖 GitLab Bot 🤖