From 5c91d5b8c1a5459641223d3d39e79e1643ac06df Mon Sep 17 00:00:00 2001 From: talsabagport Date: Wed, 29 May 2024 15:18:26 +0300 Subject: [PATCH] [Core] Fix ingest example url (#664) # Description What - fix ingest example url Why - kind can include `/` How - add quote ## Type of change Please leave one option from the following and delete the rest: - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] New Integration (non-breaking change which adds a new integration) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Non-breaking change (fix of existing functionality that will not change current behavior) - [ ] Documentation (added/updated documentation) ## Screenshots Include screenshots from your environment showing how the resources of the integration will look. ## API Documentation Provide links to the API documentation used for this integration. --- CHANGELOG.md | 7 +++++++ port_ocean/clients/port/mixins/integrations.py | 3 ++- pyproject.toml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1367c87b6b..953b51e3a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm +## 0.5.22 (2024-05-29) + +### Bug Fixes + +- Fixed an issue in `send_raw_data_examples` when there are slashes in integration kind + + ## 0.5.21 (2024-05-26) ### Features diff --git a/port_ocean/clients/port/mixins/integrations.py b/port_ocean/clients/port/mixins/integrations.py index 5fc4575748..fb54457059 100644 --- a/port_ocean/clients/port/mixins/integrations.py +++ b/port_ocean/clients/port/mixins/integrations.py @@ -1,4 +1,5 @@ from typing import Any, TYPE_CHECKING, Optional, TypedDict +from urllib.parse import quote_plus import httpx from loguru import logger @@ -145,7 +146,7 @@ async def ingest_integration_kind_examples( logger.debug(f"Ingesting examples for kind: {kind}") headers = await self.auth.headers() response = await self.client.post( - f"{self.auth.api_url}/integration/{self.integration_identifier}/kinds/{kind}/examples", + f"{self.auth.api_url}/integration/{quote_plus(self.integration_identifier)}/kinds/{quote_plus(kind)}/examples", headers=headers, json={ "examples": sensitive_log_filter.mask_object(data, full_hide=True), diff --git a/pyproject.toml b/pyproject.toml index e04fe2feb0..5094ed85fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "port-ocean" -version = "0.5.21" +version = "0.5.22" description = "Port Ocean is a CLI tool for managing your Port projects." readme = "README.md" homepage = "https://app.getport.io"