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

@@ -48,7 +48,7 @@ endef
48
48
  install:
49
49
  $(call deactivate_virtualenv) && \
50
50
  $(call install_poetry) && \
51
- poetry install --with dev
51
+ poetry install --with dev --no-root
52
52
 
53
53
  install/local-core: install
54
54
  # NOTE: This is a temporary change that shouldn't be committed
@@ -6,7 +6,7 @@ from loguru import logger
6
6
  from pydantic import BaseModel, Field, PrivateAttr
7
7
 
8
8
  from port_ocean.clients.port.types import UserAgentType
9
- from port_ocean.clients.port.utils import handle_status_code
9
+ from port_ocean.clients.port.utils import handle_port_status_code
10
10
  from port_ocean.utils.misc import get_time
11
11
 
12
12
 
@@ -58,7 +58,7 @@ class PortAuthentication:
58
58
  json=credentials,
59
59
  extensions={"retryable": True},
60
60
  )
61
- handle_status_code(response)
61
+ handle_port_status_code(response)
62
62
  return TokenResponse(**response.json())
63
63
 
64
64
  def user_agent(self, user_agent_type: UserAgentType | None = None) -> str:
@@ -10,7 +10,7 @@ from port_ocean.clients.port.types import (
10
10
  KafkaCreds,
11
11
  )
12
12
  from port_ocean.clients.port.utils import (
13
- handle_status_code,
13
+ handle_port_status_code,
14
14
  get_internal_http_client,
15
15
  )
16
16
  from port_ocean.exceptions.clients import KafkaCredentialsNotFound
@@ -59,7 +59,7 @@ class PortClient(
59
59
  )
60
60
  if response.is_error:
61
61
  logger.error("Error getting kafka credentials")
62
- handle_status_code(response)
62
+ handle_port_status_code(response)
63
63
 
64
64
  credentials = response.json().get("credentials")
65
65
 
@@ -76,7 +76,7 @@ class PortClient(
76
76
  )
77
77
  if response.is_error:
78
78
  logger.error(f"Error getting organization id, error: {response.text}")
79
- handle_status_code(response)
79
+ handle_port_status_code(response)
80
80
 
81
81
  return response.json()["organization"]["id"]
82
82
 
@@ -90,7 +90,7 @@ class PortClient(
90
90
  headers=await self.auth.headers(),
91
91
  json=state,
92
92
  )
93
- handle_status_code(response, should_raise, should_log)
93
+ handle_port_status_code(response, should_raise, should_log)
94
94
  if response.is_success and should_log:
95
95
  logger.info("Integration resync state updated successfully")
96
96
 
@@ -5,7 +5,7 @@ from loguru import logger
5
5
 
6
6
  from port_ocean.clients.port.authentication import PortAuthentication
7
7
  from port_ocean.clients.port.types import UserAgentType
8
- from port_ocean.clients.port.utils import handle_status_code
8
+ from port_ocean.clients.port.utils import handle_port_status_code
9
9
  from port_ocean.core.models import Blueprint
10
10
 
11
11
 
@@ -22,7 +22,7 @@ class BlueprintClientMixin:
22
22
  f"{self.auth.api_url}/blueprints/{identifier}",
23
23
  headers=await self.auth.headers(),
24
24
  )
25
- handle_status_code(response, should_log=should_log)
25
+ handle_port_status_code(response, should_log=should_log)
26
26
  return Blueprint.parse_obj(response.json()["blueprint"])
27
27
 
