Skip to content

Commit

Permalink
[Framework] Not showing misleading error message if port state is emp…
Browse files Browse the repository at this point in the history
…ty (#887)

# Description

What - Not showing misleading error message if port state is empty

## 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 5, 2024
1 parent f6a5db4 commit 2237fcf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 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.9.11 (2024-08-05)


### Bug Fixes

- Not showing misleading error message if port state is empty

## 0.9.10 (2024-08-04)


Expand Down
5 changes: 3 additions & 2 deletions port_ocean/core/integrations/mixins/sync_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ async def sync_raw_all(
)
logger.info(f"Resync will use the following mappings: {app_config.dict()}")
try:
did_fetched_current_state = True
entities_at_port = await ocean.port_client.search_entities(
user_agent_type
)
Expand All @@ -429,7 +430,7 @@ async def sync_raw_all(
f"Response status code: {e.response.status_code if isinstance(e, httpx.HTTPStatusError) else None}\n"
f"Response content: {e.response.text if isinstance(e, httpx.HTTPStatusError) else None}\n"
)
entities_at_port = []
did_fetched_current_state = False

creation_results: list[tuple[list[Entity], list[Exception]]] = []

Expand All @@ -448,7 +449,7 @@ async def sync_raw_all(
except asyncio.CancelledError as e:
logger.warning("Resync aborted successfully")
else:
if not entities_at_port:
if not did_fetched_current_state:
logger.warning(
"Due to an error before the resync, the previous state of entities at Port is unknown."
" Skipping delete phase due to unknown initial state."
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.10"
version = "0.9.11"
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 2237fcf

Please sign in to comment.