Skip to content

Commit

Permalink
[Framework] Refer to entity in upsert entity response (#943)
Browse files Browse the repository at this point in the history
# Description

What - Refer to entity in upsert entity response
Why - Response from upsert entity api isn't processed right and causes
ocean core to use the raw entity that contains dict typed relation
instead of string which is the relation's entity identifier
How - Simply refer to the entity key in a response that looks like {ok:
true, entity: {...}}

## Type of change

Please leave one option from the following and delete the rest:

- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] New Integration (non-breaking change which adds a new integration)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Non-breaking change (fix of existing functionality that will not
change current behavior)
- [ ] Documentation (added/updated documentation)

## Screenshots

Include screenshots from your environment showing how the resources of
the integration will look.

## API Documentation

Provide links to the API documentation used for this integration.
  • Loading branch information
omby8888 authored Aug 26, 2024
1 parent 2b7377c commit fcdcd09
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .idea/watcherTasks.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

## 0.10.1 (2024-08-26)

### Bug Fixes

- Fixed unhashable type: 'dict' error when trying to delete entities with search identifier/relations


## 0.10.0 (2024-08-19)

### Improvements
Expand All @@ -17,7 +24,6 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## 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
Expand Down Expand Up @@ -128,7 +134,7 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Bug Fixes

- Safely get changelogDestination key instead of accessing it directly
- Safely get changelogDestination key instead of accessing it directly


## 0.9.0 (2024-06-19)
Expand Down Expand Up @@ -589,7 +595,7 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Fixed kafka consumer to poll messages asynchronously, to avoid max poll timeout when running long resyncs (PORT-5160)
- Fixed a bug where the expiration of a Port token is not properly handled (PORT-5161)
- Fixed a bug where the `retry_every` didn't count failed runs as repetitions (PORT-5161)
- Fixed a bug where the `retry_every` didn't count failed runs as repetitions (PORT-5161)

## 0.4.2 (2023-11-04)

Expand Down Expand Up @@ -619,7 +625,7 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Fixed the `initialize-port-resources` option in `ocean sail` to not be a flag.
- Changed default of `initialize-port-resources` to `true`.
- Catch all exceptions in the resync of ONCE event listener,to make sure the application will exit gracefully
- Catch all exceptions in the resync of ONCE event listener,to make sure the application will exit gracefully


## 0.4.0 (2023-10-31)
Expand Down
2 changes: 1 addition & 1 deletion port_ocean/clients/port/mixins/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def upsert_entity(
)
handle_status_code(response, should_raise)
result = response.json()
result_entity = Entity.parse_obj(result)
result_entity = Entity.parse_obj(result["entity"])
# Set the results of the search relation and identifier to the entity
entity.identifier = result_entity.identifier or entity.identifier
entity.relations = result_entity.relations or entity.relations
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.10.0"
version = "0.10.1"
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 fcdcd09

Please sign in to comment.