28
28
  async def create_blueprint(
@@ -35,7 +35,7 @@ class BlueprintClientMixin:
35
35
  response = await self.client.post(
36
36
  f"{self.auth.api_url}/blueprints", headers=headers, json=raw_blueprint
37
37
  )
38
- handle_status_code(response)
38
+ handle_port_status_code(response)
39
39
  return response.json()["blueprint"]
40
40
 
41
41
  async def patch_blueprint(
@@ -51,7 +51,7 @@ class BlueprintClientMixin:
51
51
  headers=headers,
52
52
  json=raw_blueprint,
53
53
  )
54
- handle_status_code(response)
54
+ handle_port_status_code(response)
55
55
 
56
56
  async def delete_blueprint(
57
57
  self,
@@ -70,7 +70,7 @@ class BlueprintClientMixin:
70
70
  f"{self.auth.api_url}/blueprints/{identifier}",
71
71
  headers=headers,
72
72
  )
73
- handle_status_code(response, should_raise)
73
+ handle_port_status_code(response, should_raise)
74
74
  return None
75
75
  else:
76
76
  response = await self.client.delete(
@@ -78,7 +78,7 @@ class BlueprintClientMixin:
78
78
  headers=await self.auth.headers(),
79
79
  )
80
80
 
81
- handle_status_code(response, should_raise)
81
+ handle_port_status_code(response, should_raise)
82
82
  return response.json().get("migrationId", "")
83
83
 
84
84
  async def create_action(
@@ -91,7 +91,7 @@ class BlueprintClientMixin:
91
91
  headers=await self.auth.headers(),
92
92
  )
93
93
 
94
- handle_status_code(response, should_log=should_log)
94
+ handle_port_status_code(response, should_log=should_log)
95
95
 
96
96
  async def create_scorecard(
97
97
  self,
@@ -106,7 +106,7 @@ class BlueprintClientMixin:
106
106
  headers=await self.auth.headers(),
107
107
  )
108
108
 
109
- handle_status_code(response, should_log=should_log)
109
+ handle_port_status_code(response, should_log=should_log)
110
110
 
111
111
  async def create_page(
112
112
  self, page: dict[str, Any], should_log: bool = True
@@ -118,7 +118,7 @@ class BlueprintClientMixin:
118
118
  headers=await self.auth.headers(),
119
119
  )
120
120
 
121
- handle_status_code(response, should_log=should_log)
121
+ handle_port_status_code(response, should_log=should_log)
122
122
  return page
123
123
 
124
124
  async def delete_page(
@@ -132,4 +132,4 @@ class BlueprintClientMixin:
132
132
  headers=await self.auth.headers(),
133
133
  )
134
134
 
135
- handle_status_code(response, should_raise)
135
+ handle_port_status_code(response, should_raise)
@@ -9,7 +9,7 @@ from loguru import logger
9
9
  from port_ocean.clients.port.authentication import PortAuthentication
10
10
  from port_ocean.clients.port.types import RequestOptions, UserAgentType
11
11
  from port_ocean.clients.port.utils import (
12
- handle_status_code,
12
+ handle_port_status_code,
13
13
  PORT_HTTP_MAX_CONNECTIONS_LIMIT,
14
14
  )
15
15
  from port_ocean.core.models import Entity, PortAPIErrorMessage
@@ -89,7 +89,7 @@ class EntityClientMixin:
89
89
  ):
90
90
  # Return false to differentiate from `result_entity.is_using_search_identifier`
91
91
  return False
92
- handle_status_code(response, should_raise)
92
+ handle_port_status_code(response, should_raise)
93
93
  result = response.json()
94
94
 
95
95
  result_entity = (
@@ -192,7 +192,7 @@ class EntityClientMixin:
192
192
  f"blueprint: {entity.blueprint}"
193
193
  )
194
194
 
195
- handle_status_code(response, should_raise)
195
+ handle_port_status_code(response, should_raise)
196
196
 
197
197
  async def batch_delete_entities(
198
198
  self,
@@ -252,7 +252,7 @@ class EntityClientMixin:
252
252
  },
253
253
  extensions={"retryable": True},
254
254
  )
255
- handle_status_code(response)
255
+ handle_port_status_code(response)
256
256
  return [Entity.parse_obj(result) for result in response.json()["entities"]]
257
257
 
258
258
  async def search_batch_entities(
@@ -5,7 +5,7 @@ from urllib.parse import quote_plus
5
5
  import httpx
6
6
  from loguru import logger
7
7
  from port_ocean.clients.port.authentication import PortAuthentication
8
- from port_ocean.clients.port.utils import handle_status_code
8
+ from port_ocean.clients.port.utils import handle_port_status_code
9
9
  from port_ocean.exceptions.port_defaults import DefaultsProvisionFailed
10
10
  from port_ocean.log.sensetive import sensitive_log_filter
11
11
 
@@ -56,7 +56,7 @@ class IntegrationClientMixin:
56
56
  headers=await self.auth.headers(),
57
57
  )
58
58
 
59
- handle_status_code(response, should_raise, should_log)
59
+ handle_port_status_code(response, should_raise, should_log)
60
60
 
61
61
  return response.json().get("integrations", [])
62
62
 
@@ -75,7 +75,7 @@ class IntegrationClientMixin:
75
75
  has_provision_feature_flag: bool = False,
76
76
  ) -> dict[str, Any]:
