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

@@ -5,15 +5,11 @@ FROM ${BASE_BUILDER_PYTHON_IMAGE} AS base
5
5
 
6
6
  ARG BUILD_CONTEXT
7
7
  ARG BUILDPLATFORM
8
- ARG PROMETHEUS_MULTIPROC_DIR=/tmp/ocean/prometheus/metrics
9
8
 
10
9
  ENV LIBRDKAFKA_VERSION=2.8.2 \
11
10
  PYTHONUNBUFFERED=1 \
12
11
  POETRY_VIRTUALENVS_IN_PROJECT=1 \
13
- PIP_ROOT_USER_ACTION=ignore \
14
- PROMETHEUS_MULTIPROC_DIR=${PROMETHEUS_MULTIPROC_DIR}
15
-
16
- RUN mkdir -p ${PROMETHEUS_MULTIPROC_DIR}
12
+ PIP_ROOT_USER_ACTION=ignore
17
13
 
18
14
  WORKDIR /app
19
15
 
@@ -25,8 +21,12 @@ FROM ${BASE_RUNNER_PYTHON_IMAGE} AS prod
25
21
 
26
22
  ARG INTEGRATION_VERSION
27
23
  ARG BUILD_CONTEXT
24
+ ARG PROMETHEUS_MULTIPROC_DIR=/tmp/ocean/prometheus/metrics
28
25
 
29
- ENV LIBRDKAFKA_VERSION=2.8.2
26
+ ENV LIBRDKAFKA_VERSION=2.8.2 \
27
+ PROMETHEUS_MULTIPROC_DIR=${PROMETHEUS_MULTIPROC_DIR}
28
+
29
+ RUN mkdir -p ${PROMETHEUS_MULTIPROC_DIR}
30
30
 
31
31
  RUN apt-get update \
32
32
  && apt-get install -y \
@@ -51,7 +51,7 @@ def default_config_factory(configurations: Any) -> Type[BaseModel]:
51
51
  case _:
52
52
  raise ValueError(f"Unknown type: {config.type}")
53
53
 
54
- default = ... if config.required else None
54
+ default: Any = ... if config.required else None
55
55
  if config.default is not None:
56
56
  default = parse_obj_as(field_type, config.default)
57
57
  fields[decamelize(config.name)] = (
@@ -33,7 +33,7 @@ from port_ocean.core.ocean_types import (
33
33
  CalculationResult,
34
34
  )
35
35
  from port_ocean.core.utils.utils import resolve_entities_diff, zip_and_sum, gather_and_split_errors_from_results
36
- from port_ocean.exceptions.core import OceanAbortException
36
+ from port_ocean.exceptions.core import IntegrationSubProcessFailedException, OceanAbortException
37
37
  from port_ocean.helpers.metric.metric import MetricResourceKind, SyncState, MetricType, MetricPhase
38
38
  from port_ocean.helpers.metric.utils import TimeMetric, TimeMetricWithResourceKind
39
39
  from port_ocean.utils.ipc import FileIPC
@@ -626,14 +626,13 @@ class SyncRawMixin(HandlerMixin, EventsMixin):
626
626
  id = uuid.uuid4()
627
627
  logger.info(f"Starting subprocess with id {id}")
628
628
  file_ipc_map = {
629
- "process_resource": FileIPC(id, "process_resource",([],[])),
629
+ "process_resource": FileIPC(id, "process_resource",([],[IntegrationSubProcessFailedException(f"Subprocess failed for {resource.kind} with index {index}")])),
630
630
  "topological_entities": FileIPC(id, "topological_entities",[]),
631
631
  }
632
632
  process = ProcessWrapper(target=self.process_resource_in_subprocess, args=(file_ipc_map,resource,index,user_agent_type))
633
633
  process.start()
634
634
  await process.join_async()
635
635
 
636
-
637
636
  event.entity_topological_sorter.entities.extend(file_ipc_map["topological_entities"].load())
638
637
  return file_ipc_map["process_resource"].load()
639
638
 
@@ -37,3 +37,7 @@ class IntegrationNotStartedException(BaseOceanException):
37
37
 
38
38
  class IntegrationRuntimeException(BaseOceanException):
39
39
  pass
40
+
41
+
42
+ class IntegrationSubProcessFailedException(BaseOceanException):
43
+ pass
@@ -123,6 +123,7 @@ class Metrics:
123
123
  self.registry = prometheus_client.CollectorRegistry()
124
124
  if multiprocessing_enabled:
125
125
  multiprocess.MultiProcessCollector(self.registry)
126
+ self.multiprocessing_enabled = multiprocessing_enabled
126
127
  self.metrics: dict[str, Gauge] = {}
127
128
  self.load_metrics()
128
129
  self._integration_version: Optional[str] = None
@@ -213,7 +214,8 @@ class Metrics:
213
214
  logger.error(f"Failed to cleanup prometheus metrics: {e}")
214
215
 
215
216
  def initialize_metrics(self, kind_blockes: list[str]) -> None:
216
- self.cleanup_prometheus_metrics()
217
+ if self.multiprocessing_enabled:
218
+ self.cleanup_prometheus_metrics()
217
219
  for kind in kind_blockes:
218
220
  self.set_metric(MetricType.SUCCESS_NAME, [kind, MetricPhase.RESYNC], 0)
219
221
  self.set_metric(MetricType.DURATION_NAME, [kind, MetricPhase.RESYNC], 0)
@@ -21,7 +21,8 @@ def test_serialize_record_log_shape() -> None:
21
21
  )
