From 887abee8caf4542cf9f406c869a28039d4880b1b Mon Sep 17 00:00:00 2001 From: Yair Siman Tov <63305203+yairsimantov20@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:58:27 +0200 Subject: [PATCH] PORT-5378 normalizing identifier to lowercase (#254) --- CHANGELOG.md | 9 +++++++++ port_ocean/config/settings.py | 6 +++++- port_ocean/core/defaults/initialize.py | 5 ++--- pyproject.toml | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 262643385f..29a3b49a82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm +## 0.4.6 (2023-12-04) + + +### Bug Fixes + +- Fixed a bug that triggered the integration to update during the initialization process when the integration already existed and the organization lacked default blueprints (PORT-5378). +- Fixed an issue where setting integration type or identifier that contains a capital letter will not show the integration in the UI (PORT-5399) + + ## 0.4.5 (2023-11-30) diff --git a/port_ocean/config/settings.py b/port_ocean/config/settings.py index c12134223c..0f392b920b 100644 --- a/port_ocean/config/settings.py +++ b/port_ocean/config/settings.py @@ -1,6 +1,6 @@ from typing import Any, Literal -from pydantic import BaseSettings, BaseModel, Extra, AnyHttpUrl, parse_obj_as +from pydantic import BaseSettings, BaseModel, Extra, AnyHttpUrl, parse_obj_as, validator from port_ocean.config.base import BaseOceanSettings from port_ocean.core.event_listener import EventListenerSettingsType @@ -33,6 +33,10 @@ class IntegrationSettings(BaseModel, extra=Extra.allow): type: str config: dict[str, Any] + @validator("identifier", "type") + def validate_lower(cls, v: str) -> str: + return v.lower() + class IntegrationConfiguration(BaseOceanSettings, extra=Extra.allow): initialize_port_resources: bool = True diff --git a/port_ocean/core/defaults/initialize.py b/port_ocean/core/defaults/initialize.py index 415df1d81c..d91984a3f6 100644 --- a/port_ocean/core/defaults/initialize.py +++ b/port_ocean/core/defaults/initialize.py @@ -8,13 +8,12 @@ from port_ocean.clients.port.types import UserAgentType from port_ocean.config.settings import IntegrationConfiguration from port_ocean.context.ocean import ocean +from port_ocean.core.defaults.common import Defaults, get_port_integration_defaults from port_ocean.core.handlers.port_app_config.models import PortAppConfig from port_ocean.exceptions.port_defaults import ( AbortDefaultCreationError, ) -from port_ocean.core.defaults.common import Defaults, get_port_integration_defaults - def deconstruct_blueprints_to_creation_steps( raw_blueprints: list[dict[str, Any]] @@ -111,7 +110,7 @@ async def _create_resources( ) ) - await port_client.initialize_integration( + await port_client.create_integration( integration_config.integration.type, integration_config.event_listener.to_request(), port_app_config=defaults.port_app_config, diff --git a/pyproject.toml b/pyproject.toml index fd3b18d807..34b2d18fd5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "port-ocean" -version = "0.4.5" +version = "0.4.6" description = "Port Ocean is a CLI tool for managing your Port projects." readme = "README.md" homepage = "https://app.getport.io"