77
77
  response = await self._get_current_integration()
78
- handle_status_code(response, should_raise, should_log)
78
+ handle_port_status_code(response, should_raise, should_log)
79
79
  integration = response.json().get("integration", {})
80
80
  if integration.get("config", None) or not integration:
81
81
  return integration
@@ -164,7 +164,7 @@ class IntegrationClientMixin:
164
164
  json=json,
165
165
  params=query_params,
166
166
  )
167
- handle_status_code(response)
167
+ handle_port_status_code(response)
168
168
  if create_port_resources_origin_in_port:
169
169
  result = (
170
170
  await self._poll_integration_until_default_provisioning_is_complete()
@@ -194,7 +194,7 @@ class IntegrationClientMixin:
194
194
  headers=headers,
195
195
  json=json,
196
196
  )
197
- handle_status_code(response)
197
+ handle_port_status_code(response)
198
198
  return response.json()["integration"]
199
199
 
200
200
  async def ingest_integration_logs(self, logs: list[dict[str, Any]]) -> None:
@@ -208,7 +208,7 @@ class IntegrationClientMixin:
208
208
  "logs": logs,
209
209
  },
210
210
  )
211
- handle_status_code(response, should_log=False)
211
+ handle_port_status_code(response, should_log=False)
212
212
  logger.debug("Logs successfully ingested")
213
213
 
214
214
  async def ingest_integration_kind_examples(
@@ -223,7 +223,7 @@ class IntegrationClientMixin:
223
223
  "examples": sensitive_log_filter.mask_object(data, full_hide=True),
224
224
  },
225
225
  )
226
- handle_status_code(response, should_log=should_log)
226
+ handle_port_status_code(response, should_log=should_log)
227
227
  logger.debug(f"Examples for kind {kind} successfully ingested")
228
228
 
229
229
  async def _delete_current_integration(self) -> httpx.Response:
@@ -238,5 +238,5 @@ class IntegrationClientMixin:
238
238
  self, should_raise: bool = True, should_log: bool = True
239
239
  ) -> dict[str, Any]:
240
240
  response = await self._delete_current_integration()
241
- handle_status_code(response, should_raise, should_log)
241
+ handle_port_status_code(response, should_raise, should_log)
242
242
  return response.json()
@@ -4,7 +4,7 @@ import httpx
4
4
  from loguru import logger
5
5
 
6
6
  from port_ocean.clients.port.authentication import PortAuthentication
7
- from port_ocean.clients.port.utils import handle_status_code
7
+ from port_ocean.clients.port.utils import handle_port_status_code
8
8
  from port_ocean.core.models import Migration
9
9
 
10
10
 
@@ -28,7 +28,7 @@ class MigrationClientMixin:
28
28
  headers=headers,
29
29
  )
30
30
 
31
- handle_status_code(response, should_raise=True)
31
+ handle_port_status_code(response, should_raise=True)
32
32
 
33
33
  migration_status = response.json().get("migration", {}).get("status", None)
34
34
  if (
@@ -2,7 +2,7 @@ from typing import List
2
2
  import httpx
3
3
  from loguru import logger
4
4
  from port_ocean.clients.port.authentication import PortAuthentication
5
- from port_ocean.clients.port.utils import handle_status_code
5
+ from port_ocean.clients.port.utils import handle_port_status_code
6
6
 
7
7
 
8
8
  class OrganizationClientMixin:
@@ -27,5 +27,5 @@ class OrganizationClientMixin:
27
27
  self, should_raise: bool = True, should_log: bool = True
28
28
  ) -> List[str]:
29
29
  response = await self._get_organization_feature_flags()
30
- handle_status_code(response, should_raise, should_log)
30
+ handle_port_status_code(response, should_raise, should_log)
31
31
  return response.json().get("organization", {}).get("featureFlags", [])
@@ -62,12 +62,17 @@ def get_internal_http_client(port_client: "PortClient") -> httpx.AsyncClient:
62
62
  return _port_internal_async_client
63
63
 
64
64
 
