port-ocean 0.21.1__py3-none-any.whl → 0.21.2__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.

@@ -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 = 90.0,
28
- max_wait_seconds_before_shutdown: float = 5.0,
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]]] = {}
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, signal_handler
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, signal_handler, max_event_processing_seconds=3
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, SignalHandler()
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, SignalHandler(), 2
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, SignalHandler()
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, SignalHandler()
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, SignalHandler()
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, SignalHandler()
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, SignalHandler()
1387
+ mock_context.app.integration_router,
1388
+ SignalHandler(),
1389
+ 3,
1390
+ 3,
1367
1391
  )
1368
1392
 
1369
1393
  # Register both processors
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.21.1
3
+ Version: 0.21.2
4
4
  Summary: Port Ocean is a CLI tool for managing your Port projects.
5
5
  Home-page: https://app.getport.io
6
6
  Keywords: ocean,port-ocean,port
@@ -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=PfMwhFQOI0zfK0bD32EunXqicVrlPYBkYC2A99nmZlg,5311
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=Pmg81IT0i3MCFWC6648Ln4NfpAWvpyrPZwOFfdTPkDE,11928
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
@@ -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=WmZpcuA5odVMLLVAC2XaTt1nez5zyubzWWismA5JAuo,6713
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=Nb-3VXVRol9fM5pLZQ1iGyPsZcHkWSNGG3bDHWjuR3Y,49285
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.1.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
188
- port_ocean-0.21.1.dist-info/METADATA,sha256=C-0nf5tQjmGL6u0L3pKe7XpfOON72CXep4gh-FLXwp8,6669
189
- port_ocean-0.21.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
190
- port_ocean-0.21.1.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
191
- port_ocean-0.21.1.dist-info/RECORD,,
187
+ port_ocean-0.21.2.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
188
+ port_ocean-0.21.2.dist-info/METADATA,sha256=6FB0sKA5xEJ07ZXUdHqDcU4Ml5mtjxDuUU1jQZwcWlQ,6669
189
+ port_ocean-0.21.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
190
+ port_ocean-0.21.2.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
191
+ port_ocean-0.21.2.dist-info/RECORD,,