port-ocean 0.30.0__tar.gz → 0.30.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {port_ocean-0.30.0 → port_ocean-0.30.2}/PKG-INFO +1 -1
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/mixins/entities.py +14 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/defaults/initialize.py +73 -11
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/entity_processor/jq_entity_processor.py +31 -9
- port_ocean-0.30.2/port_ocean/tests/core/defaults/test_initialize.py +219 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/entity_processor/test_jq_entity_processor.py +29 -6
- {port_ocean-0.30.0 → port_ocean-0.30.2}/pyproject.toml +1 -1
- {port_ocean-0.30.0 → port_ocean-0.30.2}/LICENSE.md +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/README.md +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/integrations/_infra/Dockerfile.Deb +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/integrations/_infra/Dockerfile.alpine +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/integrations/_infra/Dockerfile.base.builder +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/integrations/_infra/Dockerfile.base.runner +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/integrations/_infra/Dockerfile.dockerignore +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/integrations/_infra/Dockerfile.local +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/integrations/_infra/Makefile +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/integrations/_infra/README.md +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/integrations/_infra/entry_local.sh +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/integrations/_infra/grpcio.sh +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/integrations/_infra/init.sh +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/bootstrap.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cache/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cache/base.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cache/disk.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cache/errors.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cache/memory.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cli.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/commands/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/commands/defaults/__init___.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/commands/defaults/clean.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/commands/defaults/dock.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/commands/defaults/group.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/commands/list_integrations.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/commands/main.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/commands/new.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/commands/pull.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/commands/sail.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/commands/version.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/cookiecutter.json +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/extensions.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/hooks/post_gen_project.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.env.example +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.gitignore +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/.gitignore +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/blueprints.json +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/port-app-config.yml +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/spec.yaml +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CHANGELOG.md +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CONTRIBUTING.md +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/README.md +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/changelog/.gitignore +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/debug.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/main.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/poetry.toml +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/pyproject.toml +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/sonar-project.properties +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/test_sample.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/utils.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/auth/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/auth/auth_client.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/auth/oauth_client.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/authentication.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/client.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/mixins/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/mixins/actions.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/mixins/blueprints.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/mixins/integrations.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/mixins/migrations.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/mixins/organization.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/retry_transport.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/types.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/clients/port/utils.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/config/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/config/base.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/config/dynamic.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/config/settings.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/consumers/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/consumers/kafka_consumer.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/context/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/context/event.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/context/metric_resource.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/context/ocean.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/context/resource.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/defaults/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/defaults/clean.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/defaults/common.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/event_listener/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/event_listener/actions_only.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/event_listener/base.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/event_listener/factory.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/event_listener/http.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/event_listener/kafka.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/event_listener/once.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/event_listener/polling.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/event_listener/webhooks_only.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/actions/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/actions/abstract_executor.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/actions/execution_manager.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/base.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/entities_state_applier/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/entities_state_applier/base.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/entities_state_applier/port/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/entities_state_applier/port/applier.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/entities_state_applier/port/get_related_entities.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/entities_state_applier/port/order_by_entities_dependencies.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/entity_processor/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/entity_processor/base.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/entity_processor/jq_input_evaluator.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/port_app_config/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/port_app_config/api.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/port_app_config/base.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/port_app_config/models.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/queue/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/queue/abstract_queue.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/queue/group_queue.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/queue/local_queue.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/resync_state_updater/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/resync_state_updater/updater.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/webhook/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/webhook/abstract_webhook_processor.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/webhook/processor_manager.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/handlers/webhook/webhook_event.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/integrations/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/integrations/base.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/integrations/mixins/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/integrations/mixins/events.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/integrations/mixins/handler.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/integrations/mixins/live_events.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/integrations/mixins/sync.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/integrations/mixins/sync_raw.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/integrations/mixins/utils.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/models.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/ocean_types.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/utils/entity_topological_sorter.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/core/utils/utils.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/debug_cli.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/exceptions/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/exceptions/api.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/exceptions/base.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/exceptions/clients.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/exceptions/context.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/exceptions/core.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/exceptions/execution_manager.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/exceptions/port_defaults.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/exceptions/utils.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/exceptions/webhook_processor.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/helpers/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/helpers/async_client.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/helpers/metric/metric.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/helpers/metric/utils.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/helpers/retry.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/helpers/stream.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/log/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/log/handlers.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/log/logger_setup.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/log/sensetive.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/middlewares.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/ocean.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/py.typed +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/run.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/sonar-project.properties +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/cache/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/cache/test_disk_cache.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/cache/test_memory_cache.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/clients/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/clients/oauth/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/clients/oauth/test_oauth_client.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/clients/port/mixins/test_entities.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/clients/port/mixins/test_integrations.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/clients/port/mixins/test_organization_mixin.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/config/test_config.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/conftest.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/conftest.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/defaults/test_common.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/event_listener/test_kafka.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/actions/test_execution_manager.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/entities_state_applier/test_applier.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/entity_processor/test_jq_input_evaluator.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/mixins/test_live_events.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/mixins/test_sync_raw.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/port_app_config/test_api.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/port_app_config/test_base.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/queue/test_group_queue.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/queue/test_local_queue.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/webhook/test_abstract_webhook_processor.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/webhook/test_processor_manager.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/handlers/webhook/test_webhook_event.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/test_utils.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/utils/test_entity_topological_sorter.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/utils/test_get_port_diff.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/core/utils/test_resolve_entities_diff.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/helpers/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/helpers/fake_port_api.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/helpers/fixtures.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/helpers/integration.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/helpers/ocean_app.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/helpers/port_client.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/helpers/smoke_test.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/helpers/test_retry.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/log/test_handlers.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/test_metric.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/test_metrics_endpoints.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/test_ocean.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/test_smoke.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/utils/test_async_iterators.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/tests/utils/test_cache.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/utils/__init__.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/utils/async_http.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/utils/async_iterators.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/utils/cache.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/utils/ipc.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/utils/misc.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/utils/queue_utils.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/utils/repeat.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/utils/signal.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/utils/time.py +0 -0
- {port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/version.py +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import json
|
|
3
|
+
from collections import Counter
|
|
3
4
|
from typing import Any, Literal
|
|
4
5
|
from urllib.parse import quote_plus
|
|
5
6
|
|
|
@@ -355,6 +356,19 @@ class EntityClientMixin:
|
|
|
355
356
|
entities_results: list[tuple[bool, Entity]] = []
|
|
356
357
|
blueprint = entities[0].blueprint
|
|
357
358
|
|
|
359
|
+
identifier_counts = Counter((e.blueprint, e.identifier) for e in entities)
|
|
360
|
+
duplicate_count = sum(
|
|
361
|
+
count - 1 for count in identifier_counts.values() if count > 1
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
if duplicate_count:
|
|
365
|
+
duplicate_examples = [
|
|
366
|
+
key for key, cnt in identifier_counts.items() if cnt > 1
|
|
367
|
+
][:5]
|
|
368
|
+
logger.warning(
|
|
369
|
+
f"Detected {duplicate_count} duplicate entities (by blueprint and identifier) that may not be ingested because an identical identifier existed. Examples: {duplicate_examples}"
|
|
370
|
+
)
|
|
371
|
+
|
|
358
372
|
bulk_size = self.calculate_entities_batch_size(entities)
|
|
359
373
|
bulks = [
|
|
360
374
|
entities[i : i + bulk_size] for i in range(0, len(entities), bulk_size)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import Any, Type
|
|
3
3
|
|
|
4
4
|
import httpx
|
|
5
5
|
from loguru import logger
|
|
@@ -114,12 +114,67 @@ async def _initialize_required_integration_settings(
|
|
|
114
114
|
)
|
|
115
115
|
|
|
116
116
|
|
|
117
|
+
async def _mapped_blueprints_exist(
|
|
118
|
+
port_client: PortClient,
|
|
119
|
+
defaults: Defaults | None = None,
|
|
120
|
+
has_provision_feature_flag: bool = False,
|
|
121
|
+
) -> bool:
|
|
122
|
+
if not defaults:
|
|
123
|
+
return True
|
|
124
|
+
|
|
125
|
+
integration = await port_client.get_current_integration(
|
|
126
|
+
should_log=False,
|
|
127
|
+
should_raise=False,
|
|
128
|
+
has_provision_feature_flag=has_provision_feature_flag,
|
|
129
|
+
)
|
|
130
|
+
integration_config = integration.get("config", {})
|
|
131
|
+
resources = integration_config.get("resources", [])
|
|
132
|
+
|
|
133
|
+
if not isinstance(resources, list):
|
|
134
|
+
return True
|
|
135
|
+
|
|
136
|
+
mapped_blueprints = []
|
|
137
|
+
for resource in resources:
|
|
138
|
+
blueprint = (
|
|
139
|
+
resource.get("port", {})
|
|
140
|
+
.get("entity", {})
|
|
141
|
+
.get("mappings", {})
|
|
142
|
+
.get("blueprint")
|
|
143
|
+
)
|
|
144
|
+
if blueprint:
|
|
145
|
+
if (
|
|
146
|
+
isinstance(blueprint, str)
|
|
147
|
+
and blueprint.startswith('"')
|
|
148
|
+
and blueprint.endswith('"')
|
|
149
|
+
):
|
|
150
|
+
blueprint = blueprint.strip('"')
|
|
151
|
+
mapped_blueprints.append({"identifier": blueprint})
|
|
152
|
+
|
|
153
|
+
if not mapped_blueprints:
|
|
154
|
+
return True
|
|
155
|
+
|
|
156
|
+
existing_blueprints, _ = await gather_and_split_errors_from_results(
|
|
157
|
+
[
|
|
158
|
+
port_client.get_blueprint(blueprint["identifier"], should_log=False)
|
|
159
|
+
for blueprint in mapped_blueprints
|
|
160
|
+
],
|
|
161
|
+
lambda item: isinstance(item, Blueprint),
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
if len(existing_blueprints) != len(mapped_blueprints):
|
|
165
|
+
return False
|
|
166
|
+
|
|
167
|
+
return True
|
|
168
|
+
|
|
169
|
+
|
|
117
170
|
async def _create_resources(
|
|
118
171
|
port_client: PortClient,
|
|
119
172
|
defaults: Defaults | None = None,
|
|
173
|
+
has_provision_feature_flag: bool = False,
|
|
120
174
|
) -> None:
|
|
121
175
|
if not defaults:
|
|
122
176
|
return
|
|
177
|
+
|
|
123
178
|
creation_stage, *blueprint_patches = deconstruct_blueprints_to_creation_steps(
|
|
124
179
|
defaults.blueprints
|
|
125
180
|
)
|
|
@@ -132,7 +187,13 @@ async def _create_resources(
|
|
|
132
187
|
lambda item: isinstance(item, Blueprint),
|
|
133
188
|
)
|
|
134
189
|
|
|
135
|
-
|
|
190
|
+
mapped_blueprints_exist = await _mapped_blueprints_exist(
|
|
191
|
+
port_client,
|
|
192
|
+
defaults,
|
|
193
|
+
has_provision_feature_flag,
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
if blueprints_results or mapped_blueprints_exist:
|
|
136
197
|
logger.info(
|
|
137
198
|
f"Blueprints already exist: {[result.identifier for result in blueprints_results]}. Skipping integration default creation..."
|
|
138
199
|
)
|
|
@@ -184,15 +245,16 @@ async def _create_resources(
|
|
|
184
245
|
)
|
|
185
246
|
)
|
|
186
247
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
for action in blueprint_scorecards["data"]
|
|
248
|
+
(
|
|
249
|
+
created_scorecards,
|
|
250
|
+
scorecards_errors,
|
|
251
|
+
) = await gather_and_split_errors_from_results(
|
|
252
|
+
(
|
|
253
|
+
port_client.create_scorecard(
|
|
254
|
+
blueprint_scorecards["blueprint"], action, should_log=False
|
|
195
255
|
)
|
|
256
|
+
for blueprint_scorecards in defaults.scorecards
|
|
257
|
+
for action in blueprint_scorecards["data"]
|
|
196
258
|
)
|
|
197
259
|
)
|
|
198
260
|
|
|
@@ -286,7 +348,7 @@ async def _initialize_defaults(
|
|
|
286
348
|
return
|
|
287
349
|
try:
|
|
288
350
|
logger.info("Found default resources, starting creation process")
|
|
289
|
-
await _create_resources(port_client, defaults)
|
|
351
|
+
await _create_resources(port_client, defaults, has_provision_feature_flag)
|
|
290
352
|
except AbortDefaultCreationError as e:
|
|
291
353
|
logger.warning(
|
|
292
354
|
f"Failed to create resources. Rolling back blueprints : {e.blueprints_to_rollback}"
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
+
import json
|
|
3
|
+
import re
|
|
2
4
|
from asyncio import Task
|
|
3
5
|
from dataclasses import dataclass, field
|
|
4
6
|
from functools import lru_cache
|
|
5
|
-
import json
|
|
6
7
|
from typing import Any, Optional
|
|
8
|
+
|
|
7
9
|
import jq # type: ignore
|
|
8
10
|
from loguru import logger
|
|
11
|
+
|
|
9
12
|
from port_ocean.context.ocean import ocean
|
|
10
13
|
from port_ocean.core.handlers.entity_processor.base import BaseEntityProcessor
|
|
14
|
+
from port_ocean.core.handlers.entity_processor.jq_input_evaluator import (
|
|
15
|
+
InputClassifyingResult,
|
|
16
|
+
can_expression_run_with_no_input,
|
|
17
|
+
classify_input,
|
|
18
|
+
)
|
|
11
19
|
from port_ocean.core.handlers.port_app_config.models import ResourceConfig
|
|
12
20
|
from port_ocean.core.models import Entity
|
|
13
21
|
from port_ocean.core.ocean_types import (
|
|
14
22
|
RAW_ITEM,
|
|
15
|
-
EntitySelectorDiff,
|
|
16
23
|
CalculationResult,
|
|
24
|
+
EntitySelectorDiff,
|
|
17
25
|
)
|
|
18
26
|
from port_ocean.core.utils.utils import (
|
|
19
27
|
gather_and_split_errors_from_results,
|
|
@@ -21,11 +29,6 @@ from port_ocean.core.utils.utils import (
|
|
|
21
29
|
)
|
|
22
30
|
from port_ocean.exceptions.core import EntityProcessorException
|
|
23
31
|
from port_ocean.utils.queue_utils import process_in_queue
|
|
24
|
-
from port_ocean.core.handlers.entity_processor.jq_input_evaluator import (
|
|
25
|
-
InputClassifyingResult,
|
|
26
|
-
classify_input,
|
|
27
|
-
can_expression_run_with_no_input,
|
|
28
|
-
)
|
|
29
32
|
|
|
30
33
|
|
|
31
34
|
class ExampleStates:
|
|
@@ -92,8 +95,29 @@ class JQEntityProcessor(BaseEntityProcessor):
|
|
|
92
95
|
searching for data in dictionaries, and transforming data based on object mappings.
|
|
93
96
|
"""
|
|
94
97
|
|
|
98
|
+
@staticmethod
|
|
99
|
+
def _format_filter(filter: str) -> str:
|
|
100
|
+
"""
|
|
101
|
+
Convert single quotes to double quotes in JQ expressions.
|
|
102
|
+
Only replaces single quotes that are opening or closing string delimiters,
|
|
103
|
+
not single quotes that are part of string content.
|
|
104
|
+
"""
|
|
105
|
+
# Escape single quotes only if they are opening or closing a string
|
|
106
|
+
# Pattern matches:
|
|
107
|
+
# - Single quote at start of string or after whitespace (opening quote)
|
|
108
|
+
# - Single quote before whitespace or end of string (closing quote)
|
|
109
|
+
# Uses negative lookahead/lookbehind to avoid replacing quotes inside strings
|
|
110
|
+
# \1 and \2 will be empty for the alternative that didn't match, so \1"\2 works for both cases
|
|
111
|
+
# This matches the TypeScript pattern: /(^|\s)'(?!\s|")|(?<!\s|")'(\s|$)/g
|
|
112
|
+
formatted_filter = re.sub(
|
|
113
|
+
r'(^|\s)\'(?!\s|")|(?<!\s|")\'(\s|$)', r'\1"\2', filter
|
|
114
|
+
)
|
|
115
|
+
return formatted_filter
|
|
116
|
+
|
|
95
117
|
@lru_cache
|
|
96
118
|
def _compile(self, pattern: str) -> Any:
|
|
119
|
+
# Convert single quotes to double quotes for JQ compatibility
|
|
120
|
+
pattern = self._format_filter(pattern)
|
|
97
121
|
if not ocean.config.allow_environment_variables_jq_access:
|
|
98
122
|
pattern = "def env: {}; {} as $ENV | " + pattern
|
|
99
123
|
return jq.compile(pattern)
|
|
@@ -119,7 +143,6 @@ class JQEntityProcessor(BaseEntityProcessor):
|
|
|
119
143
|
missing_required_fields: bool,
|
|
120
144
|
entity_mapping_fault_counter: int,
|
|
121
145
|
) -> None:
|
|
122
|
-
|
|
123
146
|
if len(entity_misconfigurations) > 0:
|
|
124
147
|
logger.info(
|
|
125
148
|
f"Unable to find valid data for: {entity_misconfigurations} (null, missing, or misconfigured)"
|
|
@@ -444,7 +467,6 @@ class JQEntityProcessor(BaseEntityProcessor):
|
|
|
444
467
|
key: str,
|
|
445
468
|
value: dict[str, Any],
|
|
446
469
|
) -> None:
|
|
447
|
-
|
|
448
470
|
if key in ["properties", "relations"]:
|
|
449
471
|
mapping_dicts: dict[InputClassifyingResult, dict[str, Any]] = {
|
|
450
472
|
InputClassifyingResult.SINGLE: {},
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from unittest.mock import AsyncMock, MagicMock
|
|
3
|
+
|
|
4
|
+
import pytest
|
|
5
|
+
|
|
6
|
+
from port_ocean.clients.port.client import PortClient
|
|
7
|
+
from port_ocean.clients.port.types import UserAgentType
|
|
8
|
+
from port_ocean.core.defaults.common import Defaults
|
|
9
|
+
from port_ocean.core.defaults.initialize import _create_resources
|
|
10
|
+
from port_ocean.core.models import Blueprint
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@pytest.fixture
|
|
14
|
+
def mock_defaults() -> Defaults:
|
|
15
|
+
"""Create a mock Defaults object with sample data."""
|
|
16
|
+
return Defaults(
|
|
17
|
+
blueprints=[
|
|
18
|
+
{
|
|
19
|
+
"identifier": "blueprint1",
|
|
20
|
+
"title": "Blueprint 1",
|
|
21
|
+
"icon": "Microservice",
|
|
22
|
+
"schema": {"type": "object", "properties": {}},
|
|
23
|
+
"relations": {},
|
|
24
|
+
"calculationProperties": {},
|
|
25
|
+
"mirrorProperties": {},
|
|
26
|
+
"aggregationProperties": {},
|
|
27
|
+
"teamInheritance": {},
|
|
28
|
+
"ownership": {},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"identifier": "blueprint2",
|
|
32
|
+
"title": "Blueprint 2",
|
|
33
|
+
"icon": "Microservice",
|
|
34
|
+
"schema": {"type": "object", "properties": {}},
|
|
35
|
+
"relations": {},
|
|
36
|
+
"calculationProperties": {},
|
|
37
|
+
"mirrorProperties": {},
|
|
38
|
+
"aggregationProperties": {},
|
|
39
|
+
"teamInheritance": {},
|
|
40
|
+
"ownership": {},
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
actions=[
|
|
44
|
+
{"identifier": "action1", "title": "Action 1"},
|
|
45
|
+
{"identifier": "action2", "title": "Action 2"},
|
|
46
|
+
],
|
|
47
|
+
scorecards=[
|
|
48
|
+
{"blueprint": "blueprint1", "data": [{"identifier": "scorecard1"}]},
|
|
49
|
+
],
|
|
50
|
+
pages=[
|
|
51
|
+
{"identifier": "page1", "title": "Page 1"},
|
|
52
|
+
],
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@pytest.fixture
|
|
57
|
+
def mock_port_client() -> PortClient:
|
|
58
|
+
"""Create a mock PortClient."""
|
|
59
|
+
mock_client = MagicMock(spec=PortClient)
|
|
60
|
+
mock_client.get_blueprint = AsyncMock()
|
|
61
|
+
mock_client.get_current_integration = AsyncMock()
|
|
62
|
+
mock_client.create_blueprint = AsyncMock()
|
|
63
|
+
mock_client.patch_blueprint = AsyncMock()
|
|
64
|
+
mock_client.create_action = AsyncMock()
|
|
65
|
+
mock_client.create_scorecard = AsyncMock()
|
|
66
|
+
mock_client.create_page = AsyncMock()
|
|
67
|
+
return mock_client
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
@pytest.mark.asyncio
|
|
71
|
+
async def test_create_resources_all_mapped_blueprints_exist(
|
|
72
|
+
mock_port_client: PortClient, mock_defaults: Defaults
|
|
73
|
+
) -> None:
|
|
74
|
+
"""
|
|
75
|
+
Test case 1: All mapped blueprints exist in Port and they are different from default ones.
|
|
76
|
+
Should skip creation of all resources.
|
|
77
|
+
|
|
78
|
+
Flow:
|
|
79
|
+
1. Get_blueprint is called for creation_stage default blueprints
|
|
80
|
+
- These should NOT exist (raise exception) so blueprints_results = []
|
|
81
|
+
2. _mapped_blueprints_exist calls get_blueprint for mapped blueprints
|
|
82
|
+
- These SHOULD exist (return Blueprint) so mapped_blueprints_exist = True
|
|
83
|
+
3. Since mapped_blueprints_exist is True, we skip creation
|
|
84
|
+
"""
|
|
85
|
+
mock_port_client.get_current_integration.return_value = { # type: ignore[attr-defined]
|
|
86
|
+
"config": {
|
|
87
|
+
"resources": [
|
|
88
|
+
{
|
|
89
|
+
"port": {
|
|
90
|
+
"entity": {
|
|
91
|
+
"mappings": {
|
|
92
|
+
"blueprint": "blueprint1test",
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"port": {
|
|
99
|
+
"entity": {
|
|
100
|
+
"mappings": {
|
|
101
|
+
"blueprint": "blueprint2test",
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
# Track call order: first 2 calls are for creation_stage, next 2 are for mapped blueprints
|
|
111
|
+
call_count = 0
|
|
112
|
+
|
|
113
|
+
async def get_blueprint_side_effect(
|
|
114
|
+
identifier: str, should_log: bool = True
|
|
115
|
+
) -> Blueprint:
|
|
116
|
+
nonlocal call_count
|
|
117
|
+
call_count += 1
|
|
118
|
+
|
|
119
|
+
# First 2 calls are for creation_stage blueprints
|
|
120
|
+
# These should NOT exist to make blueprints_results = []
|
|
121
|
+
if call_count <= 2:
|
|
122
|
+
raise Exception(f"Blueprint {identifier} not found")
|
|
123
|
+
|
|
124
|
+
# Next 2 calls are for mapped blueprints
|
|
125
|
+
# These SHOULD exist to make mapped_blueprints_exist = True
|
|
126
|
+
return Blueprint.parse_obj(
|
|
127
|
+
{
|
|
128
|
+
"identifier": identifier,
|
|
129
|
+
"title": f"Blueprint {identifier}",
|
|
130
|
+
"team": None,
|
|
131
|
+
"schema": {"type": "object", "properties": {}},
|
|
132
|
+
"relations": {},
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
mock_port_client.get_blueprint.side_effect = get_blueprint_side_effect # type: ignore[attr-defined]
|
|
137
|
+
|
|
138
|
+
# Execute
|
|
139
|
+
await _create_resources(
|
|
140
|
+
mock_port_client, mock_defaults, has_provision_feature_flag=False
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
# Assert: Should not create any blueprints, actions, scorecards, or pages
|
|
144
|
+
mock_port_client.create_blueprint.assert_not_called() # type: ignore[attr-defined]
|
|
145
|
+
mock_port_client.patch_blueprint.assert_not_called() # type: ignore[attr-defined]
|
|
146
|
+
mock_port_client.create_action.assert_not_called() # type: ignore[attr-defined]
|
|
147
|
+
mock_port_client.create_scorecard.assert_not_called() # type: ignore[attr-defined]
|
|
148
|
+
mock_port_client.create_page.assert_not_called() # type: ignore[attr-defined]
|
|
149
|
+
assert mock_port_client.get_blueprint.call_count == 4 # type: ignore[attr-defined]
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
@pytest.mark.asyncio
|
|
153
|
+
async def test_create_resources_no_mapped_blueprints_exist(
|
|
154
|
+
mock_port_client: PortClient, mock_defaults: Defaults
|
|
155
|
+
) -> None:
|
|
156
|
+
"""
|
|
157
|
+
Test case 2: No mapped blueprints exist in Port (they are in config but don't exist).
|
|
158
|
+
Should create all blueprints, actions, scorecards, and pages from defaults.
|
|
159
|
+
|
|
160
|
+
Flow:
|
|
161
|
+
1. Get_blueprint is called for creation_stage default blueprints
|
|
162
|
+
- These should NOT exist (raise exception) so blueprints_results = []
|
|
163
|
+
2. _mapped_blueprints_exist calls get_blueprint for mapped blueprints
|
|
164
|
+
- These should NOT exist (raise exception) so mapped_blueprints_exist = False
|
|
165
|
+
3. Since both are False/empty, we create all resources
|
|
166
|
+
"""
|
|
167
|
+
mock_port_client.get_current_integration.return_value = { # type: ignore[attr-defined]
|
|
168
|
+
"config": {
|
|
169
|
+
"resources": [
|
|
170
|
+
{
|
|
171
|
+
"port": {
|
|
172
|
+
"entity": {
|
|
173
|
+
"mappings": {
|
|
174
|
+
"blueprint": "blueprint1",
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"port": {
|
|
181
|
+
"entity": {
|
|
182
|
+
"mappings": {
|
|
183
|
+
"blueprint": "blueprint2",
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
# Mock get_blueprint to always raise exception (blueprints don't exist)
|
|
193
|
+
# This simulates that no blueprints exist in Port
|
|
194
|
+
async def get_blueprint_side_effect(
|
|
195
|
+
identifier: str, should_log: bool = True
|
|
196
|
+
) -> Blueprint:
|
|
197
|
+
raise Exception(f"Blueprint {identifier} not found")
|
|
198
|
+
|
|
199
|
+
mock_port_client.get_blueprint.side_effect = get_blueprint_side_effect # type: ignore[attr-defined]
|
|
200
|
+
|
|
201
|
+
# Mock create_blueprint to return created blueprint
|
|
202
|
+
async def create_blueprint_side_effect(
|
|
203
|
+
blueprint: dict[str, Any], user_agent_type: UserAgentType | None = None
|
|
204
|
+
) -> dict[str, Any]:
|
|
205
|
+
return {"identifier": blueprint["identifier"], **blueprint}
|
|
206
|
+
|
|
207
|
+
mock_port_client.create_blueprint.side_effect = create_blueprint_side_effect # type: ignore[attr-defined]
|
|
208
|
+
|
|
209
|
+
# Execute
|
|
210
|
+
await _create_resources(
|
|
211
|
+
mock_port_client, mock_defaults, has_provision_feature_flag=False
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
# Assert
|
|
215
|
+
assert mock_port_client.create_blueprint.call_count == 2 # type: ignore[attr-defined]
|
|
216
|
+
assert mock_port_client.patch_blueprint.call_count >= 2 # type: ignore[attr-defined]
|
|
217
|
+
assert mock_port_client.create_action.call_count == 2 # type: ignore[attr-defined]
|
|
218
|
+
assert mock_port_client.create_scorecard.call_count == 1 # type: ignore[attr-defined]
|
|
219
|
+
assert mock_port_client.create_page.call_count == 1 # type: ignore[attr-defined]
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
from typing import cast, Any
|
|
2
|
-
from unittest.mock import AsyncMock, Mock
|
|
3
|
-
from loguru import logger
|
|
4
|
-
import pytest
|
|
5
1
|
from io import StringIO
|
|
2
|
+
from typing import Any, cast
|
|
3
|
+
from unittest.mock import AsyncMock, Mock, patch
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
from loguru import logger
|
|
6
7
|
|
|
7
8
|
from port_ocean.context.ocean import PortOceanContext
|
|
8
9
|
from port_ocean.core.handlers.entity_processor.jq_entity_processor import (
|
|
@@ -10,12 +11,10 @@ from port_ocean.core.handlers.entity_processor.jq_entity_processor import (
|
|
|
10
11
|
)
|
|
11
12
|
from port_ocean.core.ocean_types import CalculationResult
|
|
12
13
|
from port_ocean.exceptions.core import EntityProcessorException
|
|
13
|
-
from unittest.mock import patch
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
@pytest.mark.asyncio
|
|
17
17
|
class TestJQEntityProcessor:
|
|
18
|
-
|
|
19
18
|
@pytest.fixture
|
|
20
19
|
def mocked_processor(self, monkeypatch: Any) -> JQEntityProcessor:
|
|
21
20
|
mock_context = AsyncMock()
|
|
@@ -33,6 +32,30 @@ class TestJQEntityProcessor:
|
|
|
33
32
|
result = await mocked_processor._search(data, pattern)
|
|
34
33
|
assert result == "bar"
|
|
35
34
|
|
|
35
|
+
async def test_search_with_single_quotes(
|
|
36
|
+
self, mocked_processor: JQEntityProcessor
|
|
37
|
+
) -> None:
|
|
38
|
+
data = {"repository": "ocean", "organization": "port"}
|
|
39
|
+
pattern = ".organization + '/' + .repository"
|
|
40
|
+
result = await mocked_processor._search(data, pattern)
|
|
41
|
+
assert result == "port/ocean"
|
|
42
|
+
|
|
43
|
+
async def test_search_with_single_quotes_in_the_end(
|
|
44
|
+
self, mocked_processor: JQEntityProcessor
|
|
45
|
+
) -> None:
|
|
46
|
+
data = {"organization": "port"}
|
|
47
|
+
pattern = ".organization + '/'"
|
|
48
|
+
result = await mocked_processor._search(data, pattern)
|
|
49
|
+
assert result == "port/"
|
|
50
|
+
|
|
51
|
+
async def test_search_with_single_quotes_in_the_start(
|
|
52
|
+
self, mocked_processor: JQEntityProcessor
|
|
53
|
+
) -> None:
|
|
54
|
+
data = {"organization": "port"}
|
|
55
|
+
pattern = "'/' + .organization"
|
|
56
|
+
result = await mocked_processor._search(data, pattern)
|
|
57
|
+
assert result == "/port"
|
|
58
|
+
|
|
36
59
|
async def test_search_as_bool(self, mocked_processor: JQEntityProcessor) -> None:
|
|
37
60
|
data = {"foo": True}
|
|
38
61
|
pattern = ".foo"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.30.0 → port_ocean-0.30.2}/port_ocean/cli/cookiecutter/hooks/post_gen_project.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|