Skip to content

Commit 65a4ca0

Browse files
committed
Merge branch 'update-AI-api' of https://github.com/port-labs/port-docs into update-AI-api
2 parents a37eaa7 + a9036dd commit 65a4ca0

File tree

2 files changed

+72
-4
lines changed
  • docs
    • actions-and-automations/setup-backend/webhook/port-execution-agent
    • build-your-software-catalog/customize-integrations/configure-data-model/setup-blueprint/properties/calculation-property

2 files changed

+72
-4
lines changed

docs/actions-and-automations/setup-backend/webhook/port-execution-agent/usage.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ Use the following Helm values:
8888
- Set `selfSignedCertificate.enabled` to `true`.
8989
- Put your PEM-encoded CA content in `selfSignedCertificate.certificate`.
9090

91+
The certificate should be mounted to `/usr/local/share/ca-certificates/`.
92+
9193
`REQUESTS_CA_BUNDLE` is an environment variable used to specify a custom Certificate Authority (CA) bundle for verifying SSL/TLS certificates in HTTPS requests.
9294

9395
Set `REQUESTS_CA_BUNDLE` to the file path of your CA bundle, which should contain one or more CA certificates in PEM format.
@@ -103,10 +105,11 @@ This configuration directs the `requests` library to use the specified CA bundle
103105

104106
Use the following Helm values:
105107
- Keep your certificate via `selfSignedCertificate` as above.
106-
- Add other certificates by supplying files via `extraVolumes` and mounting them with `extraVolumeMounts` into the container.
108+
- Add other certificates by supplying files via `extraVolumes` and mounting them with `extraVolumeMounts` into the container at `/usr/local/share/ca-certificates/<your-cert-name>.crt`.
107109

108-
:::info Certificate file requirement
109-
Each certificate must be provided in a separate PEM file. Files containing multiple certificates are not supported.
110+
:::info Certificate file requirements
111+
- Each certificate must be provided in a separate PEM file. Files containing multiple certificates are not supported.
112+
- Certificates must be mounted to `/usr/local/share/ca-certificates/` with a `.crt` file extension.
110113
:::
111114

112115
## Next Steps

docs/build-your-software-catalog/customize-integrations/configure-data-model/setup-blueprint/properties/calculation-property/calculation-property.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Calculation properties allow you to use existing properties defined on blueprint
1616
- Create math equations or modifications. For example, calculate required disk storage by specifying page size, and number of pages needed.
1717
- Merge complex properties, including deep-merge and overriding.
1818

19-
## 💡 Common calculation usage
19+
## Common calculation usage
2020

2121
Calculation properties make it easier to define properties that are based on values from other properties, with the added ability to transform the data, for example:
2222

@@ -402,6 +402,71 @@ Parameter contains special characters (for example: `-`) or starts with a digit
402402

403403
:::
404404

405+
## Performance impact
406+
407+
When defined on blueprints with many entities, calculation properties might have negative performance impact, causing long entities table loading time.
408+
409+
If you are facing long loading time for entities table of a blueprint with calculation properties, we recommend replacing the calculation property with a regular property by calculating the needed value on the entity creation itself if possible.
410+
411+
### Replacing calculation property
412+
413+
Let's demonstrate this with an example:
414+
415+
Suppose we have a `Deployment` blueprint with a string property called `name` and a calculation property called `URL` that is based on the name property.
416+
417+
```json showLineNumbers
418+
{
419+
"identifier": "deployment",
420+
"title": "Deployment",
421+
"properties":{
422+
"name":{
423+
"type": "string"
424+
},
425+
},
426+
"calculationProperties": {
427+
"URL": {
428+
"type": "string",
429+
"calculation": "'https://' + .properties.name + '.port.io'",
430+
}
431+
}
432+
}
433+
```
434+
435+
We can avoid this calculation property by create a new string property called `url_temp` (This name is temporary and will be updated once we confirm it has successfully replaced the calculation property). Then we can take the calculation property jq expression and put it directly in the [mapping](/build-your-software-catalog/customize-integrations/configure-mapping) section when we map our entities on creation.
436+
437+
```yaml showLineNumbers
438+
resources:
439+
- kind: repository
440+
selector:
441+
query: "true"
442+
port:
443+
entity:
444+
mappings:
445+
identifier: ".name"
446+
title: ".name"
447+
blueprint: '"deployment"'
448+
properties:
449+
# highlight-start
450+
name: ".name"
451+
url_temp: "'https://' + .name + '.port.io'"
452+
# highlight-end
453+
```
454+
455+
Once done, `url_temp` will match the `URL` calculation property when the entity is created.
456+
457+
### Handling existing entities
458+
459+
While the new property works for newly created entities, existing entities still rely on the calculation property for their URL value.
460+
461+
You can handle this in two ways:
462+
463+
1. **Resync all entities** so the mapping change we applied also affects existing entities.
464+
2. **Create a** [**Port migration**](/build-your-software-catalog/customize-integrations/configure-data-model/migrate-data/) on the blueprint, to populate the new property with URL values for existing entities.
465+
466+
After completing these steps and verifying that the calculation property has been successfully replaced, we can remove the old `URL` property and rename the identifier of the `url_temp` to be `URL`.
467+
468+
If you prefer not to delete the old property right away, you can first exclude it from the entities table using the [excluded properties](/customize-pages-dashboards-and-plugins/page/catalog-page#excluded-properties) and see if there is any performance improvement.
469+
405470
## Examples
406471

407472
Refer to the calculation property [examples](./examples.md) page.

0 commit comments

Comments
 (0)