port-ocean 0.21.1__py3-none-any.whl → 0.21.3__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.
Potentially problematic release.
This version of port-ocean might be problematic. Click here for more details.
- port_ocean/config/settings.py +2 -0
- port_ocean/core/handlers/webhook/processor_manager.py +2 -2
- port_ocean/core/integrations/mixins/sync_raw.py +4 -0
- port_ocean/ocean.py +4 -1
- port_ocean/tests/core/handlers/webhook/test_processor_manager.py +33 -9
- {port_ocean-0.21.1.dist-info → port_ocean-0.21.3.dist-info}/METADATA +1 -1
- {port_ocean-0.21.1.dist-info → port_ocean-0.21.3.dist-info}/RECORD +10 -10
- {port_ocean-0.21.1.dist-info → port_ocean-0.21.3.dist-info}/LICENSE.md +0 -0
- {port_ocean-0.21.1.dist-info → port_ocean-0.21.3.dist-info}/WHEEL +0 -0
- {port_ocean-0.21.1.dist-info → port_ocean-0.21.3.dist-info}/entry_points.txt +0 -0
port_ocean/config/settings.py
CHANGED
|
@@ -83,6 +83,8 @@ class IntegrationConfiguration(BaseOceanSettings, extra=Extra.allow):
|
|
|
83
83
|
)
|
|
84
84
|
runtime: Runtime = Runtime.OnPrem
|
|
85
85
|
resources_path: str = Field(default=".port/resources")
|
|
86
|
+
max_event_processing_seconds: float = 90.0
|
|
87
|
+
max_wait_seconds_before_shutdown: float = 5.0
|
|
86
88
|
|
|
87
89
|
@root_validator()
|
|
88
90
|
def validate_integration_config(cls, values: dict[str, Any]) -> dict[str, Any]:
|
|
@@ -24,8 +24,8 @@ class LiveEventsProcessorManager(LiveEventsMixin, EventsMixin):
|
|
|
24
24
|
self,
|
|
25
25
|
router: APIRouter,
|
|
26
26
|
signal_handler: SignalHandler,
|
|
27
|
-
max_event_processing_seconds: float
|
|
28
|
-
max_wait_seconds_before_shutdown: float
|
|
27
|
+
max_event_processing_seconds: float,
|
|
28
|
+
max_wait_seconds_before_shutdown: float,
|
|
29
29
|
) -> None:
|
|
30
30
|
self._router = router
|
|
31
31
|
self._processors_classes: Dict[str, list[Type[AbstractWebhookProcessor]]] = {}
|
|
@@ -167,6 +167,10 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
|
|
|
167
167
|
if entities[0].is_using_search_identifier or entities[0].is_using_search_relation:
|
|
168
168
|
return entities
|
|
169
169
|
|
|
170
|
+
MIN_ENTITIES_TO_MAP = 10
|
|
171
|
+
if len(entities) <= MIN_ENTITIES_TO_MAP:
|
|
172
|
+
return entities
|
|
173
|
+
|
|
170
174
|
BATCH_SIZE = 50
|
|
171
175
|
entities_at_port_with_properties = []
|
|
172
176
|
|
port_ocean/ocean.py
CHANGED
|
@@ -57,7 +57,10 @@ class Ocean:
|
|
|
57
57
|
self.integration_router = integration_router or APIRouter()
|
|
58
58
|
|
|
59
59
|
self.webhook_manager = LiveEventsProcessorManager(
|
|
60
|
-
self.integration_router,
|
|
60
|
+
self.integration_router,
|
|
61
|
+
signal_handler,
|
|
62
|
+
max_event_processing_seconds=self.config.max_event_processing_seconds,
|
|
63
|
+
max_wait_seconds_before_shutdown=self.config.max_wait_seconds_before_shutdown,
|
|
61
64
|
)
|
|
62
65
|
|
|
63
66
|
self.port_client = PortClient(
|
|
@@ -175,7 +175,10 @@ def processor_manager() -> LiveEventsProcessorManager:
|
|
|
175
175
|
router = APIRouter()
|
|
176
176
|
signal_handler = SignalHandler()
|
|
177
177
|
return LiveEventsProcessorManager(
|
|
178
|
-
router,
|
|
178
|
+
router,
|
|
179
|
+
signal_handler,
|
|
180
|
+
max_event_processing_seconds=3,
|
|
181
|
+
max_wait_seconds_before_shutdown=3,
|
|
179
182
|
)
|
|
180
183
|
|
|
181
184
|
|
|
@@ -195,7 +198,7 @@ def webhook_event_for_process_webhook_request() -> WebhookEvent:
|
|
|
195
198
|
|
|
196
199
|
@pytest.fixture
|
|
197
200
|
def processor_manager_for_process_webhook_request() -> LiveEventsProcessorManager:
|
|
198
|
-
return LiveEventsProcessorManager(APIRouter(), SignalHandler())
|
|
201
|
+
return LiveEventsProcessorManager(APIRouter(), SignalHandler(), 3, 3)
|
|
199
202
|
|
|
200
203
|
|
|
201
204
|
@pytest.fixture
|
|
@@ -571,7 +574,10 @@ async def test_integrationTest_postRequestSent_webhookEventRawResultProcessed_en
|
|
|
571
574
|
test_path = "/webhook-test"
|
|
572
575
|
mock_context.app.integration = BaseIntegration(ocean)
|
|
573
576
|
mock_context.app.webhook_manager = LiveEventsProcessorManager(
|
|
574
|
-
mock_context.app.integration_router,
|
|
577
|
+
mock_context.app.integration_router,
|
|
578
|
+
SignalHandler(),
|
|
579
|
+
max_event_processing_seconds=3,
|
|
580
|
+
max_wait_seconds_before_shutdown=3,
|
|
575
581
|
)
|
|
576
582
|
|
|
577
583
|
mock_context.app.webhook_manager.register_processor(test_path, TestProcessor)
|
|
@@ -682,7 +688,10 @@ async def test_integrationTest_postRequestSent_reachedTimeout_entityNotUpserted(
|
|
|
682
688
|
test_path = "/webhook-test"
|
|
683
689
|
mock_context.app.integration = BaseIntegration(ocean)
|
|
684
690
|
mock_context.app.webhook_manager = LiveEventsProcessorManager(
|
|
685
|
-
mock_context.app.integration_router,
|
|
691
|
+
mock_context.app.integration_router,
|
|
692
|
+
SignalHandler(),
|
|
693
|
+
2,
|
|
694
|
+
2,
|
|
686
695
|
)
|
|
687
696
|
|
|
688
697
|
mock_context.app.webhook_manager.register_processor(test_path, TestProcessor)
|
|
@@ -796,7 +805,10 @@ async def test_integrationTest_postRequestSent_noMatchingHandlers_entityNotUpser
|
|
|
796
805
|
test_path = "/webhook-test"
|
|
797
806
|
mock_context.app.integration = BaseIntegration(ocean)
|
|
798
807
|
mock_context.app.webhook_manager = LiveEventsProcessorManager(
|
|
799
|
-
mock_context.app.integration_router,
|
|
808
|
+
mock_context.app.integration_router,
|
|
809
|
+
SignalHandler(),
|
|
810
|
+
3,
|
|
811
|
+
3,
|
|
800
812
|
)
|
|
801
813
|
|
|
802
814
|
mock_context.app.webhook_manager.register_processor(test_path, TestProcessor)
|
|
@@ -973,7 +985,10 @@ async def test_integrationTest_postRequestSent_webhookEventRawResultProcessedFor
|
|
|
973
985
|
test_path = "/webhook-test"
|
|
974
986
|
mock_context.app.integration = BaseIntegration(ocean)
|
|
975
987
|
mock_context.app.webhook_manager = LiveEventsProcessorManager(
|
|
976
|
-
mock_context.app.integration_router,
|
|
988
|
+
mock_context.app.integration_router,
|
|
989
|
+
SignalHandler(),
|
|
990
|
+
3,
|
|
991
|
+
3,
|
|
977
992
|
)
|
|
978
993
|
|
|
979
994
|
mock_context.app.webhook_manager.register_processor(test_path, TestProcessorA)
|
|
@@ -1100,7 +1115,10 @@ async def test_integrationTest_postRequestSent_webhookEventRawResultProcessedwit
|
|
|
1100
1115
|
test_path = "/webhook-test"
|
|
1101
1116
|
mock_context.app.integration = BaseIntegration(ocean)
|
|
1102
1117
|
mock_context.app.webhook_manager = LiveEventsProcessorManager(
|
|
1103
|
-
mock_context.app.integration_router,
|
|
1118
|
+
mock_context.app.integration_router,
|
|
1119
|
+
SignalHandler(),
|
|
1120
|
+
3,
|
|
1121
|
+
3,
|
|
1104
1122
|
)
|
|
1105
1123
|
|
|
1106
1124
|
mock_context.app.webhook_manager.register_processor(test_path, TestProcessor)
|
|
@@ -1227,7 +1245,10 @@ async def test_integrationTest_postRequestSent_webhookEventRawResultProcessedwit
|
|
|
1227
1245
|
test_path = "/webhook-test"
|
|
1228
1246
|
mock_context.app.integration = BaseIntegration(ocean)
|
|
1229
1247
|
mock_context.app.webhook_manager = LiveEventsProcessorManager(
|
|
1230
|
-
mock_context.app.integration_router,
|
|
1248
|
+
mock_context.app.integration_router,
|
|
1249
|
+
SignalHandler(),
|
|
1250
|
+
90.0,
|
|
1251
|
+
5.0,
|
|
1231
1252
|
)
|
|
1232
1253
|
|
|
1233
1254
|
mock_context.app.webhook_manager.register_processor(test_path, TestProcessor)
|
|
@@ -1363,7 +1384,10 @@ async def test_integrationTest_postRequestSent_oneProcessorThrowsException_onlyS
|
|
|
1363
1384
|
test_path = "/webhook-test"
|
|
1364
1385
|
mock_context.app.integration = BaseIntegration(ocean)
|
|
1365
1386
|
mock_context.app.webhook_manager = LiveEventsProcessorManager(
|
|
1366
|
-
mock_context.app.integration_router,
|
|
1387
|
+
mock_context.app.integration_router,
|
|
1388
|
+
SignalHandler(),
|
|
1389
|
+
3,
|
|
1390
|
+
3,
|
|
1367
1391
|
)
|
|
1368
1392
|
|
|
1369
1393
|
# Register both processors
|
|
@@ -62,7 +62,7 @@ port_ocean/clients/port/utils.py,sha256=SjhgmJXAqH2JqXfGy8GoGwzUYiJvUhWDrJyxQcen
|
|
|
62
62
|
port_ocean/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
63
|
port_ocean/config/base.py,sha256=x1gFbzujrxn7EJudRT81C6eN9WsYAb3vOHwcpcpX8Tc,6370
|
|
64
64
|
port_ocean/config/dynamic.py,sha256=qOFkRoJsn_BW7581omi_AoMxoHqasf_foxDQ_G11_SI,2030
|
|
65
|
-
port_ocean/config/settings.py,sha256=
|
|
65
|
+
port_ocean/config/settings.py,sha256=n9aZXkGcyNCk9PBqlMDhk8tuvEMPimNgX0fEoaKNa1o,5408
|
|
66
66
|
port_ocean/consumers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
67
67
|
port_ocean/consumers/kafka_consumer.py,sha256=N8KocjBi9aR0BOPG8hgKovg-ns_ggpEjrSxqSqF_BSo,4710
|
|
68
68
|
port_ocean/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -104,7 +104,7 @@ port_ocean/core/handlers/resync_state_updater/__init__.py,sha256=kG6y-JQGpPfuTHh
|
|
|
104
104
|
port_ocean/core/handlers/resync_state_updater/updater.py,sha256=Yg9ET6ZV5B9GW7u6zZA6GlB_71kmvxvYX2FWgQNzMvo,3182
|
|
105
105
|
port_ocean/core/handlers/webhook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
106
106
|
port_ocean/core/handlers/webhook/abstract_webhook_processor.py,sha256=5KwZkdkDd5HdVkXPzKiqabodZKl-hOtMypkTKd8Hq3M,3891
|
|
107
|
-
port_ocean/core/handlers/webhook/processor_manager.py,sha256=
|
|
107
|
+
port_ocean/core/handlers/webhook/processor_manager.py,sha256=ALQp997XPMvyv9gN-E3iuSD130bcLp14tYRyJb0a_Ro,11915
|
|
108
108
|
port_ocean/core/handlers/webhook/webhook_event.py,sha256=Iuw6IX3PPjwHECUeFgrJl6K249mJ-DPAGhP8OMxbc1c,4096
|
|
109
109
|
port_ocean/core/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
110
110
|
port_ocean/core/integrations/base.py,sha256=eS0WDOfCTim1UOQQrNuP14I6hvT_fr8dof_cr1ls01s,3107
|
|
@@ -113,7 +113,7 @@ port_ocean/core/integrations/mixins/events.py,sha256=2L7P3Jhp8XBqddh2_o9Cn4N261n
|
|
|
113
113
|
port_ocean/core/integrations/mixins/handler.py,sha256=mZ7-0UlG3LcrwJttFbMe-R4xcOU2H_g33tZar7PwTv8,3771
|
|
114
114
|
port_ocean/core/integrations/mixins/live_events.py,sha256=8HklZmlyffYY_LeDe8xbt3Tb08rlLkqVhFF-2NQeJP4,4126
|
|
115
115
|
port_ocean/core/integrations/mixins/sync.py,sha256=GHiFbnw0XrBfl7aCTH_w67f_N7EZbcUgssc-0fPujNU,4047
|
|
116
|
-
port_ocean/core/integrations/mixins/sync_raw.py,sha256=
|
|
116
|
+
port_ocean/core/integrations/mixins/sync_raw.py,sha256=jKbdDEypGJ86uc579anrPLBa_dETQlphi3gvpu9917U,25427
|
|
117
117
|
port_ocean/core/integrations/mixins/utils.py,sha256=oN4Okz6xlaefpid1_Pud8HPSw9BwwjRohyNsknq-Myg,2309
|
|
118
118
|
port_ocean/core/models.py,sha256=FvTp-BlpbvLbMbngE0wsiimsCfmIhUR1PvsE__Z--1I,2206
|
|
119
119
|
port_ocean/core/ocean_types.py,sha256=onwYMsvdd2_9QmZ7qU6h-t2uF_PTIivpEro0ahevhdw,1354
|
|
@@ -137,7 +137,7 @@ port_ocean/log/handlers.py,sha256=ncVjgqrZRh6BhyRrA6DQG86Wsbxph1yWYuEC0cWfe-Q,36
|
|
|
137
137
|
port_ocean/log/logger_setup.py,sha256=CoEDowe5OwNOL_5clU6Z4faktfh0VWaOTS0VLmyhHjw,2404
|
|
138
138
|
port_ocean/log/sensetive.py,sha256=lVKiZH6b7TkrZAMmhEJRhcl67HNM94e56x12DwFgCQk,2920
|
|
139
139
|
port_ocean/middlewares.py,sha256=9wYCdyzRZGK1vjEJ28FY_DkfwDNENmXp504UKPf5NaQ,2727
|
|
140
|
-
port_ocean/ocean.py,sha256=
|
|
140
|
+
port_ocean/ocean.py,sha256=IL6jIgmfOmvUpGuM9zgv0Cvvuh4Ek-zn4gb9kOy18B8,6900
|
|
141
141
|
port_ocean/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
142
142
|
port_ocean/run.py,sha256=COoRSmLG4hbsjIW5DzhV0NYVegI9xHd1POv6sg4U1No,2217
|
|
143
143
|
port_ocean/sonar-project.properties,sha256=X_wLzDOkEVmpGLRMb2fg9Rb0DxWwUFSvESId8qpvrPI,73
|
|
@@ -157,7 +157,7 @@ port_ocean/tests/core/handlers/port_app_config/test_api.py,sha256=eJZ6SuFBLz71y4
|
|
|
157
157
|
port_ocean/tests/core/handlers/port_app_config/test_base.py,sha256=tdjpFUnUZ6TNMxc3trKkzmMTGTb7oKIeu3rRXv_fV3g,6872
|
|
158
158
|
port_ocean/tests/core/handlers/queue/test_local_queue.py,sha256=9Ly0HzZXbs6Rbl_bstsIdInC3h2bgABU3roP9S_PnJM,2582
|
|
159
159
|
port_ocean/tests/core/handlers/webhook/test_abstract_webhook_processor.py,sha256=zKwHhPAYEZoZ5Z2UETp1t--mbkS8uyvlXThB0obZTTc,3340
|
|
160
|
-
port_ocean/tests/core/handlers/webhook/test_processor_manager.py,sha256=
|
|
160
|
+
port_ocean/tests/core/handlers/webhook/test_processor_manager.py,sha256=yeKnQb-0aD5x_4Dfd3mETNU-9yreN2VQjEqkD9H9ixY,49633
|
|
161
161
|
port_ocean/tests/core/handlers/webhook/test_webhook_event.py,sha256=oR4dEHLO65mp6rkfNfszZcfFoRZlB8ZWee4XetmsuIk,3181
|
|
162
162
|
port_ocean/tests/core/test_utils.py,sha256=Z3kdhb5V7Svhcyy3EansdTpgHL36TL6erNtU-OPwAcI,2647
|
|
163
163
|
port_ocean/tests/core/utils/test_entity_topological_sorter.py,sha256=zuq5WSPy_88PemG3mOUIHTxWMR_js1R7tOzUYlgBd68,3447
|
|
@@ -184,8 +184,8 @@ port_ocean/utils/repeat.py,sha256=U2OeCkHPWXmRTVoPV-VcJRlQhcYqPWI5NfmPlb1JIbc,32
|
|
|
184
184
|
port_ocean/utils/signal.py,sha256=mMVq-1Ab5YpNiqN4PkiyTGlV_G0wkUDMMjTZp5z3pb0,1514
|
|
185
185
|
port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
|
|
186
186
|
port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
|
|
187
|
-
port_ocean-0.21.
|
|
188
|
-
port_ocean-0.21.
|
|
189
|
-
port_ocean-0.21.
|
|
190
|
-
port_ocean-0.21.
|
|
191
|
-
port_ocean-0.21.
|
|
187
|
+
port_ocean-0.21.3.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
188
|
+
port_ocean-0.21.3.dist-info/METADATA,sha256=iRXlKpU0J23xPU_Yok0g-juVSFa5TDs2G2HIsjxESw0,6669
|
|
189
|
+
port_ocean-0.21.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
190
|
+
port_ocean-0.21.3.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
|
|
191
|
+
port_ocean-0.21.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|