port-ocean 0.12.2.dev6__tar.gz → 0.12.2.dev7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of port-ocean might be problematic. Click here for more details.
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/PKG-INFO +1 -1
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/event_listener/base.py +2 -11
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/mixins/sync_raw.py +92 -91
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/log/handlers.py +7 -8
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/ocean.py +11 -12
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/pyproject.toml +1 -1
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/LICENSE.md +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/README.md +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/bootstrap.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cli.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/defaults/__init___.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/defaults/clean.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/defaults/dock.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/defaults/group.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/list_integrations.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/main.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/new.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/pull.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/sail.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/version.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/cookiecutter.json +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/extensions.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/hooks/post_gen_project.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.dockerignore +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.env.example +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.gitignore +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/.gitignore +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/blueprints.json +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/port-app-config.yml +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/spec.yaml +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CHANGELOG.md +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CONTRIBUTING.md +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Dockerfile +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/README.md +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/changelog/.gitignore +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/debug.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/main.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/poetry.toml +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/pyproject.toml +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/sonar-project.properties +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/test_sample.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/utils.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/authentication.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/client.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/mixins/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/mixins/blueprints.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/mixins/entities.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/mixins/integrations.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/mixins/migrations.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/retry_transport.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/types.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/utils.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/config/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/config/base.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/config/dynamic.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/config/settings.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/consumers/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/consumers/kafka_consumer.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/context/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/context/event.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/context/ocean.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/context/resource.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/defaults/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/defaults/clean.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/defaults/common.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/defaults/initialize.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/event_listener/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/event_listener/factory.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/event_listener/http.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/event_listener/kafka.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/event_listener/once.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/event_listener/polling.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/base.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/entities_state_applier/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/entities_state_applier/base.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/entities_state_applier/port/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/entities_state_applier/port/applier.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/entities_state_applier/port/get_related_entities.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/entities_state_applier/port/order_by_entities_dependencies.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/entity_processor/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/entity_processor/base.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/entity_processor/jq_entity_processor.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/port_app_config/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/port_app_config/api.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/port_app_config/base.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/port_app_config/models.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/resync_state_updater/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/resync_state_updater/updater.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/base.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/mixins/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/mixins/events.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/mixins/handler.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/mixins/sync.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/mixins/utils.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/models.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/ocean_types.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/utils.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/exceptions/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/exceptions/api.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/exceptions/base.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/exceptions/clients.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/exceptions/context.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/exceptions/core.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/exceptions/port_defaults.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/exceptions/utils.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/helpers/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/helpers/async_client.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/helpers/retry.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/log/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/log/logger_setup.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/log/sensetive.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/middlewares.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/py.typed +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/run.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/sonar-project.properties +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/tests/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/tests/clients/port/mixins/test_entities.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/tests/conftest.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/tests/core/handlers/entity_processor/test_jq_entity_processor.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/tests/helpers/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/tests/helpers/fixtures.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/tests/helpers/integration.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/tests/helpers/ocean_app.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/tests/helpers/port_client.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/tests/helpers/smoke_test.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/tests/test_smoke.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/utils/__init__.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/utils/async_http.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/utils/async_iterators.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/utils/cache.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/utils/misc.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/utils/queue_utils.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/utils/repeat.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/utils/signal.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/utils/time.py +0 -0
- {port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/version.py +0 -0
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import asyncio
|
|
2
1
|
from abc import abstractmethod
|
|
3
|
-
from concurrent.futures import ProcessPoolExecutor
|
|
4
2
|
from typing import TypedDict, Callable, Any, Awaitable
|
|
5
3
|
|
|
6
4
|
from pydantic import Extra
|
|
7
5
|
|
|
8
6
|
from port_ocean.config.base import BaseOceanModel
|
|
7
|
+
from port_ocean.utils.signal import signal_handler
|
|
9
8
|
from port_ocean.context.ocean import ocean
|
|
10
9
|
from port_ocean.utils.misc import IntegrationStateStatus
|
|
11
|
-
from port_ocean.utils.signal import signal_handler
|
|
12
10
|
|
|
13
11
|
|
|
14
12
|
class EventListenerEvents(TypedDict):
|
|
@@ -69,14 +67,7 @@ class BaseEventListener:
|
|
|
69
67
|
"""
|
|
70
68
|
await self._before_resync()
|
|
71
69
|
try:
|
|
72
|
-
|
|
73
|
-
with ProcessPoolExecutor() as executor:
|
|
74
|
-
e = executor.submit(
|
|
75
|
-
lambda: asyncio.run_coroutine_threadsafe(
|
|
76
|
-
self.events["on_resync"](resync_args), loop
|
|
77
|
-
)
|
|
78
|
-
)
|
|
79
|
-
signal_handler.register(e.cancel)
|
|
70
|
+
await self.events["on_resync"](resync_args)
|
|
80
71
|
await self._after_resync()
|
|
81
72
|
except Exception as e:
|
|
82
73
|
await self._on_resync_failure(e)
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/mixins/sync_raw.py
RENAMED
|
@@ -140,11 +140,11 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
|
140
140
|
objects_diff = await self._calculate_raw(
|
|
141
141
|
[(resource, results)], parse_all, send_raw_data_examples_amount
|
|
142
142
|
)
|
|
143
|
-
await self.entities_state_applier.upsert(
|
|
143
|
+
modified_objects = await self.entities_state_applier.upsert(
|
|
144
144
|
objects_diff[0].entity_selector_diff.passed, user_agent_type
|
|
145
145
|
)
|
|
146
146
|
return CalculationResult(
|
|
147
|
-
objects_diff[0].entity_selector_diff._replace(passed=
|
|
147
|
+
objects_diff[0].entity_selector_diff._replace(passed=modified_objects),
|
|
148
148
|
errors=objects_diff[0].errors,
|
|
149
149
|
)
|
|
150
150
|
|
|
@@ -173,48 +173,49 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
|
173
173
|
self, resource_config: ResourceConfig, user_agent_type: UserAgentType
|
|
174
174
|
) -> tuple[list[Entity], list[Exception]]:
|
|
175
175
|
results, errors = await self._get_resource_raw_results(resource_config)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
)
|
|
176
|
+
passed_entities = []
|
|
177
|
+
# async_generators: list[ASYNC_GENERATOR_RESYNC_TYPE] = []
|
|
178
|
+
# raw_results: RAW_RESULT = []
|
|
179
|
+
# for result in results:
|
|
180
|
+
# if isinstance(result, dict):
|
|
181
|
+
# raw_results.append(result)
|
|
182
|
+
# else:
|
|
183
|
+
# async_generators.append(result)
|
|
184
|
+
#
|
|
185
|
+
# send_raw_data_examples_amount = (
|
|
186
|
+
# SEND_RAW_DATA_EXAMPLES_AMOUNT if ocean.config.send_raw_data_examples else 0
|
|
187
|
+
# )
|
|
188
|
+
# all_entities, register_errors = await self._register_resource_raw(
|
|
189
|
+
# resource_config,
|
|
190
|
+
# raw_results,
|
|
191
|
+
# user_agent_type,
|
|
192
|
+
# send_raw_data_examples_amount=send_raw_data_examples_amount,
|
|
193
|
+
# )
|
|
194
|
+
# errors.extend(register_errors)
|
|
195
|
+
# passed_entities = list(all_entities.passed)
|
|
196
|
+
#
|
|
197
|
+
# for generator in async_generators:
|
|
198
|
+
# try:
|
|
199
|
+
# async for items in generator:
|
|
200
|
+
# if send_raw_data_examples_amount > 0:
|
|
201
|
+
# send_raw_data_examples_amount = max(
|
|
202
|
+
# 0, send_raw_data_examples_amount - len(passed_entities)
|
|
203
|
+
# )
|
|
204
|
+
#
|
|
205
|
+
# entities, register_errors = await self._register_resource_raw(
|
|
206
|
+
# resource_config,
|
|
207
|
+
# items,
|
|
208
|
+
# user_agent_type,
|
|
209
|
+
# send_raw_data_examples_amount=send_raw_data_examples_amount,
|
|
210
|
+
# )
|
|
211
|
+
# errors.extend(register_errors)
|
|
212
|
+
# passed_entities.extend(entities.passed)
|
|
213
|
+
# except* OceanAbortException as error:
|
|
214
|
+
# errors.append(error)
|
|
215
|
+
#
|
|
216
|
+
# logger.info(
|
|
217
|
+
# f"Finished registering change for {len(results)} raw results for kind: {resource_config.kind}. {len(passed_entities)} entities were affected"
|
|
218
|
+
# )
|
|
218
219
|
return passed_entities, errors
|
|
219
220
|
|
|
220
221
|
async def register_raw(
|
|
@@ -426,20 +427,20 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
|
426
427
|
use_cache=False
|
|
427
428
|
)
|
|
428
429
|
logger.info(f"Resync will use the following mappings: {app_config.dict()}")
|
|
429
|
-
try:
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
except httpx.HTTPError as e:
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
430
|
+
# try:
|
|
431
|
+
# did_fetched_current_state = True
|
|
432
|
+
# entities_at_port = await ocean.port_client.search_entities(
|
|
433
|
+
# user_agent_type
|
|
434
|
+
# )
|
|
435
|
+
# except httpx.HTTPError as e:
|
|
436
|
+
# logger.warning(
|
|
437
|
+
# "Failed to fetch the current state of entities at Port. "
|
|
438
|
+
# "Skipping delete phase due to unknown initial state. "
|
|
439
|
+
# f"Error: {e}\n"
|
|
440
|
+
# f"Response status code: {e.response.status_code if isinstance(e, httpx.HTTPStatusError) else None}\n"
|
|
441
|
+
# f"Response content: {e.response.text if isinstance(e, httpx.HTTPStatusError) else None}\n"
|
|
442
|
+
# )
|
|
443
|
+
# did_fetched_current_state = False
|
|
443
444
|
|
|
444
445
|
creation_results: list[tuple[list[Entity], list[Exception]]] = []
|
|
445
446
|
|
|
@@ -458,36 +459,36 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
|
458
459
|
except asyncio.CancelledError as e:
|
|
459
460
|
logger.warning("Resync aborted successfully, skipping delete phase. This leads to an incomplete state")
|
|
460
461
|
raise
|
|
461
|
-
else:
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
462
|
+
# else:
|
|
463
|
+
# if not did_fetched_current_state:
|
|
464
|
+
# logger.warning(
|
|
465
|
+
# "Due to an error before the resync, the previous state of entities at Port is unknown."
|
|
466
|
+
# " Skipping delete phase due to unknown initial state."
|
|
467
|
+
# )
|
|
468
|
+
# return
|
|
469
|
+
#
|
|
470
|
+
# logger.info("Starting resync diff calculation")
|
|
471
|
+
# flat_created_entities, errors = zip_and_sum(creation_results) or [
|
|
472
|
+
# [],
|
|
473
|
+
# [],
|
|
474
|
+
# ]
|
|
475
|
+
#
|
|
476
|
+
# if errors:
|
|
477
|
+
# message = f"Resync failed with {len(errors)}. Skipping delete phase due to incomplete state"
|
|
478
|
+
# error_group = ExceptionGroup(
|
|
479
|
+
# f"Resync failed with {len(errors)}. Skipping delete phase due to incomplete state",
|
|
480
|
+
# errors,
|
|
481
|
+
# )
|
|
482
|
+
# if not silent:
|
|
483
|
+
# raise error_group
|
|
484
|
+
#
|
|
485
|
+
# logger.error(message, exc_info=error_group)
|
|
486
|
+
# else:
|
|
487
|
+
# logger.info(
|
|
488
|
+
# f"Running resync diff calculation, number of entities at Port before resync: {len(entities_at_port)}, number of entities created during sync: {len(flat_created_entities)}"
|
|
489
|
+
# )
|
|
490
|
+
# await self.entities_state_applier.delete_diff(
|
|
491
|
+
# {"before": entities_at_port, "after": flat_created_entities},
|
|
492
|
+
# user_agent_type,
|
|
493
|
+
# )
|
|
494
|
+
# logger.info("Resync finished successfully")
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import logging
|
|
3
3
|
import sys
|
|
4
|
+
import threading
|
|
4
5
|
import time
|
|
5
|
-
from concurrent.futures import ProcessPoolExecutor
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
from logging.handlers import MemoryHandler
|
|
8
8
|
from typing import Any
|
|
@@ -65,19 +65,18 @@ class HTTPMemoryHandler(MemoryHandler):
|
|
|
65
65
|
if self.ocean is None or not self.buffer:
|
|
66
66
|
return
|
|
67
67
|
|
|
68
|
+
def _wrap_event_loop(_ocean: Ocean, logs_to_send: list[dict[str, Any]]) -> None:
|
|
69
|
+
loop = asyncio.new_event_loop()
|
|
70
|
+
loop.run_until_complete(self.send_logs(_ocean, logs_to_send))
|
|
71
|
+
loop.close()
|
|
72
|
+
|
|
68
73
|
self.acquire()
|
|
69
74
|
logs = list(self._serialized_buffer)
|
|
70
75
|
if logs:
|
|
71
76
|
self.buffer.clear()
|
|
72
77
|
self._serialized_buffer.clear()
|
|
73
78
|
self.last_flush_time = time.time()
|
|
74
|
-
|
|
75
|
-
with ProcessPoolExecutor() as executor:
|
|
76
|
-
executor.submit(
|
|
77
|
-
lambda: asyncio.run_coroutine_threadsafe(
|
|
78
|
-
self.send_logs(self.ocean, logs), loop
|
|
79
|
-
)
|
|
80
|
-
)
|
|
79
|
+
threading.Thread(target=_wrap_event_loop, args=(self.ocean, logs)).start()
|
|
81
80
|
self.release()
|
|
82
81
|
|
|
83
82
|
async def send_logs(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import sys
|
|
3
|
-
|
|
3
|
+
import threading
|
|
4
4
|
from contextlib import asynccontextmanager
|
|
5
5
|
from typing import Callable, Any, Dict, AsyncIterator, Type
|
|
6
6
|
|
|
@@ -9,6 +9,8 @@ from loguru import logger
|
|
|
9
9
|
from pydantic import BaseModel
|
|
10
10
|
from starlette.types import Scope, Receive, Send
|
|
11
11
|
|
|
12
|
+
from port_ocean.core.handlers.resync_state_updater import ResyncStateUpdater
|
|
13
|
+
from port_ocean.core.models import Runtime
|
|
12
14
|
from port_ocean.clients.port.client import PortClient
|
|
13
15
|
from port_ocean.config.settings import (
|
|
14
16
|
IntegrationConfiguration,
|
|
@@ -18,15 +20,13 @@ from port_ocean.context.ocean import (
|
|
|
18
20
|
ocean,
|
|
19
21
|
initialize_port_ocean_context,
|
|
20
22
|
)
|
|
21
|
-
from port_ocean.core.handlers.resync_state_updater import ResyncStateUpdater
|
|
22
23
|
from port_ocean.core.integrations.base import BaseIntegration
|
|
23
|
-
from port_ocean.core.models import Runtime
|
|
24
24
|
from port_ocean.log.sensetive import sensitive_log_filter
|
|
25
25
|
from port_ocean.middlewares import request_handler
|
|
26
|
-
from port_ocean.utils.misc import IntegrationStateStatus
|
|
27
26
|
from port_ocean.utils.repeat import repeat_every
|
|
28
27
|
from port_ocean.utils.signal import signal_handler
|
|
29
28
|
from port_ocean.version import __integration_version__
|
|
29
|
+
from port_ocean.utils.misc import IntegrationStateStatus
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
class Ocean:
|
|
@@ -92,13 +92,6 @@ class Ocean:
|
|
|
92
92
|
)
|
|
93
93
|
raise e
|
|
94
94
|
|
|
95
|
-
def pool_executor_wrapper(event_loop) -> None:
|
|
96
|
-
with ProcessPoolExecutor() as executor:
|
|
97
|
-
e = executor.submit(lambda: asyncio.run_coroutine_threadsafe(
|
|
98
|
-
execute_resync_all(), event_loop
|
|
99
|
-
))
|
|
100
|
-
signal_handler.register(e.cancel)
|
|
101
|
-
|
|
102
95
|
interval = self.config.scheduled_resync_interval
|
|
103
96
|
loop = asyncio.get_event_loop()
|
|
104
97
|
if interval is not None:
|
|
@@ -110,7 +103,13 @@ class Ocean:
|
|
|
110
103
|
seconds=interval * 60,
|
|
111
104
|
# Not running the resync immediately because the event listener should run resync on startup
|
|
112
105
|
wait_first=True,
|
|
113
|
-
)(
|
|
106
|
+
)(
|
|
107
|
+
lambda: threading.Thread(
|
|
108
|
+
target=lambda: asyncio.run_coroutine_threadsafe(
|
|
109
|
+
execute_resync_all(), loop
|
|
110
|
+
)
|
|
111
|
+
).start()
|
|
112
|
+
)
|
|
114
113
|
await repeated_function()
|
|
115
114
|
|
|
116
115
|
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/defaults/__init___.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/commands/list_integrations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/cli/cookiecutter/cookiecutter.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/mixins/__init__.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/mixins/blueprints.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/mixins/entities.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/mixins/integrations.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/mixins/migrations.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/clients/port/retry_transport.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/event_listener/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/entity_processor/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/port_app_config/api.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/port_app_config/base.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/handlers/port_app_config/models.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/mixins/__init__.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/mixins/events.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/mixins/handler.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/mixins/sync.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev6 → port_ocean-0.12.2.dev7}/port_ocean/core/integrations/mixins/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|