Skip to content

Update all import-related group selection dropdowns to use graphql

Selecting target group for import is vital step for most of importers. However we have 3(!) different ways to retrieve list of available groups for import:

  • Importers, which are using "table view" (GitHub / BitBucket / BitBucket Server / Gitea / etc.)

image

Uses private API https://gitlab.com/import/available_namespaces

  • Import repository from URL

image

Uses graphql API

query searchNamespacesWhereUserCanCreateProjects($search: String) {
  currentUser {
    id
    groups(permissionScope: CREATE_PROJECTS, search: $search) {
      nodes {
        id
        fullPath
        name
        visibility
        webUrl
        __typename
      }
      __typename
    }
    namespace {
      id
      fullPath
      __typename
    }
    __typename
  }
}
  • Manifest importer / Gitlab export importer

image

Uses legacy select2 dropdown and dark HAML magic


As a part of A user with developer role (group) can import p... (#358750 - closed) we're introducing new configuration settings, which means all importers now must respect this configuration settings

I see this as an opportunity to make all our importers consistent. Since graphql support is already being developed by @carlad-gl in Draft: Update graphql types to include project ... (!96666 - closed) I suggest following actions:

  • replacing legacy select2 importer with Vue version which is used in import repository from URL
  • altering "table view importer" to also use graphql and drop private API available_namespaces entirely (it is used solely by importers)