Skip to content

Commit 9e3d79a

Browse files
committed
update the docs with the new example and remove the mapping word from the headers
1 parent fa7492f commit 9e3d79a

File tree

5 files changed

+102
-59
lines changed

5 files changed

+102
-59
lines changed
Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
import Tabs from "@theme/Tabs"
2-
import TabItem from "@theme/TabItem"
3-
41
<details>
52
<summary><b>Integration mapping (click to expand)</b></summary>
6-
7-
<Tabs groupId="integration-mapping" defaultValue="json" values={[
8-
{ label: "JSON", value: "json" },
9-
{ label: "YAML", value: "yaml" }
10-
]}>
11-
12-
<TabItem value="json">
13-
```yaml showLineNumbers title="Integration mapping JSON file"
3+
```yaml showLineNumbers
144
resources:
155
- kind: file
166
selector:
@@ -21,7 +11,7 @@ resources:
2111
# Replace with your repository's path_with_namespace (e.g., "group/project" or "group/subgroup/project")
2212
- group/my-project
2313
port:
24-
itemsToParse: .file.content.dependencies | to_entries
14+
itemsToParse: .file.content.dependencies | to_entries
2515
entity:
2616
mappings:
2717
identifier: >-
@@ -33,34 +23,4 @@ resources:
3323
package: .item.key
3424
version: .item.value
3525
```
36-
</TabItem>
37-
<TabItem value="yaml">
38-
```yaml showLineNumbers title="Integration mapping YAML file"
39-
resources:
40-
- kind: file
41-
selector:
42-
query: 'true'
43-
files:
44-
path: config.yml
45-
repos:
46-
# Replace with your repository's path_with_namespace (e.g., "group/project" or "group/subgroup/project")
47-
- group/my-project
48-
port:
49-
# Note that when parsing a YAML file, you should specify the index the parsed document.
50-
# highlight-start
51-
itemsToParse: .file.content.[0].dependencies | to_entries
52-
# highlight-end
53-
entity:
54-
mappings:
55-
identifier: >-
56-
.item.key + "_" + if (.item.value | startswith("^")) then
57-
.item.value[1:] else .item.value end
58-
title: .item.key + "@" + .item.value
59-
blueprint: '"package"'
60-
properties:
61-
package: .item.key
62-
version: .item.value
63-
```
64-
</TabItem>
65-
</Tabs>
6626
</details>
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: 34 additions & 17 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:
@@ -164,13 +171,23 @@ You can use the following Port blueprint definitions and integration configurati
164171

165172
<PackageConfig />
166173

167-
The integration mapping example above demonstrates both a JSON file (`package.json`) and a YAML file (`config.yml`) configuration.
168-
The example will parse the file in your repository and extract the dependencies into Port entities.
169-
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).
174+
The example will parse the `package.json` file in your repository and extract the dependencies into Port entities.
175+
176+
___
177+
178+
The following example shows how to ingest teams from a YAML file in your GitLab repository into Port.
170179

180+
<TeamBlueprint/>
171181

182+
<YamlConfig/>
183+
184+
<TeamsYamlFileExample/>
185+
186+
The example will parse the YAML file in your repository and extract the teams into Port entities.
187+
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).
172189

173-
## Mapping projects and monorepos
190+
### Projects and monorepos
174191

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

220237

221238

222-
## Mapping projects and folders
239+
### Projects and folders
223240

224241
The following example demonstrates how to ingest your GitLab projects and their folders to Port.
225242
You can use the following Port blueprint definitions and integration configuration:
@@ -248,9 +265,9 @@ resources:
248265
```
249266
:::
250267

251-
## Mapping members and group with members
268+
### Mapping members and group with members
252269

253-
### Prerequisites
270+
#### Prerequisites
254271

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

262-
### Mapping members
279+
#### Mapping members
263280

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

271288

272289

273-
### Mapping groups with members
290+
#### Mapping groups with members
274291

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

317334

318-
## Mapping projects, pipelines and jobs
335+
### Projects, pipelines and jobs
319336

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

337354
:::
338355

339-
## Mapping releases
356+
### Releases
340357

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

354371
:::
355372

356-
## Mapping tags
373+
## Tags
357374

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

0 commit comments

Comments
 (0)