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] Port 8572 ocean startup when saas #697

Merged
merged 19 commits into from
Jun 19, 2024

Conversation

omby8888
Copy link
Contributor

@omby8888 omby8888 commented Jun 6, 2024

Description

What - handle startup when running as saas

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/S label Jun 6, 2024
@github-actions github-actions bot added size/M and removed size/S labels Jun 6, 2024
@omby8888 omby8888 marked this pull request as draft June 9, 2024 08:29
…up-when-Saas

# Conflicts:
#	CHANGELOG.md
#	port_ocean/core/defaults/initialize.py
#	pyproject.toml
@github-actions github-actions bot added size/S and removed size/M labels Jun 13, 2024
@github-actions github-actions bot added size/M and removed size/S labels Jun 13, 2024
@omby8888 omby8888 marked this pull request as ready for review June 13, 2024 13:46
port_ocean/core/utils.py Show resolved Hide resolved
Comment on lines 39 to 40
raise Exception(
f"Can't run {current_runtime} integration in {requested_runtime} runtime"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use custom exception that inherit ocean exceptions

port_ocean/run.py Show resolved Hide resolved
pyproject.toml Outdated
@@ -1,6 +1,6 @@
[tool.poetry]
name = "port-ocean"
version = "0.7.1"
version = "0.7.2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Its a new feature therefore it should be a new minor

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.

small comment
and update the changelog date

current_integration = await port_client.get_current_integration(should_raise=False)
current_runtime = current_integration.get("installationType", "OnPrem")
if current_integration and current_runtime != requested_runtime:
raise OceanAbortException(
Copy link
Collaborator

Choose a reason for hiding this comment

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

ocean abort exception are for resyncs
can you create a new dedicated exception derived from BaseOceanException?

Comment on lines +33 to +35
async def validate_integration_runtime(
port_client: PortClient, requested_runtime: Runtime
) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe add a debug log

CHANGELOG.md Outdated
@@ -7,6 +7,13 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

## 0.9.0 (2024-06-18)
Copy link
Collaborator

Choose a reason for hiding this comment

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

update the date

current_runtime = current_integration.get("installationType", "OnPrem")
if current_integration and current_runtime != requested_runtime:
raise OceanAbortException(
f"Can't run {requested_runtime} integration in {current_runtime} runtime"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Be more precise and verbose

@omby8888 omby8888 merged commit 935071b into main Jun 19, 2024
5 checks passed
@omby8888 omby8888 deleted the PORT-8572-Ocean-Startup-when-Saas branch June 19, 2024 10:55
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.

None yet

2 participants