65
- def handle_status_code(
65
+ def handle_port_status_code(
66
66
  response: httpx.Response, should_raise: bool = True, should_log: bool = True
67
67
  ) -> None:
68
68
  if should_log and response.is_error:
69
- logger.error(
70
- f"Request failed with status code: {response.status_code}, Error: {response.text}"
71
- )
69
+ error_message = f"Request failed with status code: {response.status_code}, Error: {response.text}"
70
+ if response.status_code >= 500 and response.headers.get("x-trace-id"):
71
+ logger.error(
72
+ error_message,
73
+ trace_id=response.headers.get("x-trace-id"),
74
+ )
75
+ else:
76
+ logger.error(error_message)
72
77
  if should_raise:
73
78
  response.raise_for_status()
@@ -16,6 +16,7 @@ async def mocked_org_mixin() -> OrganizationClientMixin:
16
16
  client.get.return_value.json.return_value = {
17
17
  "organization": {"featureFlags": ["aa", "bb"]}
18
18
  }
19
+ client.get.return_value.status_code = 200
19
20
  return OrganizationClientMixin(auth=auth, client=client)
20
21
 
21
22
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.22.6
3
+ Version: 0.22.8
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
@@ -3,7 +3,7 @@ integrations/_infra/Dockerfile.alpine,sha256=7E4Sb-8supsCcseerHwTkuzjHZoYcaHIyxi
3
3
  integrations/_infra/Dockerfile.base.builder,sha256=Ogp_fodUE-lD-HgcfcFJd7pr520LPoEU9GCNk6HQBxk,619
4
4
  integrations/_infra/Dockerfile.base.runner,sha256=T7Tis9EjmcOl2jUXPMSENbRXMqwoHnnFPhgRmfEMO5Y,357
5
5
  integrations/_infra/Dockerfile.dockerignore,sha256=CM1Fxt3I2AvSvObuUZRmy5BNLSGC7ylnbpWzFgD4cso,1163
6
- integrations/_infra/Makefile,sha256=Pzfac3IA1eRxSNDkdOx1spQFxmyRZwqswTI8WGsFYnU,2420
6
+ integrations/_infra/Makefile,sha256=YgLKvuF_Dw4IA7X98Nus6zIW_3cJ60M1QFGs3imj5c4,2430
7
7
  integrations/_infra/grpcio.sh,sha256=m924poYznoRZ6Tt7Ct8Cs5AV_cmmOx598yIZ3z4DvZE,616
8
8
  integrations/_infra/init.sh,sha256=nN8lTrOhB286UfFvD6sJ9YJ-9asT9zVSddQB-RAb7Z4,99
9
9
  port_ocean/__init__.py,sha256=J3Mqp7d-CkEe9eMigGG8gSEiVKICY2bf7csNEwVOXk0,294
@@ -48,17 +48,17 @@ port_ocean/clients/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
48
48
  port_ocean/clients/auth/auth_client.py,sha256=scxx7AYqvXoRAd8_K-Ww26oErzi5l8ZCGPc0sVKgIfA,192
49
49
  port_ocean/clients/auth/oauth_client.py,sha256=RGMigXP8XOQECvEccXjF-EYPBXaxFDpA2aniN_vM3d0,794
50
50
  port_ocean/clients/port/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
- port_ocean/clients/port/authentication.py,sha256=6-uDMWsJ0xLe1-9IoYXHWmwtufj8rJR4BCRXJlSkCSQ,3447
52
- port_ocean/clients/port/client.py,sha256=OaNeN3U7Hw0tK4jYE6ESJEPKbTf9nGp2jcJVq00gnf8,3546
51
+ port_ocean/clients/port/authentication.py,sha256=r7r8Ag9WuwXy-CmgeOoj-PHbmJAQxhb2NMx8wrNzF3g,3457
52
+ port_ocean/clients/port/client.py,sha256=dv0mxIOde6J-wFi1FXXZkoNPVHrZzY7RSMhNkDD9xgA,3566
53
53
  port_ocean/clients/port/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
- port_ocean/clients/port/mixins/blueprints.py,sha256=POBl4uDocrgJBw4rvCAzwRcD4jk-uBL6pDAuKMTajdg,4633
55
- port_ocean/clients/port/mixins/entities.py,sha256=se1RudWS2R1WXyZvvkFgSiLejra91gl79zPY8QsRHeQ,10881
56
- port_ocean/clients/port/mixins/integrations.py,sha256=nqz1gvQnR6Nzv62ZfbXEyli7FTKW5DCFpI1x1KoJJ_E,9341
57
- port_ocean/clients/port/mixins/migrations.py,sha256=A6896oJF6WbFL2WroyTkMzr12yhVyWqGoq9dtLNSKBY,1457
58
- port_ocean/clients/port/mixins/organization.py,sha256=fCo_ZS8UlQXsyIx-odTuWkbnfcYmVnQfIsSyJuPOPjM,1031
54
+ port_ocean/clients/port/mixins/blueprints.py,sha256=aMCG4zePsMSMjMLiGrU37h5z5_ElfMzTcTvqvOI5wXY,4683
55
+ port_ocean/clients/port/mixins/entities.py,sha256=MaJjkp16wxc2fkd2BwgVIhHU05fi-7pM9OgX_cV3VmA,10901
56
+ port_ocean/clients/port/mixins/integrations.py,sha256=tvuP8jxgbDyTwGfp8hd0-NXfnsMjZFJXDEDzXroctnY,9381
57
+ port_ocean/clients/port/mixins/migrations.py,sha256=vdL_A_NNUogvzujyaRLIoZEu5vmKDY2BxTjoGP94YzI,1467
58
+ port_ocean/clients/port/mixins/organization.py,sha256=A2cP5V49KnjoAXxjmnm_XGth4ftPSU0qURNfnyUyS_Y,1041
59
59
  port_ocean/clients/port/retry_transport.py,sha256=PtIZOAZ6V-ncpVysRUsPOgt8Sf01QLnTKB5YeKBxkJk,1861
60
60
  port_ocean/clients/port/types.py,sha256=nvlgiAq4WH5_F7wQbz_GAWl-faob84LVgIjZ2Ww5mTk,451
61
- port_ocean/clients/port/utils.py,sha256=SjhgmJXAqH2JqXfGy8GoGwzUYiJvUhWDrJyxQcenxZc,2512
61
+ port_ocean/clients/port/utils.py,sha256=osFyAjw7Y5Qf2uVSqC7_RTCQfijiL1zS74JJM0goxh0,2762
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
@@ -148,7 +148,7 @@ port_ocean/tests/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
148
148
  port_ocean/tests/clients/oauth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
149
149
  port_ocean/tests/clients/oauth/test_oauth_client.py,sha256=2XVMQUalDpiD539Z7_dk5BK_ngXQzsTmb2lNBsfEm9c,3266
150
150
  port_ocean/tests/clients/port/mixins/test_entities.py,sha256=Zq_wKTymxJ0R8lHKztvEV6lN__3FZk8uTSIVpKCE6NA,1815
151
- port_ocean/tests/clients/port/mixins/test_organization_mixin.py,sha256=-8iHM33Oe8PuyEfj3O_6Yob8POp4fSmB0hnIT0Gv-8Y,868
151
+ port_ocean/tests/clients/port/mixins/test_organization_mixin.py,sha256=zzKYz3h8dl4Z5A2QG_924m0y9U6XTth1XYOfwNrd_24,914
152
152
  port_ocean/tests/conftest.py,sha256=JXASSS0IY0nnR6bxBflhzxS25kf4iNaABmThyZ0mZt8,101
153
153
  port_ocean/tests/core/conftest.py,sha256=BHfi7egDVNRpg61lHZlWj81_ohUG7DEVMdFe9yX-vkc,5517
154
154
  port_ocean/tests/core/defaults/test_common.py,sha256=sR7RqB3ZYV6Xn6NIg-c8k5K6JcGsYZ2SCe_PYX5vLYM,5560
@@ -188,8 +188,8 @@ port_ocean/utils/repeat.py,sha256=U2OeCkHPWXmRTVoPV-VcJRlQhcYqPWI5NfmPlb1JIbc,32
188
188
  port_ocean/utils/signal.py,sha256=mMVq-1Ab5YpNiqN4PkiyTGlV_G0wkUDMMjTZp5z3pb0,1514
189
189
  port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
190
190
  port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
191
- port_ocean-0.22.6.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
192
- port_ocean-0.22.6.dist-info/METADATA,sha256=UJyRnEhac_CupMFcjVqYAVcakRljWFseBOaCs9ky-cM,6764
193
- port_ocean-0.22.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
194
- port_ocean-0.22.6.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
195
- port_ocean-0.22.6.dist-info/RECORD,,
191
+ port_ocean-0.22.8.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
192
+ port_ocean-0.22.8.dist-info/METADATA,sha256=o8OYwTwdxk24xZt7KB8kXJLN_ukZNrnu3lMZOPTlbW8,6764
193
+ port_ocean-0.22.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
194
+ port_ocean-0.22.8.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
195
+ port_ocean-0.22.8.dist-info/RECORD,,