diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b7830bede..4fbbd5310f 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.9.13 (2024-08-13) + +### Improvements + +- Changed action CREATE route to use new v2 option + + ## 0.9.12 (2024-08-06) ### Bug Fixes diff --git a/port_ocean/clients/port/mixins/blueprints.py b/port_ocean/clients/port/mixins/blueprints.py index 24f9ee6453..2f77b6b04f 100644 --- a/port_ocean/clients/port/mixins/blueprints.py +++ b/port_ocean/clients/port/mixins/blueprints.py @@ -82,12 +82,10 @@ async def delete_blueprint( handle_status_code(response, should_raise) return response.json().get("migrationId", "") - async def create_action( - self, blueprint_identifier: str, action: dict[str, Any] - ) -> None: + async def create_action(self, action: dict[str, Any]) -> None: logger.info(f"Creating action: {action}") response = await self.client.post( - f"{self.auth.api_url}/blueprints/{blueprint_identifier}/actions", + f"{self.auth.api_url}/actions", json=action, headers=await self.auth.headers(), ) diff --git a/port_ocean/core/defaults/common.py b/port_ocean/core/defaults/common.py index a0ea9ba323..dfb84bb31a 100644 --- a/port_ocean/core/defaults/common.py +++ b/port_ocean/core/defaults/common.py @@ -24,7 +24,7 @@ class Preset(TypedDict): class Defaults(BaseModel): blueprints: list[dict[str, Any]] = [] - actions: list[Preset] = [] + actions: list[dict[str, Any]] = [] scorecards: list[Preset] = [] pages: list[dict[str, Any]] = [] port_app_config: Optional[PortAppConfig] = Field( diff --git a/port_ocean/core/defaults/initialize.py b/port_ocean/core/defaults/initialize.py index af54d523a2..d073b9a7ed 100644 --- a/port_ocean/core/defaults/initialize.py +++ b/port_ocean/core/defaults/initialize.py @@ -21,7 +21,7 @@ def deconstruct_blueprints_to_creation_steps( - raw_blueprints: list[dict[str, Any]] + raw_blueprints: list[dict[str, Any]], ) -> tuple[list[dict[str, Any]], ...]: """ Deconstructing the blueprint into stages so the api wont fail to create a blueprint if there is a conflict @@ -154,11 +154,7 @@ async def _create_resources( ) await asyncio.gather( - *( - port_client.create_action(blueprint_actions["blueprint"], action) - for blueprint_actions in defaults.actions - for action in blueprint_actions["data"] - ) + *(port_client.create_action(action) for action in defaults.actions) ) await asyncio.gather( diff --git a/pyproject.toml b/pyproject.toml index 13a67ba1ca..18a2655c3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "port-ocean" -version = "0.9.12" +version = "0.9.13" description = "Port Ocean is a CLI tool for managing your Port projects." readme = "README.md" homepage = "https://app.getport.io"