Skip to content

Commit

Permalink
Fixed an issue causing integrations with no configuration to fail dur… (
Browse files Browse the repository at this point in the history
#689)

# Description

What - Integrations with no configuration failed
Why - bug due to one of the latest change 
How - Initialized with default values

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)
  • Loading branch information
yairsimantov20 authored Jun 4, 2024
1 parent 4c5c59b commit 807191e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 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.5.26 (2024-06-04)


### Bug Fixes

- Fixed an issue causing integrations with no configuration to fail during the initialization process


## 0.5.25 (2024-06-03)


Expand Down
7 changes: 4 additions & 3 deletions port_ocean/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class PortSettings(BaseOceanModel, extra=Extra.allow):
class IntegrationSettings(BaseOceanModel, extra=Extra.allow):
identifier: str = Field(..., min_length=1)
type: str = Field(..., min_length=1)
config: dict[str, Any] | BaseModel
config: dict[str, Any] | BaseModel = Field(default_factory=dict)

@root_validator(pre=True)
def a(cls, values: dict[str, Any]) -> dict[str, Any]:
def root_validator(cls, values: dict[str, Any]) -> dict[str, Any]:
integ_type = values.get("type")

if not integ_type:
Expand All @@ -68,4 +68,5 @@ class IntegrationConfiguration(BaseOceanSettings, extra=Extra.allow):
send_raw_data_examples: bool = True
port: PortSettings
event_listener: EventListenerSettingsType
integration: IntegrationSettings
# If an identifier or type is not provided, it will be generated based on the integration name
integration: IntegrationSettings = IntegrationSettings(type="", identifier="")
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.5.25"
version = "0.5.26"
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 807191e

Please sign in to comment.