Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<details>
<summary><b>Team blueprint (click to expand)</b></summary>
```json showLineNumbers
{
"identifier": "team",
"title": "team",
"icon": "Team",
"schema": {
"properties": {
"description": {
"type": "string",
"title": "Description"
},
"slack_channel_name": {
"type": "string",
"title": "Slack channel name"
}
},
"required": [
"description"
]
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {}
}
```
</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<details>
<summary><b>YAML file example (click to expand)</b></summary>
```yaml showLineNumbers
blueprint: team
identifier: team
title: development_team
properties:
description: Development team
slack_channel_name: development-team
```
</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<details>
<summary><b>Integration mapping (click to expand)</b></summary>
```yaml showLineNumbers
resources:
- kind: file
selector:
query: 'true'
files:
path: teams_file.yml
repos:
# Replace with your repository's path_with_namespace (e.g., "group/project" or "group/subgroup/project")
- getport-labs/my-project
port:
entity:
mappings:
# Note that when parsing a YAML file, you should specify the index of the parsed document event when there is only one document.
#highlight-start
identifier: .file.content.[0].identifier
title: .file.content.[0].title
blueprint: .file.content.[0].blueprint
properties:
slack_channel_name: .file.content.[0].properties.slack_channel_name
description: .file.content.[0].properties.description
#highlight-end
```
</details>
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,18 @@ import ReleaseBlueprint from './example-releases/_gitlab_integration_example_rel
import ReleaseConfig from './example-releases/_gitlab_integration_example_release_config.mdx'
import TagBlueprint from './example-tags/_gitlab_integration_example_tag_blueprint.mdx'
import TagConfig from './example-tags/_gitlab_integration_example_tag_config.mdx'
import TeamBlueprint from './example-files/_gitlab_integration_example_team_blueprint.mdx'
import YamlConfig from './example-files/_gitlab_integration_example_yaml_config.mdx'
import TeamsYamlFileExample from './example-files/_gitlab_integration_example_team_yaml_file_example.mdx'

import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"

# Examples

## Mapping groups
## Mapping examples

### Groups

The following example demonstrates how to ingest your GitLab groups, subgroups and projects to Port.
You can use the following Port blueprint definitions and integration configuration:
Expand All @@ -56,7 +61,7 @@ You can use the following Port blueprint definitions and integration configurati



## Mapping projects, README.md and merge requests
### Projects, README.md and merge requests

:::caution Merge request access requirement
Merge requests are fetched at the **group level**. Ensure your integration token has access to the parent GitLab group that contains your projects. Project-level access alone is not sufficient for merge request visibility.
Expand All @@ -75,7 +80,7 @@ You can use the following Port blueprint definitions and integration configurati

<MergeRequestConfig />

### Merge request configuration options
#### Merge request configuration options

<Tabs groupId="config" queryString="parameter">

Expand Down Expand Up @@ -133,7 +138,7 @@ By default, if not specified, it is set to `90` days.



## Mapping projects and issues
### Projects and issues

The following example demonstrates how to ingest your GitLab projects and their issues to Port.
You can use the following Port blueprint definitions and integration configuration:
Expand All @@ -155,7 +160,9 @@ You can use the following Port blueprint definitions and integration configurati



## Mapping files and file contents
### Files and file contents

Below are two examples for mapping files and contents:

The following example shows how to ingest dependencies from a `package.json` file in your GitLab repository into Port.
You can use the following Port blueprint definitions and integration configuration:
Expand All @@ -165,11 +172,22 @@ You can use the following Port blueprint definitions and integration configurati
<PackageConfig />

The example will parse the `package.json` file in your repository and extract the dependencies into Port entities.
For more information about ingesting files and file contents, click [here](/build-your-software-catalog/sync-data-to-catalog/git/gitlab-v2/#ingest-files-from-your-repositories)

___

The following example shows how to ingest teams from a YAML file in your GitLab repository into Port.

<TeamBlueprint/>

<TeamsYamlFileExample/>

<YamlConfig/>

The example will parse the YAML file in your repository and extract the teams into Port entities.

For more information about ingesting files and file contents, click [here](/build-your-software-catalog/sync-data-to-catalog/git/gitlab-v2/#ingest-files-from-your-repositories).

## Mapping projects and monorepos
### Projects and monorepos

The following example demonstrates how to ingest your GitLab projects and their monorepo folders to Port.
You can use the following Port blueprint definitions and integration configuration:
Expand Down Expand Up @@ -218,7 +236,7 @@ You can also specify a different path for each monorepo repository, for example:



## Mapping projects and folders
### Projects and folders

The following example demonstrates how to ingest your GitLab projects and their folders to Port.
You can use the following Port blueprint definitions and integration configuration:
Expand Down Expand Up @@ -247,9 +265,9 @@ resources:
```
:::

## Mapping members and group with members
### Mapping members and group with members

### Prerequisites
#### Prerequisites

- When using **GitLab Self Hosted**, an admin token is required, rather than a group access token, to retrieve the `primary email addresses` of members.
- When using **GitLab Enterprise**, accounts can retrieve the `primary email addresses` of members within their groups, provided the members are part of user accounts administered by an organization with [verified domains for groups](https://docs.gitlab.com/ee/user/enterprise_user/#verified-domains-for-groups). For more information, see [limitations](https://docs.gitlab.com/ee/api/members.html#limitations).
Expand All @@ -258,7 +276,7 @@ resources:
Primary email addresses are not available for GitLab "Free plan" users.
:::

### Mapping members
#### Mapping members

The following example demonstrates how to ingest your GitLab members to Port.
You can use the following Port blueprint definitions and integration configuration:
Expand All @@ -269,7 +287,7 @@ You can use the following Port blueprint definitions and integration configurati



### Mapping groups with members
#### Mapping groups with members

The following example demonstrates how to ingest your GitLab groups and their members to Port.
You can use the following Port blueprint definitions and integration configuration:
Expand Down Expand Up @@ -314,7 +332,7 @@ By default, this selector is set to `false`, which means the integration will on
:::


## Mapping projects, pipelines and jobs
### Projects, pipelines and jobs

The following example demonstrates how to ingest your GitLab projects, their pipelines and jobs runs to Port.
You can use the following Port blueprint definitions and integration configuration:
Expand All @@ -335,7 +353,7 @@ You can use the following Port blueprint definitions and integration configurati

:::

## Mapping releases
### Releases

The following example demonstrates how to ingest your GitLab releases to Port.
You can use the following Port blueprint definitions and integration configuration:
Expand All @@ -352,7 +370,7 @@ You can use the following Port blueprint definitions and integration configurati

:::

## Mapping tags
### Tags

The following example demonstrates how to ingest your GitLab tags to Port.
You can use the following Port blueprint definitions and integration configuration:
Expand Down