port-ocean 0.24.18__py3-none-any.whl → 0.24.20__py3-none-any.whl
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.
- port_ocean/core/integrations/mixins/sync_raw.py +20 -16
- port_ocean/tests/core/handlers/mixins/test_sync_raw.py +6 -3
- {port_ocean-0.24.18.dist-info → port_ocean-0.24.20.dist-info}/METADATA +1 -1
- {port_ocean-0.24.18.dist-info → port_ocean-0.24.20.dist-info}/RECORD +7 -7
- {port_ocean-0.24.18.dist-info → port_ocean-0.24.20.dist-info}/LICENSE.md +0 -0
- {port_ocean-0.24.18.dist-info → port_ocean-0.24.20.dist-info}/WHEEL +0 -0
- {port_ocean-0.24.18.dist-info → port_ocean-0.24.20.dist-info}/entry_points.txt +0 -0
@@ -617,22 +617,23 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
617
617
|
logger.info(f"Process finished for {resource.kind} with index {index}")
|
618
618
|
|
619
619
|
async def process_resource(self, resource: ResourceConfig, index: int, user_agent_type: UserAgentType) -> tuple[list[Entity], list[Exception]]:
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
620
|
+
with logger.contextualize(resource_kind=resource.kind, index=index):
|
621
|
+
if ocean.app.process_execution_mode == ProcessExecutionMode.multi_process:
|
622
|
+
id = uuid.uuid4()
|
623
|
+
logger.info(f"Starting subprocess with id {id}")
|
624
|
+
file_ipc_map = {
|
625
|
+
"process_resource": FileIPC(id, "process_resource",([],[IntegrationSubProcessFailedException(f"Subprocess failed for {resource.kind} with index {index}")])),
|
626
|
+
"topological_entities": FileIPC(id, "topological_entities",[]),
|
627
|
+
}
|
628
|
+
process = ProcessWrapper(target=self.process_resource_in_subprocess, args=(file_ipc_map,resource,index,user_agent_type))
|
629
|
+
process.start()
|
630
|
+
await process.join_async()
|
631
|
+
|
632
|
+
event.entity_topological_sorter.entities.extend(file_ipc_map["topological_entities"].load())
|
633
|
+
return file_ipc_map["process_resource"].load()
|
633
634
|
|
634
|
-
|
635
|
-
|
635
|
+
else:
|
636
|
+
return await self._process_resource(resource,index,user_agent_type)
|
636
637
|
|
637
638
|
async def _process_resource(self,resource: ResourceConfig, index: int, user_agent_type: UserAgentType)-> tuple[list[Entity], list[Exception]]:
|
638
639
|
# create resource context per resource kind, so resync method could have access to the resource
|
@@ -735,6 +736,8 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
735
736
|
|
736
737
|
logger.info("Finished executing resync_complete hooks")
|
737
738
|
|
739
|
+
return True
|
740
|
+
|
738
741
|
|
739
742
|
@TimeMetric(MetricPhase.RESYNC)
|
740
743
|
async def sync_raw_all(
|
@@ -805,7 +808,7 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
805
808
|
logger.warning("Resync aborted successfully, skipping delete phase. This leads to an incomplete state")
|
806
809
|
raise
|
807
810
|
else:
|
808
|
-
await self.resync_reconciliation(
|
811
|
+
success = await self.resync_reconciliation(
|
809
812
|
creation_results,
|
810
813
|
did_fetched_current_state,
|
811
814
|
user_agent_type,
|
@@ -813,6 +816,7 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
813
816
|
silent
|
814
817
|
)
|
815
818
|
await ocean.metrics.report_sync_metrics(kinds=[MetricResourceKind.RECONCILIATION])
|
819
|
+
return success
|
816
820
|
finally:
|
817
821
|
await ocean.app.cache_provider.clear()
|
818
822
|
if ocean.app.process_execution_mode == ProcessExecutionMode.multi_process:
|
@@ -139,9 +139,10 @@ async def test_sync_raw_mixin_self_dependency(
|
|
139
139
|
mock_order_by_entities_dependencies,
|
140
140
|
):
|
141
141
|
|
142
|
-
await mock_sync_raw_mixin.sync_raw_all(
|
142
|
+
res = await mock_sync_raw_mixin.sync_raw_all(
|
143
143
|
trigger_type="machine", user_agent_type=UserAgentType.exporter
|
144
144
|
)
|
145
|
+
assert res is True
|
145
146
|
|
146
147
|
assert (
|
147
148
|
len(event.entity_topological_sorter.entities) == 1
|
@@ -276,9 +277,10 @@ async def test_sync_raw_mixin_circular_dependency(
|
|
276
277
|
mock_order_by_entities_dependencies,
|
277
278
|
):
|
278
279
|
|
279
|
-
await mock_sync_raw_mixin.sync_raw_all(
|
280
|
+
res = await mock_sync_raw_mixin.sync_raw_all(
|
280
281
|
trigger_type="machine", user_agent_type=UserAgentType.exporter
|
281
282
|
)
|
283
|
+
assert res is True
|
282
284
|
|
283
285
|
assert (
|
284
286
|
len(event.entity_topological_sorter.entities) == 2
|
@@ -420,9 +422,10 @@ async def test_sync_raw_mixin_dependency(
|
|
420
422
|
mock_order_by_entities_dependencies,
|
421
423
|
):
|
422
424
|
|
423
|
-
await mock_sync_raw_mixin.sync_raw_all(
|
425
|
+
res = await mock_sync_raw_mixin.sync_raw_all(
|
424
426
|
trigger_type="machine", user_agent_type=UserAgentType.exporter
|
425
427
|
)
|
428
|
+
assert res is True
|
426
429
|
|
427
430
|
assert event.entity_topological_sorter.register_entity.call_count == 5
|
428
431
|
assert (
|
@@ -121,7 +121,7 @@ port_ocean/core/integrations/mixins/events.py,sha256=2L7P3Jhp8XBqddh2_o9Cn4N261n
|
|
121
121
|
port_ocean/core/integrations/mixins/handler.py,sha256=mZ7-0UlG3LcrwJttFbMe-R4xcOU2H_g33tZar7PwTv8,3771
|
122
122
|
port_ocean/core/integrations/mixins/live_events.py,sha256=zM24dhNc7uHx9XYZ6toVhDADPA90EnpOmZxgDegFZbA,4196
|
123
123
|
port_ocean/core/integrations/mixins/sync.py,sha256=Vm_898pLKBwfVewtwouDWsXoxcOLicnAy6pzyqqk6U8,4053
|
124
|
-
port_ocean/core/integrations/mixins/sync_raw.py,sha256=
|
124
|
+
port_ocean/core/integrations/mixins/sync_raw.py,sha256=mbFRZzG91McaoeLP7rR9TP3Bb1N5zayHwF3t71u-Ncc,34022
|
125
125
|
port_ocean/core/integrations/mixins/utils.py,sha256=N76dNu1Y6UEg0_pcSdF4RO6dQIZ8EBfX3xMelgWdMxM,3779
|
126
126
|
port_ocean/core/models.py,sha256=DNbKpStMINI2lIekKprTqBevqkw_wFuFayN19w1aDfQ,2893
|
127
127
|
port_ocean/core/ocean_types.py,sha256=4VipWFOHEh_d9LmWewQccwx1p2dtrRYW0YURVgNsAjo,1398
|
@@ -166,7 +166,7 @@ port_ocean/tests/core/defaults/test_common.py,sha256=sR7RqB3ZYV6Xn6NIg-c8k5K6JcG
|
|
166
166
|
port_ocean/tests/core/handlers/entities_state_applier/test_applier.py,sha256=_CZyViY9_gnxjY6ogWcDdmEDuejvpALogf9ESjVAwFY,10675
|
167
167
|
port_ocean/tests/core/handlers/entity_processor/test_jq_entity_processor.py,sha256=8WpMn559Mf0TFWmloRpZrVgr6yWwyA0C4n2lVHCtyq4,13596
|
168
168
|
port_ocean/tests/core/handlers/mixins/test_live_events.py,sha256=iAwVpr3n3PIkXQLw7hxd-iB_SR_vyfletVXJLOmyz28,12480
|
169
|
-
port_ocean/tests/core/handlers/mixins/test_sync_raw.py,sha256
|
169
|
+
port_ocean/tests/core/handlers/mixins/test_sync_raw.py,sha256=p1AyIc6Rx18miL6Sln9gNvhC39SkXXIqYQstyYDww1c,44420
|
170
170
|
port_ocean/tests/core/handlers/port_app_config/test_api.py,sha256=eJZ6SuFBLz71y4ca3DNqKag6d6HUjNJS0aqQPwiLMTI,1999
|
171
171
|
port_ocean/tests/core/handlers/port_app_config/test_base.py,sha256=hSh556bJM9zuELwhwnyKSfd9z06WqWXIfe-6hCl5iKI,9799
|
172
172
|
port_ocean/tests/core/handlers/queue/test_local_queue.py,sha256=9Ly0HzZXbs6Rbl_bstsIdInC3h2bgABU3roP9S_PnJM,2582
|
@@ -200,8 +200,8 @@ port_ocean/utils/repeat.py,sha256=U2OeCkHPWXmRTVoPV-VcJRlQhcYqPWI5NfmPlb1JIbc,32
|
|
200
200
|
port_ocean/utils/signal.py,sha256=mMVq-1Ab5YpNiqN4PkiyTGlV_G0wkUDMMjTZp5z3pb0,1514
|
201
201
|
port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
|
202
202
|
port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
|
203
|
-
port_ocean-0.24.
|
204
|
-
port_ocean-0.24.
|
205
|
-
port_ocean-0.24.
|
206
|
-
port_ocean-0.24.
|
207
|
-
port_ocean-0.24.
|
203
|
+
port_ocean-0.24.20.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
204
|
+
port_ocean-0.24.20.dist-info/METADATA,sha256=fPKhhQUTw4aSDDmonmitNlAly2DARNFFdr6voWyS3kE,6856
|
205
|
+
port_ocean-0.24.20.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
206
|
+
port_ocean-0.24.20.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
|
207
|
+
port_ocean-0.24.20.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|