Skip to content

Commit f99960f

Browse files
authored
Merge pull request #2964 from port-labs/PORT-16655-bug-gitlab-v-2-mapping-examples-for-file-kinds-are-incorrect
Port 16655 bug gitlab v 2 mapping examples for file kinds are incorrect
2 parents 3c23a91 + 8e81e3d commit f99960f

File tree

4 files changed

+99
-15
lines changed

4 files changed

+99
-15
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<details>
2+
<summary><b>Team blueprint (click to expand)</b></summary>
3+
```json showLineNumbers
4+
{
5+
"identifier": "team",
6+
"title": "team",
7+
"icon": "Team",
8+
"schema": {
9+
"properties": {
10+
"description": {
11+
"type": "string",
12+
"title": "Description"
13+
},
14+
"slack_channel_name": {
15+
"type": "string",
16+
"title": "Slack channel name"
17+
}
18+
},
19+
"required": [
20+
"description"
21+
]
22+
},
23+
"mirrorProperties": {},
24+
"calculationProperties": {},
25+
"aggregationProperties": {},
26+
"relations": {}
27+
}
28+
```
29+
</details>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<details>
2+
<summary><b>YAML file example (click to expand)</b></summary>
3+
```yaml showLineNumbers
4+
blueprint: team
5+
identifier: team
6+
title: development_team
7+
properties:
8+
description: Development team
9+
slack_channel_name: development-team
10+
```
11+
</details>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<details>
2+
<summary><b>Integration mapping (click to expand)</b></summary>
3+
```yaml showLineNumbers
4+
resources:
5+
- kind: file
6+
selector:
7+
query: 'true'
8+
files:
9+
path: teams_file.yml
10+
repos:
11+
# Replace with your repository's path_with_namespace (e.g., "group/project" or "group/subgroup/project")
12+
- getport-labs/my-project
13+
port:
14+
entity:
15+
mappings:
16+
# Note that when parsing a YAML file, you should specify the index of the parsed document event when there is only one document.
17+
#highlight-start
18+
identifier: .file.content.[0].identifier
19+
title: .file.content.[0].title
20+
blueprint: .file.content.[0].blueprint
21+
properties:
22+
slack_channel_name: .file.content.[0].properties.slack_channel_name
23+
description: .file.content.[0].properties.description
24+
#highlight-end
25+
```
26+
</details>

docs/build-your-software-catalog/sync-data-to-catalog/git/gitlab-v2/examples.md

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,18 @@ import ReleaseBlueprint from './example-releases/_gitlab_integration_example_rel
2828
import ReleaseConfig from './example-releases/_gitlab_integration_example_release_config.mdx'
2929
import TagBlueprint from './example-tags/_gitlab_integration_example_tag_blueprint.mdx'
3030
import TagConfig from './example-tags/_gitlab_integration_example_tag_config.mdx'
31+
import TeamBlueprint from './example-files/_gitlab_integration_example_team_blueprint.mdx'
32+
import YamlConfig from './example-files/_gitlab_integration_example_yaml_config.mdx'
33+
import TeamsYamlFileExample from './example-files/_gitlab_integration_example_team_yaml_file_example.mdx'
3134

3235
import Tabs from "@theme/Tabs"
3336
import TabItem from "@theme/TabItem"
3437

3538
# Examples
3639

37-
## Mapping groups
40+
## Mapping examples
41+
42+
### Groups
3843

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

5762

5863

59-
## Mapping projects, README.md and merge requests
64+
### Projects, README.md and merge requests
6065

6166
:::caution Merge request access requirement
6267
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.
@@ -75,7 +80,7 @@ You can use the following Port blueprint definitions and integration configurati
7580

7681
<MergeRequestConfig />
7782

78-
### Merge request configuration options
83+
#### Merge request configuration options
7984

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

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

134139

135140

136-
## Mapping projects and issues
141+
### Projects and issues
137142

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

156161

157162

158-
## Mapping files and file contents
163+
### Files and file contents
164+
165+
Below are two examples for mapping files and contents:
159166

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

167174
The example will parse the `package.json` file in your repository and extract the dependencies into Port entities.
168-
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)
169175

176+
___
177+
178+
The following example shows how to ingest teams from a YAML file in your GitLab repository into Port.
179+
180+
<TeamBlueprint/>
181+
182+
<TeamsYamlFileExample/>
183+
184+
<YamlConfig/>
185+
186+
The example will parse the YAML file in your repository and extract the teams into Port entities.
170187

188+
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).
171189

172-
## Mapping projects and monorepos
190+
### Projects and monorepos
173191

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

219237

220238

221-
## Mapping projects and folders
239+
### Projects and folders
222240

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

250-
## Mapping members and group with members
268+
### Mapping members and group with members
251269

252-
### Prerequisites
270+
#### Prerequisites
253271

254272
- When using **GitLab Self Hosted**, an admin token is required, rather than a group access token, to retrieve the `primary email addresses` of members.
255273
- 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).
@@ -258,7 +276,7 @@ resources:
258276
Primary email addresses are not available for GitLab "Free plan" users.
259277
:::
260278

261-
### Mapping members
279+
#### Mapping members
262280

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

270288

271289

272-
### Mapping groups with members
290+
#### Mapping groups with members
273291

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

316334

317-
## Mapping projects, pipelines and jobs
335+
### Projects, pipelines and jobs
318336

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

336354
:::
337355

338-
## Mapping releases
356+
### Releases
339357

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

353371
:::
354372

355-
## Mapping tags
373+
### Tags
356374

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

0 commit comments

Comments
 (0)