Skip to content

Commit

Permalink
Pydantic fail cli (#915)
Browse files Browse the repository at this point in the history
# Description

What - The ocean cli is failing in any folder that dont contain a
pyproject.toml folder
Why - The cli imports is causing one of the ocean setting models to
check for the pyproject.toml file on the init
How - initiating the problematic model with default factory instead

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)
  • Loading branch information
yairsimantov20 authored Aug 19, 2024
1 parent 6010aaf commit 833df49
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

## 0.9.14 (2024-08-19)


### Bug Fixes

- Fixed an issue causing the cli to fail in a directory with no pyproject.toml in it


## 0.9.13 (2024-08-13)

### Improvements
Expand Down
4 changes: 3 additions & 1 deletion port_ocean/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ class IntegrationConfiguration(BaseOceanSettings, extra=Extra.allow):
port: PortSettings
event_listener: EventListenerSettingsType
# If an identifier or type is not provided, it will be generated based on the integration name
integration: IntegrationSettings = IntegrationSettings(type="", identifier="")
integration: IntegrationSettings = Field(
default_factory=lambda: IntegrationSettings(type="", identifier="")
)
runtime: Runtime = "OnPrem"

@root_validator()
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.9.13"
version = "0.9.14"
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 833df49

Please sign in to comment.