diff --git a/CHANGELOG.md b/CHANGELOG.md index 803b9b8787..2b7cb007fc 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.5.16 (2024-05-01) + +### Features + +- Allowing override of parent event context in ocean's event context manager + + ## 0.5.15 (2024-04-30) ### Bug Fixes diff --git a/port_ocean/context/event.py b/port_ocean/context/event.py index f0b80967a5..4bc0e2f542 100644 --- a/port_ocean/context/event.py +++ b/port_ocean/context/event.py @@ -125,10 +125,13 @@ async def event_context( event_type: str, trigger_type: TriggerType = "manual", attributes: dict[str, Any] | None = None, + parent_override: EventContext | None = None, ) -> AsyncIterator[EventContext]: - attributes = attributes or {} + parent = parent_override or _event_context_stack.top + parent_attributes = parent.attributes if parent else {} parent = _event_context_stack.top + attributes = {**parent_attributes, **(attributes or {})} new_event = EventContext( event_type, trigger_type=trigger_type, diff --git a/pyproject.toml b/pyproject.toml index 51f7fbcb98..bd125290c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "port-ocean" -version = "0.5.15" +version = "0.5.16" description = "Port Ocean is a CLI tool for managing your Port projects." readme = "README.md" homepage = "https://app.getport.io"