Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Framework] Always initialize port default mappings in case where no other mapping is configured #700

Conversation

omby8888
Copy link
Contributor

@omby8888 omby8888 commented Jun 9, 2024

Description

What - Always initialize port default mappings in case where no other mapping is configured
Why - Integration that initializes with empty mapping wont do enything in resync and will cause confusion with our clients, furthermore integration that runs 'ONCE' will take no effect with initializeportresources=false
How - reorder the initialization proccess

Type of change

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

  • 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.

@github-actions github-actions bot added the size/M label Jun 9, 2024
Copy link
Collaborator

@yairsimantov20 yairsimantov20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments
also you are missing changelog and version bump
please bump it by minor and not by patch like usual i want to start managing the versions normally

port_ocean/core/defaults/initialize.py Outdated Show resolved Hide resolved
port_ocean/run.py Show resolved Hide resolved
port_ocean/core/defaults/initialize.py Outdated Show resolved Hide resolved
port_ocean/core/defaults/initialize.py Show resolved Hide resolved
port_ocean/core/defaults/initialize.py Outdated Show resolved Hide resolved
port_ocean/core/defaults/initialize.py Outdated Show resolved Hide resolved
@@ -73,7 +73,8 @@ async def _initialize_required_integration_settings(
port_app_config=default_mapping,
)
except httpx.HTTPStatusError as err:
raise Exception(f"Failed to apply default mapping: {err.response.text}.")
logger.error("Failed to apply default mapping")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.error("Failed to apply default mapping")
logger.error(f"Failed to apply default mapping: {err.response.text}.")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was the previous state, don't think it's needed to both log the error text and raise the whole exception

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole exception wont log the response text

Copy link
Collaborator

@yairsimantov20 yairsimantov20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more comments

port_ocean/core/defaults/initialize.py Outdated Show resolved Hide resolved
port_ocean/core/integrations/base.py Show resolved Hide resolved
port_ocean/core/defaults/initialize.py Show resolved Hide resolved
@Tankilevitch Tankilevitch changed the title [Framework] Port 7599 Always initialize port default mappings in case where no other mapping is configured [Framework] Always initialize port default mappings in case where no other mapping is configured Jun 9, 2024
port_ocean/core/defaults/initialize.py Outdated Show resolved Hide resolved
port_ocean/core/defaults/initialize.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Tankilevitch Tankilevitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@yairsimantov20 yairsimantov20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌊 dont forget to change the changelog date

@omby8888 omby8888 merged commit 00a4b4b into main Jun 10, 2024
5 checks passed
@omby8888 omby8888 deleted the PORT-7599-Ocean-Run-Once-with-initialize_port_resources-false-doesn-t-sync-resources branch June 10, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants