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

[Core] Validation provision enabled for integrations #1366

Merged
merged 2 commits into from
Feb 19, 2025

Conversation

erikzaadi
Copy link
Member

Description

  • Solve race condition when Port creates the integration config
  • Check if integration is enabled for port provisioning if flag is set

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)

All tests should be run against the port production environment(using a testing org).

Core testing checklist

  • Integration able to create all default resources from scratch
  • Resync finishes successfully
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Scheduled resync able to abort existing resync and start a new one
  • Tested with at least 2 integrations from scratch
  • Tested with Kafka and Polling event listeners
  • Tested deletion of entities that don't pass the selector

Integration testing checklist

  • Integration able to create all default resources from scratch
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Resync finishes successfully
  • If new resource kind is added or updated in the integration, add example raw data, mapping and expected result to the examples folder in the integration directory.
  • If resource kind is updated, run the integration with the example data and check if the expected result is achieved
  • If new resource kind is added or updated, validate that live-events for that resource are working as expected
  • Docs PR link here

Preflight checklist

  • Handled rate limiting
  • Handled pagination
  • Implemented the code in async
  • Support Multi account

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 Feb 3, 2025
@erikzaadi erikzaadi force-pushed the PORT-12242-ocean-saas-flow branch from cf5debc to 2d1026f Compare February 4, 2025 13:57
@erikzaadi erikzaadi marked this pull request as ready for review February 4, 2025 13:58
@erikzaadi erikzaadi requested a review from a team as a code owner February 4, 2025 13:58
@erikzaadi erikzaadi force-pushed the PORT-12242-ocean-saas-flow branch 2 times, most recently from 8bd2923 to eb234de Compare February 6, 2025 10:36
Copy link
Contributor

@omby8888 omby8888 left a comment

Choose a reason for hiding this comment

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

LGTM

@erikzaadi erikzaadi force-pushed the PORT-12242-ocean-saas-flow branch from eb234de to 4f38c34 Compare February 9, 2025 11:32
@Tankilevitch
Copy link
Contributor

/review

Copy link
Contributor

Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here.

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Error Handling

The new is_integration_provision_enabled method should handle API errors gracefully and have proper fallback behavior if the API call fails

async def is_integration_provision_enabled(
    self, integration_type: str, should_raise: bool = True, should_log: bool = True
) -> bool:
    enabled_integrations = await self.get_provision_enabled_integrations(
        should_raise, should_log
    )
    return integration_type in enabled_integrations
Race Condition

The integration config check at line 76 may still have race conditions with the polling mechanism. Consider adding additional validation or error handling.

if integration.get("config", {}) != {}:
    return integration
is_provision_enabled_for_integration = (
    await self.is_integration_provision_enabled(
        integration.get("installationAppType", ""),
        should_raise,
        should_log,
    )
)
if is_provision_enabled_for_integration:
    return self._poll_integration_until_default_provisioning_is_complete()
return integration

@erikzaadi erikzaadi force-pushed the PORT-12242-ocean-saas-flow branch 2 times, most recently from 0a40afa to 1701704 Compare February 18, 2025 13:20
* Solve race condition when Port creates the integration config
* Check if integration is enabled for port provisioning if flag is set
@erikzaadi erikzaadi force-pushed the PORT-12242-ocean-saas-flow branch from 1701704 to 63c9d58 Compare February 19, 2025 06:27
@erikzaadi erikzaadi merged commit 63c9d58 into main Feb 19, 2025
16 checks passed
@erikzaadi erikzaadi deleted the PORT-12242-ocean-saas-flow branch February 19, 2025 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants