Skip to content

Commit

Permalink
[Core] Fixed query to make the search easier on port's side - second …
Browse files Browse the repository at this point in the history
…improvement (#1341)

# Description

What - improvements to reduce port's load

Why - to make the query easier for port

How - fixed the identifier rule to be one

## Type of change

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

- [ ] Bug fix (non-breaking change which fixes an issue)


<h4> All tests should be run against the port production
environment(using a testing org). </h4>

### 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 22, 2025
1 parent eaa8f73 commit 6a62d81
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 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.2 (2025-01-21)

### Improvements

- Updated the search entitites query sent to port with one rule of identifier instead of many

## 0.18.1 (2025-01-21)

### Improvements
Expand Down
21 changes: 8 additions & 13 deletions port_ocean/core/integrations/mixins/sync_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,14 @@ def _construct_search_query_for_entities(self, entities: list[Entity]) -> dict:
"combinator": "and",
"rules": [
{
"combinator": "or",
"rules": [
{
"property": "$identifier",
"operator": "in",
"value": [entity.identifier for entity in entities],
},
{
"property": "$blueprint",
"operator": "=",
"value": entities[0].blueprint,
}
]
"property": "$identifier",
"operator": "in",
"value": [entity.identifier for entity in entities]
},
{
"property": "$blueprint",
"operator": "=",
"value": entities[0].blueprint
}
]
}
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.1"
version = "0.18.2"
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 6a62d81

Please sign in to comment.