Skip to content

Commit

Permalink
[Core] Fixed query to make the search easier on port's side (#1338)
Browse files Browse the repository at this point in the history
# Description

What - improvements to reduce port's load

Why - to make the query easier for port

How - added blueprint to the search query

## Type of change

Please leave one option from the following and delete the rest:

- [ ] New feature (non-breaking change which adds functionality)



### Core testing checklist

- [ ] Integration able to create all default resources from scratch
- [ ] Resync finishes successfully
- [ ] Resync able to create entities
- [ ] Resync able to update entities
- [ ] Resync able to detect and delete entities
- [ ] Scheduled resync able to abort existing resync and start a new one
- [ ] Tested with at least 2 integrations from scratch
- [ ] Tested with Kafka and Polling event listeners
- [ ] Tested deletion of entities that don't pass the selector
  • Loading branch information
yaelibarg authored Jan 21, 2025
1 parent aa4190f commit cd6eebb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- towncrier release notes start -->
## 0.18.1 (2025-01-21)

### Improvements

- Updated the search entitites query sent to port with blueprint

## 0.18.0 (2025-01-15)

### Improvements
Expand Down
10 changes: 7 additions & 3 deletions port_ocean/core/integrations/mixins/sync_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _construct_search_query_for_entities(self, entities: list[Entity]) -> dict:
entities (list[Entity]): List of entities to search for.
Returns:
dict: Query structure for searching entities by identifier.
dict: Query structure for searching entities by identifier and blueprint.
"""
return {
"combinator": "and",
Expand All @@ -147,10 +147,14 @@ def _construct_search_query_for_entities(self, entities: list[Entity]) -> dict:
"rules": [
{
"property": "$identifier",
"operator": "in",
"value": [entity.identifier for entity in entities],
},
{
"property": "$blueprint",
"operator": "=",
"value": entity.identifier,
"value": entities[0].blueprint,
}
for entity in entities
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "port-ocean"
version = "0.18.0"
version = "0.18.1"
description = "Port Ocean is a CLI tool for managing your Port projects."
readme = "README.md"
homepage = "https://app.getport.io"
Expand Down

0 comments on commit cd6eebb

Please sign in to comment.