get group members via graphQL

The new `getGroupMembers` method replaces the existing `getUserMemberships` on
`GitLabClient`.

Signed-off-by: Jamie Klassen <jklassen@vmware.com>
This commit is contained in:
Jamie Klassen
2023-03-14 16:11:29 -04:00
parent 3984e7b44d
commit 7b1b7bfdb7
7 changed files with 132 additions and 86 deletions
+13 -12
View File
@@ -2,15 +2,14 @@
id: org
title: GitLab Organizational Data
sidebar_label: Org Data
description: Importing users and groups from a GitLab organization into Backstage
description: Importing users and groups from GitLab into Backstage
---
The Backstage catalog can be set up to ingest organizational data - users and
teams - directly from an organization in GitLab. The result
is a hierarchy of
The Backstage catalog can be set up to ingest organizational data -- users and
groups -- directly from GitLab. The result is a hierarchy of
[`User`](../../features/software-catalog/descriptor-format.md#kind-user) and
[`Group`](../../features/software-catalog/descriptor-format.md#kind-group) kind
entities that mirror your org setup.
[`Group`](../../features/software-catalog/descriptor-format.md#kind-group)
entities that mirrors your org setup.
```yaml
integrations:
@@ -19,10 +18,11 @@ integrations:
token: ${GITLAB_TOKEN}
```
This will query all users and groups from your gitlab installation. Depending on the size
of the Gitlab Instance, this can take some time and resources.
This will query all users and groups from your GitLab instance. Depending on the
amount of data, this can take significant time and resources.
The token that is used for the Organization Integration, has to be an Admin Personal Access Token (PAT).
The token used must have the `read_api` scope, and the Users and Groups fetched
will be those visible to the account which provisioned the token.
```yaml
catalog:
@@ -35,6 +35,7 @@ catalog:
groupPattern: '[\s\S]*' # Optional. Filters found groups based on provided pattern. Defaults to `[\s\S]*`, which means to not filter anything
```
When the `group` parameter is provided, the corresponding path prefix will be stripped out from each matching group
when computing the unique entity name. e.g. If `group` is `org/teams`, the name for `org/teams/avengers/gotg` will
be `avengers-gotg`.
When the `group` parameter is provided, the corresponding path prefix will be
stripped out from each matching group when computing the unique entity name.
e.g. If `group` is `org/teams`, the name for `org/teams/avengers/gotg` will be
`avengers-gotg`.