Skip to content

Commit

Permalink
Port 5728 ocean new command is failing (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
yairsimantov20 committed Dec 22, 2023
1 parent dd9737f commit d9bf231
Show file tree
Hide file tree
Showing 10 changed files with 457 additions and 434 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

## 0.4.12 (2023-12-22)


### Bug Fixes

- Fixed `ocean new` scaffolding error `'collections.OrderedDict object' has no attribute 'public_integration'` (PORT-5728)


## 0.4.11 (2023-12-21)

### Improvements

- Added handling for aggregation properties when initializing the integration, so it will patch the aggregation properties after creating the relations (PORT-5717)
- Changed entity property in the `portResourceConfig` to be required instead of optional, as we don't support creation of blueprints as part of the app config (PORT-4549)
- Changed entity property in the `portResourceConfig` to be required instead of optional, as we don't support creation of blueprints as part of the app config (PORT-4549)


## 0.4.10 (2023-12-21)
Expand Down
856 changes: 437 additions & 419 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion port_ocean/cli/cookiecutter/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def delete_docker_files():
if "{{ cookiecutter.public_integration }}" == "True":
if "{{ cookiecutter.remove_docker_files }}" == "True":
os.remove("Dockerfile")
os.remove(".dockerignore")

Expand Down
5 changes: 2 additions & 3 deletions port_ocean/clients/port/mixins/blueprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ async def create_blueprint(
self,
raw_blueprint: dict[str, Any],
user_agent_type: UserAgentType | None = None,
) -> None:
) -> dict[str, Any]:
logger.info(f"Creating blueprint with id: {raw_blueprint.get('identifier')}")
headers = await self.auth.headers(user_agent_type)
response = await self.client.post(
f"{self.auth.api_url}/blueprints", headers=headers, json=raw_blueprint
)
handle_status_code(response)
if response.is_success:
return response.json()["blueprint"]
return response.json()["blueprint"]

async def patch_blueprint(
self,
Expand Down
2 changes: 1 addition & 1 deletion port_ocean/clients/port/mixins/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, auth: PortAuthentication, client: httpx.AsyncClient):

async def wait_for_migration_to_complete(
self,
migration_id: list[str],
migration_id: str,
interval: int = 5,
) -> Migration:
logger.info(
Expand Down
8 changes: 3 additions & 5 deletions port_ocean/core/defaults/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
from loguru import logger

from port_ocean.context.ocean import ocean
from port_ocean.core.handlers.port_app_config.models import PortAppConfig


from port_ocean.core.defaults.common import (
get_port_integration_defaults,
is_integration_exists,
)
from port_ocean.core.handlers.port_app_config.models import PortAppConfig


def clean_defaults(
Expand Down Expand Up @@ -40,7 +38,7 @@ async def _clean_defaults(
return None

try:
migration_ids = await asyncio.gather(
delete_result = await asyncio.gather(
*(
port_client.delete_blueprint(
blueprint["identifier"], should_raise=True, delete_entities=force
Expand All @@ -55,7 +53,7 @@ async def _clean_defaults(
)
return None

migration_ids = [migration_id for migration_id in migration_ids if migration_id]
migration_ids = [migration_id for migration_id in delete_result if migration_id]

if migration_ids and len(migration_ids) > 0 and not wait:
logger.info(
Expand Down
2 changes: 1 addition & 1 deletion port_ocean/core/defaults/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def _create_resources(
created_blueprints = [
result["identifier"]
for result in create_results
if not isinstance(result, Exception)
if not isinstance(result, BaseException)
]

if errors:
Expand Down
2 changes: 1 addition & 1 deletion port_ocean/core/ocean_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class EntityDiff(TypedDict):

LISTENER_RESULT = Awaitable[RAW_RESULT] | ASYNC_GENERATOR_RESYNC_TYPE
RESYNC_EVENT_LISTENER = Callable[[str], LISTENER_RESULT]
START_EVENT_LISTENER = Callable[[], Awaitable]
START_EVENT_LISTENER = Callable[[], Awaitable[None]]


class IntegrationEventsCallbacks(TypedDict):
Expand Down
2 changes: 1 addition & 1 deletion port_ocean/helpers/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Any, Callable, Coroutine, Iterable, Mapping, Union

import httpx
from dateutil.parser import isoparse # type: ignore
from dateutil.parser import isoparse


# Adapted from https://github.com/encode/httpx/issues/108#issuecomment-1434439481
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "port-ocean"
version = "0.4.11"
version = "0.4.12"
description = "Port Ocean is a CLI tool for managing your Port projects."
readme = "README.md"
homepage = "https://app.getport.io"
Expand Down

0 comments on commit d9bf231

Please sign in to comment.