Skip to content

Commit

Permalink
Port 7003 ocean failure in the entity processing is failing the resync (
Browse files Browse the repository at this point in the history
#408)

# Description

What - A failure in the entity processing step might fail the whole
resync
Why - The error handling was moved
How - Changed the way the entity processor handled tasks

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)
  • Loading branch information
yairsimantov20 authored Mar 3, 2024
1 parent 4ea179e commit 9ee0201
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

## 0.5.4 (2024-03-03)


### Bug Fixes

- Fixed an issue where a failure in the entity processing step might fail the whole resync (#1)


## 0.5.3 (2024-03-03)


Expand Down
16 changes: 7 additions & 9 deletions port_ocean/core/handlers/entity_processor/jq_entity_processor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import functools
from asyncio import TaskGroup
from functools import lru_cache
from typing import Any

Expand Down Expand Up @@ -51,14 +50,13 @@ async def _search_as_object(
self, data: dict[str, Any], obj: dict[str, Any]
) -> dict[str, Any | None]:
search_tasks = {}
async with TaskGroup() as tg:
for key, value in obj.items():
if isinstance(value, dict):
search_tasks[key] = tg.create_task(
self._search_as_object(data, value)
)
else:
search_tasks[key] = tg.create_task(self._search(data, value))
for key, value in obj.items():
if isinstance(value, dict):
search_tasks[key] = asyncio.create_task(
self._search_as_object(data, value)
)
else:
search_tasks[key] = asyncio.create_task(self._search(data, value))

result: dict[str, Any | None] = {}
for key, task in search_tasks.items():
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.5.3"
version = "0.5.4"
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 9ee0201

Please sign in to comment.