22
22
  serialized_record = _serialize_record(record)
23
23
  assert all(key in serialized_record for key in expected_keys)
24
- assert log_message in serialized_record.get("message", None)
24
+ message = serialized_record.get("message", None)
25
+ assert message is not None and log_message in message
25
26
 
26
27
 
27
28
  def test_serialize_record_exc_info_single_exception() -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.23.4
3
+ Version: 0.23.5
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
@@ -1,4 +1,4 @@
1
- integrations/_infra/Dockerfile.Deb,sha256=JMyxgvJxLeo3Vcys-w6m_F6fxfu6JyAcjAMPuXsNQBM,1679
1
+ integrations/_infra/Dockerfile.Deb,sha256=5mSAOr1TaqkfFPTKkB9q9BYIHi4kaR8imfBwJVZuP1M,1679
2
2
  integrations/_infra/Dockerfile.alpine,sha256=7E4Sb-8supsCcseerHwTkuzjHZoYcaHIyxiBZ-wewo0,3482
3
3
  integrations/_infra/Dockerfile.base.builder,sha256=ESe1PKC6itp_AuXawbLI75k1Kruny6NTANaTinxOgVs,743
4
4
  integrations/_infra/Dockerfile.base.runner,sha256=uAcs2IsxrAAUHGXt_qULA5INr-HFguf5a5fCKiqEzbY,384
@@ -68,7 +68,7 @@ port_ocean/clients/port/types.py,sha256=nvlgiAq4WH5_F7wQbz_GAWl-faob84LVgIjZ2Ww5
68
68
  port_ocean/clients/port/utils.py,sha256=osFyAjw7Y5Qf2uVSqC7_RTCQfijiL1zS74JJM0goxh0,2762
69
69
  port_ocean/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
70
70
  port_ocean/config/base.py,sha256=x1gFbzujrxn7EJudRT81C6eN9WsYAb3vOHwcpcpX8Tc,6370
71
- port_ocean/config/dynamic.py,sha256=qOFkRoJsn_BW7581omi_AoMxoHqasf_foxDQ_G11_SI,2030
71
+ port_ocean/config/dynamic.py,sha256=T0AWE41tjp9fL1sgrTRwNAGlPw6xiakFp-KXWvHtu_4,2035
72
72
  port_ocean/config/settings.py,sha256=kVXF5_Jr93qW4xDlYXbfehDlQjpv4REjiSAQWePKfYs,6438
73
73
  port_ocean/consumers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
74
  port_ocean/consumers/kafka_consumer.py,sha256=N8KocjBi9aR0BOPG8hgKovg-ns_ggpEjrSxqSqF_BSo,4710
@@ -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=8HklZmlyffYY_LeDe8xbt3Tb08rlLkqVhFF-2NQeJP4,4126
123
123
  port_ocean/core/integrations/mixins/sync.py,sha256=Vm_898pLKBwfVewtwouDWsXoxcOLicnAy6pzyqqk6U8,4053
124
- port_ocean/core/integrations/mixins/sync_raw.py,sha256=wZrn0Bz05HmVKDgAJ5LPvP54nSUDpE8uHvjHAYqXVD4,33987
124
+ port_ocean/core/integrations/mixins/sync_raw.py,sha256=4zNsf0QdvsLANhoUTUnf0bNbHIyV7-MqQOYIr0ES85o,34121
125
125
  port_ocean/core/integrations/mixins/utils.py,sha256=g1XbC12dswefQ-NpcLSCqFtd_WRp2bTL98jyZ5rRbGk,3444
126
126
  port_ocean/core/models.py,sha256=MKfq69zGbFRzo0I2HRDUvSbz_pjrtcFVsD5B4Qwa3fw,2538
127
127
  port_ocean/core/ocean_types.py,sha256=4VipWFOHEh_d9LmWewQccwx1p2dtrRYW0YURVgNsAjo,1398
