Skip to content

Commit a3ef2ca

Browse files
authored
Merge branch 'main' into add-swagger-link-to-pages
2 parents 9af6c71 + c44397b commit a3ef2ca

File tree

2 files changed

+48
-14
lines changed

2 files changed

+48
-14
lines changed

docs/build-your-software-catalog/sync-data-to-catalog/git/azure-devops/mapping_extensions.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,38 @@ To do so, we will use the `file://` prefix with the path of the file to tell the
4545
url: .remoteUrl
4646
// highlight-next-line
4747
readme: file://README.md
48-
```
48+
```
49+
50+
## Link pipelines to repositories via selector
51+
You can configure your selector to include repository information in the pipeline entity mapping.
52+
This allows you to create a direct relationship between a pipeline and its source repository.
53+
54+
```yaml showLineNumbers
55+
- kind: pipeline
56+
selector:
57+
query: 'true'
58+
# highlight-next-line
59+
includeRepo: 'true'
60+
port:
61+
entity:
62+
mappings:
63+
identifier: .id | tostring
64+
title: .name
65+
blueprint: '"azureDevOpsPipeline"'
66+
properties:
67+
url: .url
68+
revision: .revision
69+
folder: .folder
70+
relations:
71+
project: .__projectId | gsub(" "; "")
72+
repository: >-
73+
if .__repository
74+
then .__repository.project.name + "/" + .__repository.name | gsub(" "; "")
75+
else null
76+
end
77+
```
78+
:::tip Recommendation
79+
Use this only when necessary, as including repository data requires an extra API call per pipeline, which increases the number of requests made and can impact your Azure DevOps API rate limits.
80+
81+
If you don’t require repo-level linkage, it’s more efficient to relate pipelines → projects instead.
82+
:::

docs/guides/all/visualize-service-k8s-runtime.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,32 +106,32 @@ We achieved this by adding a [mapping definition](https://github.com/port-labs/t
106106
apiVersion: apps/v1
107107
kind: Deployment
108108
metadata:
109-
name: awesomeapp
110-
labels:
109+
name: awesomeapp
110+
labels:
111111
app: nginx
112112
portWorkload: AwesomeWorkload
113113
spec:
114-
replicas: 2
115-
selector:
114+
replicas: 2
115+
selector:
116116
matchLabels:
117-
app: nginx
118-
template:
117+
app: nginx
118+
template:
119119
metadata:
120-
labels:
120+
labels:
121121
app: nginx
122122
spec:
123-
containers:
123+
containers:
124124
- name: nginx
125125
image: nginx:1.14.2
126126
resources:
127-
limits:
127+
limits:
128128
cpu: "200m"
129129
memory: "256Mi"
130-
requests:
131-
cpu: "100m"
132-
memory: "128Mi"
130+
requests:
131+
cpu: "100m"
132+
memory: "128Mi"
133133
ports:
134-
- containerPort: 80
134+
- containerPort: 80
135135
```
136136

137137
</details>

0 commit comments

Comments
 (0)