Upsert entity - option to append/detach relationships rather than overwrite
in progress
M
Mark Tarry
When performing an entity upsert via automations, API, Terraform, GitHub Actions, etc, any relationship values are overwritten with that specified on the upsert request.
This makes maintaining "many" relationships non-trivial, as now the caller must:
- Fetch the current entity state
- Extract the relationship which are to be modified
- Manipulate the relationship arrays
- Perform the upsert API call
Notice the above requires 2 API calls (GET and PATCH) - meaning that, in any scenario where it's possible to have multiple jobs running in parallel (e.g. automations, event-driven workflows), we also now need some form of "transaction locking" in place, to ensure we don't end up with relations being overwritten from a race condition.
M
Maya Margalit
updated the status to
in progress
M
Maya Margalit
Merged in a post:
Ability to Aggregate Relations Across Multiple port.yaml Files
Priya Raghu
Currently, when multiple port.yaml files update the same entity, the relations array gets overwritten by the latest update, and any existing relations are lost. It would be helpful if relations from all port.yaml files can be aggregated to maintain a comprehensive list of relationships across projects.
M
Mark Tarry
I've raised a similar suggestion here: https://roadmap.port.io/ideas/p/upsert-entity-option-to-append-detach-relationships-rather-than-overwrite
M
Mark Tarry
I noticed a similar suggestion here: https://roadmap.port.io/ideas/p/ability-to-aggregate-relations-across-multiple-portyaml-files
But this seemed to focus on GitOps data ingestion, whereas I'm focusing on data pushed via the Port API