@@ -133,13 +133,13 @@ port_ocean/exceptions/api.py,sha256=1JcA-H12lhSgolMEA6dM4JMbDrh9sYDcE7oydPSTuK8,
133
133
  port_ocean/exceptions/base.py,sha256=uY4DX7fIITDFfemCJDWpaZi3bD51lcANc5swpoNvMJA,46
134
134
  port_ocean/exceptions/clients.py,sha256=LKLLs-Zy3caNG85rwxfOw2rMr8qqVV6SHUq4fRCZ99U,180
135
135
  port_ocean/exceptions/context.py,sha256=mA8HII6Rl4QxKUz98ppy1zX3kaziaen21h1ZWuU3ADc,372
136
- port_ocean/exceptions/core.py,sha256=Zmb1m6NnkSPWpAiQA5tgejm3zpDMt1WQEN47OJNo54A,856
136
+ port_ocean/exceptions/core.py,sha256=3LpQrOWdZ-xZ8zm90DmTnFnk0Nms2OgrVIzZBK0Xw5M,931
137
137
  port_ocean/exceptions/port_defaults.py,sha256=2a7Koy541KxMan33mU-gbauUxsumG3NT4itVxSpQqfw,666
138
138
  port_ocean/exceptions/utils.py,sha256=gjOqpi-HpY1l4WlMFsGA9yzhxDhajhoGGdDDyGbLnqI,197
139
139
  port_ocean/exceptions/webhook_processor.py,sha256=yQYazg53Y-ohb7HfViwq1opH_ZUuUdhHSRxcUNveFpI,114
140
140
  port_ocean/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
141
141
  port_ocean/helpers/async_client.py,sha256=SRlP6o7_FCSY3UHnRlZdezppePVxxOzZ0z861vE3K40,1783
142
- port_ocean/helpers/metric/metric.py,sha256=mlXH4T_ehShZ0XjGkng3h4MDv7Myw0upwTlpAoC84tA,14395
142
+ port_ocean/helpers/metric/metric.py,sha256=akRZmjzQdY1WMY2O3pDuU0xyW_Tn3XGttG5CkT9_Cbo,14503
143
143
  port_ocean/helpers/metric/utils.py,sha256=1lAgrxnZLuR_wUNDyPOPzLrm32b8cDdioob2lvnPQ1A,1619
144
144
  port_ocean/helpers/retry.py,sha256=gmS4YxM6N4fboFp7GSgtOzyBJemxs46bnrz4L4rDS6Y,16136
145
145
  port_ocean/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -183,7 +183,7 @@ port_ocean/tests/helpers/integration.py,sha256=_RxS-RHpu11lrbhUXYPZp862HLWx8AoD7
183
183
  port_ocean/tests/helpers/ocean_app.py,sha256=N06vcNI1klqdcNFq-PXL5vm77u-hODsOSXnj9p8d1AI,2249
184
184
  port_ocean/tests/helpers/port_client.py,sha256=5d6GNr8vNNSOkrz1AdOhxBUKuusr_-UPDP7AVpHasQw,599
185
185
  port_ocean/tests/helpers/smoke_test.py,sha256=_9aJJFRfuGJEg2D2YQJVJRmpreS6gEPHHQq8Q01x4aQ,2697
186
- port_ocean/tests/log/test_handlers.py,sha256=uxgYCEQLP9U5qf-zUN9SgWFogMbYdnBeOVzXZ7E_yFw,2119
186
+ port_ocean/tests/log/test_handlers.py,sha256=x2P2Hd6Cb3sQafIE3TRGltbbHeiFHaiEjwRn9py_03g,2165
187
187
  port_ocean/tests/test_metric.py,sha256=gDdeJcqJDQ_o3VrYrW23iZyw2NuUsyATdrygSXhcDuQ,8096
188
188
  port_ocean/tests/test_ocean.py,sha256=bsXKGTVEjwLSbR7-qSmI4GZ-EzDo0eBE3TNSMsWzYxM,1502
189
189
  port_ocean/tests/test_smoke.py,sha256=uix2uIg_yOm8BHDgHw2hTFPy1fiIyxBGW3ENU_KoFlo,2557
@@ -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.23.4.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
204
- port_ocean-0.23.4.dist-info/METADATA,sha256=6drOs6277IC86mO9ZhmdCjVUKy6QL2IqVTi_6x7vyI4,6764
205
- port_ocean-0.23.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
206
- port_ocean-0.23.4.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
207
- port_ocean-0.23.4.dist-info/RECORD,,
203
+ port_ocean-0.23.5.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
204
+ port_ocean-0.23.5.dist-info/METADATA,sha256=c7JCQ5hwJwGhb1mGKvRp1Ls35CHw9KksCyrlj6dEc0o,6764
205
+ port_ocean-0.23.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
206
+ port_ocean-0.23.5.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
207
+ port_ocean-0.23.5.dist-info/RECORD,,