:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(cdp): move the template registry into products/cdp and remove posthog/cdp (#116087)
Harley Alexanderc17c09a30288
diff --git a/.agents/skills/adding-product-alerting/references/extending-platform-alerting.md b/.agents/skills/adding-product-alerting/references/extending-platform-alerting.mdindex f1f4c4b124cb..489065c8e8ee 100644--- a/.agents/skills/adding-product-alerting/references/extending-platform-alerting.md+++ b/.agents/skills/adding-product-alerting/references/extending-platform-alerting.md@@ -44,7 +44,7 @@ A new destination type normally requires all of these:1. Add the enum value in `products/alerts_platform/backend/facade/contracts.py`, and the HogFunction template ID and required fields in `products/alerts/backend/logic/destination_configs.py`.2. Extend validation and `build_alert_destination_config(...)` without changing existing payloads.-3. Add the transport template under `nodejs/src/cdp/templates/_destinations/<destination>/<destination>.template.ts`, register it in `nodejs/src/cdp/templates/index.ts`, and test it with `TemplateTester` next to it. Django tests that need the template in the database sync a stand-in from `posthog/cdp/templates/fixtures.py`; its inputs schema must track which inputs are secret, because that decides what a saved destination keeps in `inputs` versus `encrypted_inputs`. Only update an existing template under `posthog/cdp/templates/` when it already lives there.+3. Add the transport template under `nodejs/src/cdp/templates/_destinations/<destination>/<destination>.template.ts`, register it in `nodejs/src/cdp/templates/index.ts`, and test it with `TemplateTester` next to it. Django tests that need the template in the database sync a stand-in from `products/cdp/backend/templates/fixtures.py`; its inputs schema must track which inputs are secret, because that decides what a saved destination keeps in `inputs` versus `encrypted_inputs`. Only update an existing template under `products/cdp/backend/templates/` when it already lives there.4. Add alert-specific template compatibility in `frontend/src/scenes/hog-functions/sub-templates/sub-templates.ts`.5. Decide which products explicitly allow the destination and update their destination editors or display logic.6. Add the option to `AlertWizard` only where supported by the relevant sub-template.diff --git a/posthog/cdp/templates/__init__.py b/posthog/cdp/templates/__init__.pydeleted file mode 100644index d847ff9da1c1..000000000000--- a/posthog/cdp/templates/__init__.py+++ /dev/null@@ -1,157 +0,0 @@-from products.cdp.backend.templates._internal.template_blank import blank_site_app, blank_site_destination-from products.cdp.backend.templates.activecampaign.template_activecampaign import template as activecampaign-from products.cdp.backend.templates.airtable.template_airtable import template as airtable-from products.cdp.backend.templates.attio.template_attio import template as attio-from products.cdp.backend.templates.avo.template_avo import (- TemplateAvoMigrator,- template as avo,-)-from products.cdp.backend.templates.aws_kinesis.template_aws_kinesis import template as aws_kinesis-from products.cdp.backend.templates.braze.template_braze import template as braze-from products.cdp.backend.templates.brevo.template_brevo import template as brevo-from products.cdp.backend.templates.clearbit.template_clearbit import template as clearbit-from products.cdp.backend.templates.customerio.template_customerio import (- TemplateCustomerioMigrator,- template as customerio,-)-from products.cdp.backend.templates.discord.template_discord import template as discord-from products.cdp.backend.templates.engage.template_engage import (- TemplateEngageMigrator,- template as engage,-)-from products.cdp.backend.templates.gleap.template_gleap import template as gleap-from products.cdp.backend.templates.google_cloud_storage.template_google_cloud_storage import (- TemplateGoogleCloudStorageMigrator,- template as google_cloud_storage,-)-from products.cdp.backend.templates.google_pubsub.template_google_pubsub import (- TemplateGooglePubSubMigrator,- template as google_pubsub,-)-from products.cdp.backend.templates.hubspot.template_hubspot import (- TemplateHubspotMigrator,- template as hubspot,- template_event as hubspot_event,-)-from products.cdp.backend.templates.intercom.template_intercom import (- template as intercom,- template_send_event as intercom_send_event,-)-from products.cdp.backend.templates.june.template_june import template as june-from products.cdp.backend.templates.klaviyo.template_klaviyo import (- template_event as klaviyo_event,- template_user as klaviyo_user,-)-from products.cdp.backend.templates.kudosity.template_kudosity import template as kudosity-from products.cdp.backend.templates.loops.template_loops import (- TemplateLoopsMigrator,- template as loops,- template_send_event as loops_send_event,-)-from products.cdp.backend.templates.mailchimp.template_mailchimp import template as mailchimp-from products.cdp.backend.templates.mailgun.template_mailgun import template_mailgun_send_email as mailgun-from products.cdp.backend.templates.mailjet.template_mailjet import (- template_create_contact as mailjet_create_contact,- template_update_contact_list as mailjet_update_contact_list,-)-from products.cdp.backend.templates.make.template_make import template as make-from products.cdp.backend.templates.microsoft_teams.template_microsoft_teams import template as microsoft_teams-from products.cdp.backend.templates.onesignal.template_onesignal import template as onesignal-from products.cdp.backend.templates.posthog.template_posthog import (- TemplatePostHogMigrator,- template as posthog,-)-from products.cdp.backend.templates.reddit.template_reddit_pixel import template_reddit_pixel as reddit_pixel-from products.cdp.backend.templates.rudderstack.template_rudderstack import (- TemplateRudderstackMigrator,- template as rudderstack,-)-from products.cdp.backend.templates.salesforce.template_salesforce import (- template_create as salesforce_create,- template_lookup as salesforce_lookup,- template_update as salesforce_update,-)-from products.cdp.backend.templates.sendgrid.template_sendgrid import (- TemplateSendGridMigrator,- template as sendgrid,-)-from products.cdp.backend.templates.snapchat_ads.template_pixel import template_snapchat_pixel as snapchat_pixel-from products.cdp.backend.templates.tiktok_ads.template_tiktok_pixel import template_tiktok_pixel as tiktok_pixel-from products.cdp.backend.templates.userlist.template_userlist import template as userlist-from products.cdp.backend.templates.zendesk.template_zendesk import template as zendesk--from ._siteapps.template_debug_posthog import template as debug_posthog-from ._siteapps.template_early_access_features import template as early_access_features-from ._siteapps.template_hogdesk import template as hogdesk-from ._siteapps.template_notification_bar import template as notification_bar-from ._siteapps.template_pineapple_mode import template as pineapple_mode-from .knock.template_knock import template as knock-from .zapier.template_zapier import template as zapier--HOG_FUNCTION_TEMPLATES = [- blank_site_destination,- blank_site_app,- activecampaign,- airtable,- attio,- avo,- aws_kinesis,- braze,- brevo,- clearbit,- customerio,- discord,- engage,- gleap,- google_cloud_storage,- google_pubsub,- hubspot,- hubspot_event,- intercom,- intercom_send_event,- june,- klaviyo_event,- klaviyo_user,- knock,- kudosity,- loops,- loops_send_event,- mailchimp,- mailgun,- mailjet_create_contact,- mailjet_update_contact_list,- make,- microsoft_teams,- onesignal,- posthog,- reddit_pixel,- rudderstack,- salesforce_create,- salesforce_lookup,- salesforce_update,- sendgrid,- snapchat_pixel,- tiktok_pixel,- userlist,- zapier,- zendesk,- early_access_features,- hogdesk,- notification_bar,- pineapple_mode,- debug_posthog,-]---HOG_FUNCTION_MIGRATORS = {- TemplateCustomerioMigrator.plugin_url: TemplateCustomerioMigrator,- TemplateSendGridMigrator.plugin_url: TemplateSendGridMigrator,- TemplateGooglePubSubMigrator.plugin_url: TemplateGooglePubSubMigrator,- TemplateGoogleCloudStorageMigrator.plugin_url: TemplateGoogleCloudStorageMigrator,- TemplateEngageMigrator.plugin_url: TemplateEngageMigrator,- TemplatePostHogMigrator.plugin_url: TemplatePostHogMigrator,- TemplateHubspotMigrator.plugin_url: TemplateHubspotMigrator,- TemplateRudderstackMigrator.plugin_url: TemplateRudderstackMigrator,- TemplateLoopsMigrator.plugin_url: TemplateLoopsMigrator,- TemplateAvoMigrator.plugin_url: TemplateAvoMigrator,-}diff --git a/posthog/cdp/templates/hog_function_template.py b/posthog/cdp/templates/hog_function_template.pydeleted file mode 100644index b331633dd2d7..000000000000--- a/posthog/cdp/templates/hog_function_template.py+++ /dev/null@@ -1,9 +0,0 @@-from products.cdp.backend.templates.hog_function_template import (- HogFunctionMapping as HogFunctionMapping,- HogFunctionMappingTemplate as HogFunctionMappingTemplate,- HogFunctionTemplateDC as HogFunctionTemplateDC,- HogFunctionTemplateMigrator as HogFunctionTemplateMigrator,- HogFunctionTemplateType as HogFunctionTemplateType,- SubTemplateId as SubTemplateId,- sync_template_to_db as sync_template_to_db,-)diff --git a/posthog/management/commands/sync_hog_function_templates.py b/posthog/management/commands/sync_hog_function_templates.pyindex ee4a88782ff6..404d68b14e23 100644--- a/posthog/management/commands/sync_hog_function_templates.py+++ b/posthog/management/commands/sync_hog_function_templates.py@@ -6,11 +6,11 @@ from django.core.management.base import BaseCommandimport structlog-from posthog.cdp.templates import HOG_FUNCTION_TEMPLATESfrom posthog.plugins.plugin_server_api import get_hog_function_templatesfrom products.cdp.backend.models.hog_function_template import HogFunctionTemplatefrom products.cdp.backend.models.hog_functions.hog_function import HogFunctionType+from products.cdp.backend.templates import HOG_FUNCTION_TEMPLATESfrom products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.warehouse_sources.backend.facade.source_management import (SourceRegistry,diff --git a/posthog/management/commands/test/test_migrate_hooks.py b/posthog/management/commands/test/test_migrate_hooks.pyindex baa8fe59349a..f132c7354925 100644--- a/posthog/management/commands/test/test_migrate_hooks.py+++ b/posthog/management/commands/test/test_migrate_hooks.py@@ -1,13 +1,13 @@from posthog.test.base import BaseTest-from posthog.cdp.templates.hog_function_template import sync_template_to_db-from posthog.cdp.templates.zapier.template_zapier import template as template_zapierfrom posthog.management.commands.migrate_hooks import migrate_hooksfrom products.actions.backend.models.action import Actionfrom products.cdp.backend.filters import RUNTIME_CONTRACTfrom products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.cdp.backend.models.hook import Hook+from products.cdp.backend.templates.hog_function_template import sync_template_to_db+from products.cdp.backend.templates.zapier.template_zapier import template as template_zapierfrom common.hogvm.python.operation import HOGQL_BYTECODE_VERSIONdiff --git a/posthog/management/commands/test/test_sync_hog_function_templates.py b/posthog/management/commands/test/test_sync_hog_function_templates.pyindex 8a981fb54053..d021b8006bb7 100644--- a/posthog/management/commands/test/test_sync_hog_function_templates.py+++ b/posthog/management/commands/test/test_sync_hog_function_templates.py@@ -3,7 +3,6 @@ from unittest.mock import MagicMock, patchfrom django.core.management import call_command-from posthog.cdp.templates import HOG_FUNCTION_TEMPLATESfrom posthog.management.commands.sync_hog_function_templates import (TEST_INCLUDE_NODEJS_TEMPLATE_IDS,TEST_INCLUDE_PYTHON_TEMPLATE_IDS,@@ -11,6 +10,7 @@ from posthog.management.commands.sync_hog_function_templates import ()from products.cdp.backend.models.hog_function_template import HogFunctionTemplate+from products.cdp.backend.templates import HOG_FUNCTION_TEMPLATESpytestmark = pytest.mark.django_dbdiff --git a/posthog/models/test/test_hog_function_template.py b/posthog/models/test/test_hog_function_template.pyindex f646a592fad4..64a9b0c7e53b 100644--- a/posthog/models/test/test_hog_function_template.py+++ b/posthog/models/test/test_hog_function_template.py@@ -1,8 +1,7 @@from django.test import TestCase-from posthog.cdp.templates.fixtures import template_slack as slack_template-from products.cdp.backend.models.hog_function_template import HogFunctionTemplate+from products.cdp.backend.templates.fixtures import template_slack as slack_templatefrom products.cdp.backend.templates.hog_function_template import sync_template_to_dbdiff --git a/posthog/models/test/test_remote_config.py b/posthog/models/test/test_remote_config.pyindex bc2bf4476deb..5df56630fa13 100644--- a/posthog/models/test/test_remote_config.py+++ b/posthog/models/test/test_remote_config.py@@ -11,13 +11,13 @@ from django.utils import timezonefrom parameterized import parameterized-from posthog.cdp.templates.helpers import mock_transpilefrom posthog.models.integration import Integrationfrom posthog.models.project import Projectfrom posthog.models.remote_config import REMOTE_CONFIG_CACHE_EXPIRY_SORTED_SET, RemoteConfigfrom products.actions.backend.models.action import Actionfrom products.cdp.backend.models.hog_functions.hog_function import HogFunction+from products.cdp.backend.templates.helpers import mock_transpilefrom products.feature_flags.backend.models.feature_flag import FeatureFlagfrom products.surveys.backend.models import Surveydiff --git a/posthog/test/test_plugin.py b/posthog/test/test_plugin.pyindex 2b960d32161c..93d088f54d8c 100644--- a/posthog/test/test_plugin.py+++ b/posthog/test/test_plugin.py@@ -5,7 +5,6 @@ from unittest.mock import patchfrom django.core import exceptions-from posthog.cdp.templates.helpers import mock_transpilefrom posthog.plugins.test.plugin_archives import (HELLO_WORLD_PLUGIN_FRONTEND_TSX,HELLO_WORLD_PLUGIN_GITHUB_INDEX_JS,@@ -24,6 +23,7 @@ from posthog.plugins.test.plugin_archives import ()from products.cdp.backend.models.plugin import Plugin, PluginSourceFile+from products.cdp.backend.templates.helpers import mock_transpileclass TestPlugin(BaseTest):diff --git a/products/alerts/backend/test/test_destination_configs.py b/products/alerts/backend/test/test_destination_configs.pyindex bf95fd119a00..8a1d5d5a127b 100644--- a/products/alerts/backend/test/test_destination_configs.py+++ b/products/alerts/backend/test/test_destination_configs.py@@ -3,9 +3,6 @@ from typing import Anyimport pytest-from posthog.cdp.templates import HOG_FUNCTION_TEMPLATES-from posthog.cdp.templates.fixtures import template_pagerduty-from products.alerts.backend.logic.destination_configs import (DESTINATION_SPECS,build_alert_destination_config,@@ -23,6 +20,8 @@ from products.alerts_platform.backend.facade.contracts import (EventKindSpec,IncidentAction,)+from products.cdp.backend.templates import HOG_FUNCTION_TEMPLATES+from products.cdp.backend.templates.fixtures import template_pagerdutyDEFAULT_SPEC = EventKindSpec(event_id="$insight_alert_firing",diff --git a/products/alerts/backend/tests/api/test_alert.py b/products/alerts/backend/tests/api/test_alert.pyindex 1a00771b1bc2..2793d95af0e5 100644--- a/products/alerts/backend/tests/api/test_alert.py+++ b/products/alerts/backend/tests/api/test_alert.py@@ -15,7 +15,6 @@ from rest_framework import statusfrom posthog.schema import AlertCalculationInterval, AlertConditionType, AlertState, InsightThresholdTypefrom posthog.api.tagged_item import set_tags_on_object-from posthog.cdp.templates.fixtures import template_slackfrom posthog.constants import AvailableFeaturefrom posthog.models import Userfrom posthog.models.integration import Integration@@ -33,6 +32,7 @@ from products.alerts.backend.presentation.views.alert import AlertSerializerfrom products.alerts_platform.backend.facade.contracts import AlertDeliveryfrom products.alerts_platform.backend.facade.scheduling import CalendarInterval, alert_check_offsetfrom products.cdp.backend.facade.models import HogFunction+from products.cdp.backend.templates.fixtures import template_slackfrom products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.product_analytics.backend.facade.models import Insightdiff --git a/products/cdp/backend/api/hooks.py b/products/cdp/backend/api/hooks.pyindex 2338661c821e..8158152c531d 100644--- a/products/cdp/backend/api/hooks.py+++ b/products/cdp/backend/api/hooks.py@@ -8,12 +8,12 @@ from rest_framework import exceptions, mixins, serializers, status, viewsetsfrom rest_framework.response import Responsefrom posthog.api.routing import TeamAndOrgViewSetMixin-from posthog.cdp.templates.zapier.template_zapier import template as template_zapierfrom posthog.models.user import Userfrom products.cdp.backend.api.hog_function import HogFunctionSerializerfrom products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.cdp.backend.models.hook import HOOK_EVENTS, Hook+from products.cdp.backend.templates.zapier.template_zapier import template as template_zapierdef create_zapier_hog_function(hook: Hook, serializer_context: dict, from_migration: bool = False) -> HogFunction:diff --git a/products/cdp/backend/api/plugin.py b/products/cdp/backend/api/plugin.pyindex 89bde4e43ead..863376a53bb7 100644--- a/products/cdp/backend/api/plugin.py+++ b/products/cdp/backend/api/plugin.py@@ -21,7 +21,6 @@ from rest_framework.response import Responsefrom posthog.api.routing import TeamAndOrgViewSetMixinfrom posthog.api.utils import ClassicBehaviorBooleanFieldSerializer, action-from posthog.cdp.templates import HOG_FUNCTION_MIGRATORSfrom posthog.event_usage import report_user_actionfrom posthog.helpers.impersonation import is_impersonatedfrom posthog.models import User@@ -53,6 +52,7 @@ from products.cdp.backend.models.plugin import (transpile,update_validated_data_from_url,)+from products.cdp.backend.templates import HOG_FUNCTION_MIGRATORS# Keep this in sync with: frontend/scenes/plugins/utils.tsSECRET_FIELD_VALUE = "**************** POSTHOG SECRET FIELD ****************"diff --git a/products/cdp/backend/api/test/test_hog_function.py b/products/cdp/backend/api/test/test_hog_function.pyindex 45f24c892c74..a6b000558792 100644--- a/products/cdp/backend/api/test/test_hog_function.py+++ b/products/cdp/backend/api/test/test_hog_function.py@@ -10,9 +10,6 @@ from django.db import connectionfrom parameterized import parameterizedfrom rest_framework import status-from posthog.cdp.templates.fixtures import template_slack-from posthog.cdp.templates.helpers import mock_transpile-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom posthog.models.integration import Integrationfrom products.actions.backend.models.action import Action@@ -26,6 +23,9 @@ from products.cdp.backend.api.test.test_hog_function_templates import MOCK_NODE_from products.cdp.backend.filters import RUNTIME_CONTRACTfrom products.cdp.backend.models.hog_function_template import HogFunctionTemplatefrom products.cdp.backend.models.hog_functions.hog_function import DEFAULT_STATE, HogFunction, HogFunctionState+from products.cdp.backend.templates.fixtures import template_slack+from products.cdp.backend.templates.helpers import mock_transpile+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.cohorts.backend.models.cohort import Cohortfrom common.hogvm.python.operation import HOGQL_BYTECODE_VERSION, Operationdiff --git a/products/cdp/backend/api/test/test_hog_function_drafts.py b/products/cdp/backend/api/test/test_hog_function_drafts.pyindex a7f1493499fb..c97e1302e5bf 100644--- a/products/cdp/backend/api/test/test_hog_function_drafts.py+++ b/products/cdp/backend/api/test/test_hog_function_drafts.py@@ -6,12 +6,12 @@ from unittest.mock import patchfrom parameterized import parameterizedfrom rest_framework import status-from posthog.cdp.templates.helpers import mock_transpilefrom posthog.models.activity_logging.activity_log import ActivityLogfrom products.cdp.backend.api.hog_function import HogFunctionViewSetfrom products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.cdp.backend.models.hog_functions.hog_function_revision import HogFunctionRevision+from products.cdp.backend.templates.helpers import mock_transpileRELOAD_PATH = "products.cdp.backend.models.hog_functions.hog_function.reload_hog_functions_on_workers"diff --git a/products/cdp/backend/api/test/test_hog_function_templates.py b/products/cdp/backend/api/test/test_hog_function_templates.pyindex 1fa7bcc7cfe2..b35eb9bdde81 100644--- a/products/cdp/backend/api/test/test_hog_function_templates.py+++ b/products/cdp/backend/api/test/test_hog_function_templates.py@@ -7,13 +7,13 @@ from unittest.mock import patchfrom parameterized import parameterizedfrom rest_framework import status-from posthog.cdp.templates.fixtures import template_slack-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom posthog.models.personal_api_key import PersonalAPIKeyfrom posthog.models.utils import generate_random_token_personal, hash_key_valuefrom products.cdp.backend.models.hog_function_template import HogFunctionTemplatefrom products.cdp.backend.models.hog_functions.hog_function import HogFunction+from products.cdp.backend.templates.fixtures import template_slack+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbMOCK_NODE_TEMPLATES = json.loads(open(os.path.join(os.path.dirname(__file__), "__data__/hog_function_templates.json")).read()@@ -198,7 +198,7 @@ class TestHogFunctionTemplates(ClickhouseTestMixin, APIBaseTest, QueryMatchingTedef test_template_updates_are_reflected(self):"""Test that template updates are reflected in API responses"""- from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC+ from products.cdp.backend.templates.hog_function_template import HogFunctionTemplateDC# Initial sha of the templateinitial_response = self.client.get("/api/projects/@current/hog_function_templates/template-slack")diff --git a/products/cdp/backend/api/test/test_hooks.py b/products/cdp/backend/api/test/test_hooks.pyindex e736a52fe23b..809c09b57128 100644--- a/products/cdp/backend/api/test/test_hooks.py+++ b/products/cdp/backend/api/test/test_hooks.py@@ -4,14 +4,13 @@ from typing import Anyimport pytestfrom posthog.test.base import ClickhouseTestMixin-from posthog.cdp.templates.hog_function_template import sync_template_to_db-from posthog.cdp.templates.zapier.template_zapier import template as template_zapier-from products.actions.backend.models.action import Actionfrom products.cdp.backend.api.hooks import create_zapier_hog_function, valid_domainfrom products.cdp.backend.filters import RUNTIME_CONTRACTfrom products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.cdp.backend.models.hook import Hook+from products.cdp.backend.templates.hog_function_template import sync_template_to_db+from products.cdp.backend.templates.zapier.template_zapier import template as template_zapierfrom common.hogvm.python.operation import HOGQL_BYTECODE_VERSIONfrom ee.api.test.base import APILicensedTestdiff --git a/products/cdp/backend/api/test/test_plugin.py b/products/cdp/backend/api/test/test_plugin.pyindex 8491e146b67c..7eb85e21ddf7 100644--- a/products/cdp/backend/api/test/test_plugin.py+++ b/products/cdp/backend/api/test/test_plugin.py@@ -15,8 +15,6 @@ from django.test import override_settingsfrom rest_framework import status-from posthog.cdp.templates.helpers import mock_transpile-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom posthog.constants import FROZEN_POSTHOG_VERSIONfrom posthog.models.organization import Organization, OrganizationMembershipfrom posthog.models.team.team import Team@@ -29,6 +27,8 @@ from products.cdp.backend.api.test.test_hog_function_templates import MOCK_NODE_from products.cdp.backend.filters import RUNTIME_CONTRACTfrom products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.cdp.backend.models.plugin import Plugin, PluginConfig, PluginSourceFile+from products.cdp.backend.templates.helpers import mock_transpile+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbdef mocked_plugin_reload(*args, **kwargs):diff --git a/products/cdp/backend/models/hog_functions/hog_function.py b/products/cdp/backend/models/hog_functions/hog_function.pyindex 7fa912188c07..f7726ce9f05e 100644--- a/products/cdp/backend/models/hog_functions/hog_function.py+++ b/products/cdp/backend/models/hog_functions/hog_function.py@@ -422,11 +422,11 @@ def team_inject_web_apps_changd(sender, instance, created=None, **kwargs):@receiver(models.signals.post_save, sender=Team)def enabled_default_hog_functions_for_new_team(sender, instance: Team, created: bool, **kwargs):- from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom posthog.plugins.plugin_server_api import get_hog_function_templatesfrom products.cdp.backend.api.hog_function import HogFunctionSerializerfrom products.cdp.backend.models.hog_function_template import HogFunctionTemplate+ from products.cdp.backend.templates.hog_function_template import sync_template_to_dbif settings.DISABLE_MMDB or not created:returndiff --git a/posthog/cdp/templates/README.md b/products/cdp/backend/templates/README.mdsimilarity index 100%rename from posthog/cdp/templates/README.mdrename to products/cdp/backend/templates/README.mddiff --git a/products/cdp/backend/templates/__init__.py b/products/cdp/backend/templates/__init__.pyindex e69de29bb2d1..d847ff9da1c1 100644--- a/products/cdp/backend/templates/__init__.py+++ b/products/cdp/backend/templates/__init__.py@@ -0,0 +1,157 @@+from products.cdp.backend.templates._internal.template_blank import blank_site_app, blank_site_destination+from products.cdp.backend.templates.activecampaign.template_activecampaign import template as activecampaign+from products.cdp.backend.templates.airtable.template_airtable import template as airtable+from products.cdp.backend.templates.attio.template_attio import template as attio+from products.cdp.backend.templates.avo.template_avo import (+ TemplateAvoMigrator,+ template as avo,+)+from products.cdp.backend.templates.aws_kinesis.template_aws_kinesis import template as aws_kinesis+from products.cdp.backend.templates.braze.template_braze import template as braze+from products.cdp.backend.templates.brevo.template_brevo import template as brevo+from products.cdp.backend.templates.clearbit.template_clearbit import template as clearbit+from products.cdp.backend.templates.customerio.template_customerio import (+ TemplateCustomerioMigrator,+ template as customerio,+)+from products.cdp.backend.templates.discord.template_discord import template as discord+from products.cdp.backend.templates.engage.template_engage import (+ TemplateEngageMigrator,+ template as engage,+)+from products.cdp.backend.templates.gleap.template_gleap import template as gleap+from products.cdp.backend.templates.google_cloud_storage.template_google_cloud_storage import (+ TemplateGoogleCloudStorageMigrator,+ template as google_cloud_storage,+)+from products.cdp.backend.templates.google_pubsub.template_google_pubsub import (+ TemplateGooglePubSubMigrator,+ template as google_pubsub,+)+from products.cdp.backend.templates.hubspot.template_hubspot import (+ TemplateHubspotMigrator,+ template as hubspot,+ template_event as hubspot_event,+)+from products.cdp.backend.templates.intercom.template_intercom import (+ template as intercom,+ template_send_event as intercom_send_event,+)+from products.cdp.backend.templates.june.template_june import template as june+from products.cdp.backend.templates.klaviyo.template_klaviyo import (+ template_event as klaviyo_event,+ template_user as klaviyo_user,+)+from products.cdp.backend.templates.kudosity.template_kudosity import template as kudosity+from products.cdp.backend.templates.loops.template_loops import (+ TemplateLoopsMigrator,+ template as loops,+ template_send_event as loops_send_event,+)+from products.cdp.backend.templates.mailchimp.template_mailchimp import template as mailchimp+from products.cdp.backend.templates.mailgun.template_mailgun import template_mailgun_send_email as mailgun+from products.cdp.backend.templates.mailjet.template_mailjet import (+ template_create_contact as mailjet_create_contact,+ template_update_contact_list as mailjet_update_contact_list,+)+from products.cdp.backend.templates.make.template_make import template as make+from products.cdp.backend.templates.microsoft_teams.template_microsoft_teams import template as microsoft_teams+from products.cdp.backend.templates.onesignal.template_onesignal import template as onesignal+from products.cdp.backend.templates.posthog.template_posthog import (+ TemplatePostHogMigrator,+ template as posthog,+)+from products.cdp.backend.templates.reddit.template_reddit_pixel import template_reddit_pixel as reddit_pixel+from products.cdp.backend.templates.rudderstack.template_rudderstack import (+ TemplateRudderstackMigrator,+ template as rudderstack,+)+from products.cdp.backend.templates.salesforce.template_salesforce import (+ template_create as salesforce_create,+ template_lookup as salesforce_lookup,+ template_update as salesforce_update,+)+from products.cdp.backend.templates.sendgrid.template_sendgrid import (+ TemplateSendGridMigrator,+ template as sendgrid,+)+from products.cdp.backend.templates.snapchat_ads.template_pixel import template_snapchat_pixel as snapchat_pixel+from products.cdp.backend.templates.tiktok_ads.template_tiktok_pixel import template_tiktok_pixel as tiktok_pixel+from products.cdp.backend.templates.userlist.template_userlist import template as userlist+from products.cdp.backend.templates.zendesk.template_zendesk import template as zendesk++from ._siteapps.template_debug_posthog import template as debug_posthog+from ._siteapps.template_early_access_features import template as early_access_features+from ._siteapps.template_hogdesk import template as hogdesk+from ._siteapps.template_notification_bar import template as notification_bar+from ._siteapps.template_pineapple_mode import template as pineapple_mode+from .knock.template_knock import template as knock+from .zapier.template_zapier import template as zapier++HOG_FUNCTION_TEMPLATES = [+ blank_site_destination,+ blank_site_app,+ activecampaign,+ airtable,+ attio,+ avo,+ aws_kinesis,+ braze,+ brevo,+ clearbit,+ customerio,+ discord,+ engage,+ gleap,+ google_cloud_storage,+ google_pubsub,+ hubspot,+ hubspot_event,+ intercom,+ intercom_send_event,+ june,+ klaviyo_event,+ klaviyo_user,+ knock,+ kudosity,+ loops,+ loops_send_event,+ mailchimp,+ mailgun,+ mailjet_create_contact,+ mailjet_update_contact_list,+ make,+ microsoft_teams,+ onesignal,+ posthog,+ reddit_pixel,+ rudderstack,+ salesforce_create,+ salesforce_lookup,+ salesforce_update,+ sendgrid,+ snapchat_pixel,+ tiktok_pixel,+ userlist,+ zapier,+ zendesk,+ early_access_features,+ hogdesk,+ notification_bar,+ pineapple_mode,+ debug_posthog,+]+++HOG_FUNCTION_MIGRATORS = {+ TemplateCustomerioMigrator.plugin_url: TemplateCustomerioMigrator,+ TemplateSendGridMigrator.plugin_url: TemplateSendGridMigrator,+ TemplateGooglePubSubMigrator.plugin_url: TemplateGooglePubSubMigrator,+ TemplateGoogleCloudStorageMigrator.plugin_url: TemplateGoogleCloudStorageMigrator,+ TemplateEngageMigrator.plugin_url: TemplateEngageMigrator,+ TemplatePostHogMigrator.plugin_url: TemplatePostHogMigrator,+ TemplateHubspotMigrator.plugin_url: TemplateHubspotMigrator,+ TemplateRudderstackMigrator.plugin_url: TemplateRudderstackMigrator,+ TemplateLoopsMigrator.plugin_url: TemplateLoopsMigrator,+ TemplateAvoMigrator.plugin_url: TemplateAvoMigrator,+}diff --git a/posthog/cdp/templates/_siteapps/template_debug_posthog.py b/products/cdp/backend/templates/_siteapps/template_debug_posthog.pysimilarity index 94%rename from posthog/cdp/templates/_siteapps/template_debug_posthog.pyrename to products/cdp/backend/templates/_siteapps/template_debug_posthog.pyindex 952300a54abc..b962ddd94035 100644--- a/posthog/cdp/templates/_siteapps/template_debug_posthog.py+++ b/products/cdp/backend/templates/_siteapps/template_debug_posthog.py@@ -1,4 +1,4 @@-from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC+from products.cdp.backend.templates.hog_function_template import HogFunctionTemplateDCtemplate: HogFunctionTemplateDC = HogFunctionTemplateDC(status="beta",diff --git a/posthog/cdp/templates/_siteapps/template_early_access_features.py b/products/cdp/backend/templates/_siteapps/template_early_access_features.pysimilarity index 99%rename from posthog/cdp/templates/_siteapps/template_early_access_features.pyrename to products/cdp/backend/templates/_siteapps/template_early_access_features.pyindex 300d80740365..07c8edd9e9a3 100644--- a/posthog/cdp/templates/_siteapps/template_early_access_features.py+++ b/products/cdp/backend/templates/_siteapps/template_early_access_features.py@@ -1,4 +1,4 @@-from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC+from products.cdp.backend.templates.hog_function_template import HogFunctionTemplateDCtemplate: HogFunctionTemplateDC = HogFunctionTemplateDC(status="beta",diff --git a/posthog/cdp/templates/_siteapps/template_hogdesk.py b/products/cdp/backend/templates/_siteapps/template_hogdesk.pysimilarity index 99%rename from posthog/cdp/templates/_siteapps/template_hogdesk.pyrename to products/cdp/backend/templates/_siteapps/template_hogdesk.pyindex 699b763702c8..f6565562ba1e 100644--- a/posthog/cdp/templates/_siteapps/template_hogdesk.py+++ b/products/cdp/backend/templates/_siteapps/template_hogdesk.py@@ -1,4 +1,4 @@-from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC+from products.cdp.backend.templates.hog_function_template import HogFunctionTemplateDCtemplate: HogFunctionTemplateDC = HogFunctionTemplateDC(status="beta",diff --git a/posthog/cdp/templates/_siteapps/template_notification_bar.py b/products/cdp/backend/templates/_siteapps/template_notification_bar.pysimilarity index 98%rename from posthog/cdp/templates/_siteapps/template_notification_bar.pyrename to products/cdp/backend/templates/_siteapps/template_notification_bar.pyindex 6061dc988f28..c53c09df9c85 100644--- a/posthog/cdp/templates/_siteapps/template_notification_bar.py+++ b/products/cdp/backend/templates/_siteapps/template_notification_bar.py@@ -1,4 +1,4 @@-from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC+from products.cdp.backend.templates.hog_function_template import HogFunctionTemplateDCtemplate: HogFunctionTemplateDC = HogFunctionTemplateDC(status="beta",diff --git a/posthog/cdp/templates/_siteapps/template_pineapple_mode.py b/products/cdp/backend/templates/_siteapps/template_pineapple_mode.pysimilarity index 98%rename from posthog/cdp/templates/_siteapps/template_pineapple_mode.pyrename to products/cdp/backend/templates/_siteapps/template_pineapple_mode.pyindex 097fdc96f46d..d10ff694f673 100644--- a/posthog/cdp/templates/_siteapps/template_pineapple_mode.py+++ b/products/cdp/backend/templates/_siteapps/template_pineapple_mode.py@@ -1,4 +1,4 @@-from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC+from products.cdp.backend.templates.hog_function_template import HogFunctionTemplateDCtemplate: HogFunctionTemplateDC = HogFunctionTemplateDC(status="beta",diff --git a/products/cdp/backend/templates/activecampaign/test_template_activecampaign.py b/products/cdp/backend/templates/activecampaign/test_template_activecampaign.pyindex 7cb0d0c3ea08..c49484023fc6 100644--- a/products/cdp/backend/templates/activecampaign/test_template_activecampaign.py+++ b/products/cdp/backend/templates/activecampaign/test_template_activecampaign.py@@ -1,6 +1,5 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.templates.activecampaign.template_activecampaign import template as template_activecampaign+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestdef create_inputs(**kwargs):diff --git a/products/cdp/backend/templates/airtable/test_template_airtable.py b/products/cdp/backend/templates/airtable/test_template_airtable.pyindex c276709b2867..a04594a2765c 100644--- a/products/cdp/backend/templates/airtable/test_template_airtable.py+++ b/products/cdp/backend/templates/airtable/test_template_airtable.py@@ -1,6 +1,5 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.templates.airtable.template_airtable import template as template_airtable+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestclass TestTemplateAirtable(BaseHogFunctionTemplateTest):diff --git a/products/cdp/backend/templates/attio/test_template_attio.py b/products/cdp/backend/templates/attio/test_template_attio.pyindex d9c82e6d667e..fed5e0dd129f 100644--- a/products/cdp/backend/templates/attio/test_template_attio.py+++ b/products/cdp/backend/templates/attio/test_template_attio.py@@ -1,6 +1,5 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.templates.attio.template_attio import template as template_attio+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestdef create_inputs(**kwargs):diff --git a/products/cdp/backend/templates/avo/test_template_avo.py b/products/cdp/backend/templates/avo/test_template_avo.pyindex 85d01728e04e..06d4bfcba9e2 100644--- a/products/cdp/backend/templates/avo/test_template_avo.py+++ b/products/cdp/backend/templates/avo/test_template_avo.py@@ -1,12 +1,11 @@from posthog.test.base import BaseTest-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.models.plugin import PluginConfigfrom products.cdp.backend.templates.avo.template_avo import (TemplateAvoMigrator,template as template_avo,)+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestclass TestTemplateAvo(BaseHogFunctionTemplateTest):diff --git a/products/cdp/backend/templates/aws_kinesis/test_template_aws_kinesis.py b/products/cdp/backend/templates/aws_kinesis/test_template_aws_kinesis.pyindex 6e068a2576d4..f0dece77e342 100644--- a/products/cdp/backend/templates/aws_kinesis/test_template_aws_kinesis.py+++ b/products/cdp/backend/templates/aws_kinesis/test_template_aws_kinesis.py@@ -1,8 +1,7 @@import time_machine-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.templates.aws_kinesis.template_aws_kinesis import template as template_aws_kinesis+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestclass TestTemplateAwsKinesis(BaseHogFunctionTemplateTest):diff --git a/products/cdp/backend/templates/braze/test_template_braze.py b/products/cdp/backend/templates/braze/test_template_braze.pyindex 82ce01e80175..9424e44e3c9b 100644--- a/products/cdp/backend/templates/braze/test_template_braze.py+++ b/products/cdp/backend/templates/braze/test_template_braze.py@@ -1,8 +1,7 @@import time_machine-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.templates.braze.template_braze import template as template_braze+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestclass TestTemplateBraze(BaseHogFunctionTemplateTest):diff --git a/products/cdp/backend/templates/brevo/test_template_brevo.py b/products/cdp/backend/templates/brevo/test_template_brevo.pyindex 0f42cdf7efa6..6b7eaa690fdc 100644--- a/products/cdp/backend/templates/brevo/test_template_brevo.py+++ b/products/cdp/backend/templates/brevo/test_template_brevo.py@@ -1,6 +1,5 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.templates.brevo.template_brevo import template as template_brevo+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestdef create_inputs(**kwargs):diff --git a/products/cdp/backend/templates/clearbit/test_template_clearbit.py b/products/cdp/backend/templates/clearbit/test_template_clearbit.pyindex 0a58d8eaeccc..cfc53509c175 100644--- a/products/cdp/backend/templates/clearbit/test_template_clearbit.py+++ b/products/cdp/backend/templates/clearbit/test_template_clearbit.py@@ -1,6 +1,5 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.templates.clearbit.template_clearbit import template as template_clearbit+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestEXAMPLE_RESPONSE = {"person": {diff --git a/products/cdp/backend/templates/customerio/test_template_customerio.py b/products/cdp/backend/templates/customerio/test_template_customerio.pyindex 47fec696c60a..eb4181815982 100644--- a/products/cdp/backend/templates/customerio/test_template_customerio.py+++ b/products/cdp/backend/templates/customerio/test_template_customerio.py@@ -1,13 +1,12 @@import pytestfrom posthog.test.base import BaseTest-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.models.plugin import PluginConfigfrom products.cdp.backend.templates.customerio.template_customerio import (TemplateCustomerioMigrator,template as template_customerio,)+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom common.hogvm.python.utils import UncaughtHogVMExceptiondiff --git a/products/cdp/backend/templates/discord/test_template_discord.py b/products/cdp/backend/templates/discord/test_template_discord.pyindex 5a2eabae6bda..ce325c4dd5a7 100644--- a/products/cdp/backend/templates/discord/test_template_discord.py+++ b/products/cdp/backend/templates/discord/test_template_discord.py@@ -2,9 +2,8 @@ import pytestfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.templates.discord.template_discord import template as template_discord+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestclass TestTemplateDiscord(BaseHogFunctionTemplateTest):diff --git a/products/cdp/backend/templates/engage/test_template_engage.py b/products/cdp/backend/templates/engage/test_template_engage.pyindex d7d04c9f4dd9..5d805ed2fcb1 100644--- a/products/cdp/backend/templates/engage/test_template_engage.py+++ b/products/cdp/backend/templates/engage/test_template_engage.py@@ -1,6 +1,5 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.templates.engage.template_engage import template as template_engage+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestclass TestTemplateEngageso(BaseHogFunctionTemplateTest):diff --git a/posthog/cdp/templates/fixtures.py b/products/cdp/backend/templates/fixtures.pysimilarity index 98%rename from posthog/cdp/templates/fixtures.pyrename to products/cdp/backend/templates/fixtures.pyindex 59b9b1f42716..cb94b48d4307 100644--- a/posthog/cdp/templates/fixtures.py+++ b/products/cdp/backend/templates/fixtures.py@@ -1,4 +1,4 @@-from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC+from products.cdp.backend.templates.hog_function_template import HogFunctionTemplateDC# The Slack destination itself lives in nodejs (nodejs/src/cdp/templates/_destinations/slack). Tests# that need a real destination template in the database sync this stand-in instead of reaching out todiff --git a/products/cdp/backend/templates/gleap/test_template_gleap.py b/products/cdp/backend/templates/gleap/test_template_gleap.pyindex e1c923d43d60..a47203e5b474 100644--- a/products/cdp/backend/templates/gleap/test_template_gleap.py+++ b/products/cdp/backend/templates/gleap/test_template_gleap.py@@ -1,6 +1,5 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.templates.gleap.template_gleap import template as template_gleap+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestdef create_inputs(**kwargs):diff --git a/posthog/cdp/templates/helpers.py b/products/cdp/backend/templates/helpers.pysimilarity index 98%rename from posthog/cdp/templates/helpers.pyrename to products/cdp/backend/templates/helpers.pyindex 863896c65bcd..3a91cf5da480 100644--- a/posthog/cdp/templates/helpers.py+++ b/products/cdp/backend/templates/helpers.py@@ -6,11 +6,11 @@ from typing import Any, Optional, castfrom posthog.test.base import APIBaseTest, BaseTestfrom unittest.mock import MagicMock, patch-from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC, sync_template_to_dbfrom posthog.models.utils import uuid7from products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.cdp.backend.site_functions import get_transpiled_function+from products.cdp.backend.templates.hog_function_template import HogFunctionTemplateDC, sync_template_to_dbfrom products.cdp.backend.validation import compile_hogfrom common.hogvm.python.execute import execute_bytecodediff --git a/products/cdp/backend/templates/hubspot/test_template_hubspot.py b/products/cdp/backend/templates/hubspot/test_template_hubspot.pyindex 5bd919c2d2f8..0f76e778cd70 100644--- a/products/cdp/backend/templates/hubspot/test_template_hubspot.py+++ b/products/cdp/backend/templates/hubspot/test_template_hubspot.py@@ -1,9 +1,8 @@import pytestfrom posthog.test.base import BaseTest-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.models.plugin import PluginConfig+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.hubspot.template_hubspot import (TemplateHubspotMigrator,template as template_hubspot,diff --git a/products/cdp/backend/templates/intercom/test_template_intercom.py b/products/cdp/backend/templates/intercom/test_template_intercom.pyindex 3ebef53f0fc8..b937c92ed31e 100644--- a/products/cdp/backend/templates/intercom/test_template_intercom.py+++ b/products/cdp/backend/templates/intercom/test_template_intercom.py@@ -1,7 +1,6 @@import pytest-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.intercom.template_intercom import (template as template_intercom,template_send_event as template_intercom_event,diff --git a/products/cdp/backend/templates/june/test_june_template.py b/products/cdp/backend/templates/june/test_june_template.pyindex 240e0666478a..9b477bdea07c 100644--- a/products/cdp/backend/templates/june/test_june_template.py+++ b/products/cdp/backend/templates/june/test_june_template.py@@ -1,5 +1,4 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.june.template_june import template as template_junediff --git a/products/cdp/backend/templates/klaviyo/test_template_klaviyo.py b/products/cdp/backend/templates/klaviyo/test_template_klaviyo.pyindex df49c262b818..b8dd8708f951 100644--- a/products/cdp/backend/templates/klaviyo/test_template_klaviyo.py+++ b/products/cdp/backend/templates/klaviyo/test_template_klaviyo.py@@ -1,7 +1,6 @@import pytest-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.klaviyo.template_klaviyo import (template_event as klaviyo_event,template_user as klaviyo_user,diff --git a/posthog/cdp/templates/knock/template_knock.py b/products/cdp/backend/templates/knock/template_knock.pysimilarity index 97%rename from posthog/cdp/templates/knock/template_knock.pyrename to products/cdp/backend/templates/knock/template_knock.pyindex 028eb630a2f9..402ad22190bf 100644--- a/posthog/cdp/templates/knock/template_knock.py+++ b/products/cdp/backend/templates/knock/template_knock.py@@ -1,4 +1,4 @@-from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC+from products.cdp.backend.templates.hog_function_template import HogFunctionTemplateDCtemplate: HogFunctionTemplateDC = HogFunctionTemplateDC(status="stable",diff --git a/posthog/cdp/templates/knock/test_knock_template.py b/products/cdp/backend/templates/knock/test_knock_template.pysimilarity index 97%rename from posthog/cdp/templates/knock/test_knock_template.pyrename to products/cdp/backend/templates/knock/test_knock_template.pyindex 30b77e61f115..9910e212e413 100644--- a/posthog/cdp/templates/knock/test_knock_template.py+++ b/products/cdp/backend/templates/knock/test_knock_template.py@@ -2,9 +2,8 @@ from typing import Anyfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from posthog.cdp.templates.knock.template_knock import template as template_knock-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTest+from products.cdp.backend.templates.knock.template_knock import template as template_knockfrom products.cdp.backend.validation import generate_template_bytecodefrom common.hogvm.python.execute import execute_bytecodediff --git a/products/cdp/backend/templates/kudosity/test_template_kudosity.py b/products/cdp/backend/templates/kudosity/test_template_kudosity.pyindex cc4d18d1e702..0ecdd504a905 100644--- a/products/cdp/backend/templates/kudosity/test_template_kudosity.py+++ b/products/cdp/backend/templates/kudosity/test_template_kudosity.py@@ -1,5 +1,4 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.kudosity.template_kudosity import template as template_kudositydiff --git a/products/cdp/backend/templates/loops/test_template_loops.py b/products/cdp/backend/templates/loops/test_template_loops.pyindex 55ac7b237f3f..cfcde95a102c 100644--- a/products/cdp/backend/templates/loops/test_template_loops.py+++ b/products/cdp/backend/templates/loops/test_template_loops.py@@ -1,5 +1,4 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.loops.template_loops import (template as template_loops,template_send_event as template_loops_send_event,diff --git a/products/cdp/backend/templates/mailchimp/test_template_mailchimp.py b/products/cdp/backend/templates/mailchimp/test_template_mailchimp.pyindex a9f43be833cb..07f626a12029 100644--- a/products/cdp/backend/templates/mailchimp/test_template_mailchimp.py+++ b/products/cdp/backend/templates/mailchimp/test_template_mailchimp.py@@ -1,5 +1,4 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.mailchimp.template_mailchimp import template as template_mailchimpdiff --git a/products/cdp/backend/templates/mailgun/test_template_mailgun.py b/products/cdp/backend/templates/mailgun/test_template_mailgun.pyindex 3e9e4197f58d..1f3d39e07bfc 100644--- a/products/cdp/backend/templates/mailgun/test_template_mailgun.py+++ b/products/cdp/backend/templates/mailgun/test_template_mailgun.py@@ -1,7 +1,6 @@from typing import Optional-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.mailgun.template_mailgun import template_mailgun_send_emaildiff --git a/products/cdp/backend/templates/mailjet/test_template_mailjet.py b/products/cdp/backend/templates/mailjet/test_template_mailjet.pyindex 853d629d0511..db0547e0bcfe 100644--- a/products/cdp/backend/templates/mailjet/test_template_mailjet.py+++ b/products/cdp/backend/templates/mailjet/test_template_mailjet.py@@ -1,5 +1,4 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.mailjet.template_mailjet import (template_create_contact,template_update_contact_list,diff --git a/products/cdp/backend/templates/make/test_template_make.py b/products/cdp/backend/templates/make/test_template_make.pyindex 201fa99721d0..8e34a7770a68 100644--- a/products/cdp/backend/templates/make/test_template_make.py+++ b/products/cdp/backend/templates/make/test_template_make.py@@ -1,7 +1,6 @@import pytest-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.make.template_make import template as template_makediff --git a/products/cdp/backend/templates/microsoft_teams/test_template_microsoft_teams.py b/products/cdp/backend/templates/microsoft_teams/test_template_microsoft_teams.pyindex 7cd21ed55e11..65cb1ed48c96 100644--- a/products/cdp/backend/templates/microsoft_teams/test_template_microsoft_teams.py+++ b/products/cdp/backend/templates/microsoft_teams/test_template_microsoft_teams.py@@ -1,7 +1,6 @@import pytest-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.microsoft_teams.template_microsoft_teams import template as template_microsoft_teamsdiff --git a/products/cdp/backend/templates/onesignal/test_template_onesignal.py b/products/cdp/backend/templates/onesignal/test_template_onesignal.pyindex 23ab922567c8..cc7b1a5acb4d 100644--- a/products/cdp/backend/templates/onesignal/test_template_onesignal.py+++ b/products/cdp/backend/templates/onesignal/test_template_onesignal.py@@ -1,8 +1,7 @@import pytestimport time_machine-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.onesignal.template_onesignal import template as template_onesignalfrom common.hogvm.python.utils import UncaughtHogVMExceptiondiff --git a/products/cdp/backend/templates/posthog/test_template_posthog.py b/products/cdp/backend/templates/posthog/test_template_posthog.pyindex 58c446e9e138..436e10a03f9b 100644--- a/products/cdp/backend/templates/posthog/test_template_posthog.py+++ b/products/cdp/backend/templates/posthog/test_template_posthog.py@@ -1,8 +1,7 @@from posthog.test.base import BaseTest-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.models.plugin import PluginConfig+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.posthog.template_posthog import (TemplatePostHogMigrator,template as template_posthog,diff --git a/products/cdp/backend/templates/reddit/test_template_reddit_pixel.py b/products/cdp/backend/templates/reddit/test_template_reddit_pixel.pyindex 1a101e3a00d2..53ae104408b4 100644--- a/products/cdp/backend/templates/reddit/test_template_reddit_pixel.py+++ b/products/cdp/backend/templates/reddit/test_template_reddit_pixel.py@@ -1,5 +1,4 @@-from posthog.cdp.templates.helpers import BaseSiteDestinationFunctionTest-+from products.cdp.backend.templates.helpers import BaseSiteDestinationFunctionTestfrom products.cdp.backend.templates.reddit.template_reddit_pixel import template_reddit_pixelTEST_EMAIL = "[email protected]"diff --git a/products/cdp/backend/templates/rudderstack/test_template_rudderstack.py b/products/cdp/backend/templates/rudderstack/test_template_rudderstack.pyindex 82fcc0afef3b..1b1acd0256f3 100644--- a/products/cdp/backend/templates/rudderstack/test_template_rudderstack.py+++ b/products/cdp/backend/templates/rudderstack/test_template_rudderstack.py@@ -1,8 +1,7 @@from posthog.test.base import BaseTest-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.models.plugin import PluginConfig+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.rudderstack.template_rudderstack import (TemplateRudderstackMigrator,template as template_rudderstack,diff --git a/products/cdp/backend/templates/salesforce/test_template_salesforce.py b/products/cdp/backend/templates/salesforce/test_template_salesforce.pyindex 54209fd6e2ed..0ca771e96160 100644--- a/products/cdp/backend/templates/salesforce/test_template_salesforce.py+++ b/products/cdp/backend/templates/salesforce/test_template_salesforce.py@@ -3,9 +3,8 @@ from posthog.test.base import BaseTestfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.models.plugin import PluginConfig+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.salesforce.template_salesforce import (TemplatSalesforceMigrator,template_create as template_salesforce_create,diff --git a/products/cdp/backend/templates/sendgrid/test_template_sendgrid.py b/products/cdp/backend/templates/sendgrid/test_template_sendgrid.pyindex 4a2746de0772..36d4a6592d1c 100644--- a/products/cdp/backend/templates/sendgrid/test_template_sendgrid.py+++ b/products/cdp/backend/templates/sendgrid/test_template_sendgrid.py@@ -1,8 +1,7 @@from posthog.test.base import BaseTest-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from products.cdp.backend.models.plugin import PluginConfig+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.sendgrid.template_sendgrid import (TemplateSendGridMigrator,template as template_sendgrid,diff --git a/posthog/cdp/templates/test_cdp_templates.py b/products/cdp/backend/templates/test_cdp_templates.pysimilarity index 94%rename from posthog/cdp/templates/test_cdp_templates.pyrename to products/cdp/backend/templates/test_cdp_templates.pyindex f538809c9303..0ffed57e8877 100644--- a/posthog/cdp/templates/test_cdp_templates.py+++ b/products/cdp/backend/templates/test_cdp_templates.py@@ -2,11 +2,10 @@ import dataclassesfrom posthog.test.base import BaseTest-from posthog.cdp.templates import HOG_FUNCTION_TEMPLATES-from posthog.cdp.templates.hog_function_template import sync_template_to_db-from products.cdp.backend.models.hog_function_template import HogFunctionTemplatefrom products.cdp.backend.models.hog_functions.hog_function import TYPES_WITH_TRANSPILED_FILTERS+from products.cdp.backend.templates import HOG_FUNCTION_TEMPLATES+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.cdp.backend.validation import InputsSchemaItemSerializer, compile_hogdiff --git a/products/cdp/backend/templates/userlist/test_template_userlist.py b/products/cdp/backend/templates/userlist/test_template_userlist.pyindex ab1bd3cce026..adc8286d99e7 100644--- a/products/cdp/backend/templates/userlist/test_template_userlist.py+++ b/products/cdp/backend/templates/userlist/test_template_userlist.py@@ -1,5 +1,4 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.userlist.template_userlist import template as template_userlistdiff --git a/posthog/cdp/templates/zapier/template_zapier.py b/products/cdp/backend/templates/zapier/template_zapier.pysimilarity index 96%rename from posthog/cdp/templates/zapier/template_zapier.pyrename to products/cdp/backend/templates/zapier/template_zapier.pyindex d8ed16e72cf3..91e5e99ff790 100644--- a/posthog/cdp/templates/zapier/template_zapier.py+++ b/products/cdp/backend/templates/zapier/template_zapier.py@@ -1,4 +1,4 @@-from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC+from products.cdp.backend.templates.hog_function_template import HogFunctionTemplateDCtemplate: HogFunctionTemplateDC = HogFunctionTemplateDC(status="stable",diff --git a/posthog/cdp/templates/zapier/test_template_zapier.py b/products/cdp/backend/templates/zapier/test_template_zapier.pysimilarity index 91%rename from posthog/cdp/templates/zapier/test_template_zapier.pyrename to products/cdp/backend/templates/zapier/test_template_zapier.pyindex 3c986238e11a..f64299dc0074 100644--- a/posthog/cdp/templates/zapier/test_template_zapier.py+++ b/products/cdp/backend/templates/zapier/test_template_zapier.py@@ -1,5 +1,5 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-from posthog.cdp.templates.zapier.template_zapier import template as template_zapier+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTest+from products.cdp.backend.templates.zapier.template_zapier import template as template_zapierclass TestTemplateZapier(BaseHogFunctionTemplateTest):diff --git a/products/cdp/backend/templates/zendesk/test_template_zendesk.py b/products/cdp/backend/templates/zendesk/test_template_zendesk.pyindex 63752b4941f9..8d9e58ae6789 100644--- a/products/cdp/backend/templates/zendesk/test_template_zendesk.py+++ b/products/cdp/backend/templates/zendesk/test_template_zendesk.py@@ -1,5 +1,4 @@-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.cdp.backend.templates.zendesk.template_zendesk import template as template_zendeskdiff --git a/products/cdp/backend/test/test_plugin_migrations.py b/products/cdp/backend/test/test_plugin_migrations.pyindex 0933eabc3c0b..71984805cc71 100644--- a/products/cdp/backend/test/test_plugin_migrations.py+++ b/products/cdp/backend/test/test_plugin_migrations.py@@ -7,14 +7,13 @@ from django.test import SimpleTestCasefrom parameterized import parameterized-from posthog.cdp.templates._siteapps.template_notification_bar import template as notification_bar-from posthog.cdp.templates._siteapps.template_pineapple_mode import template as pineapple_mode-from posthog.cdp.templates.helpers import mock_transpile-from posthog.cdp.templates.hog_function_template import sync_template_to_db-from products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.cdp.backend.models.plugin import Plugin, PluginConfig, PluginSourceFilefrom products.cdp.backend.plugin_migrations import coerce_input_value, migrate_legacy_plugins+from products.cdp.backend.templates._siteapps.template_notification_bar import template as notification_bar+from products.cdp.backend.templates._siteapps.template_pineapple_mode import template as pineapple_mode+from products.cdp.backend.templates.helpers import mock_transpile+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbclass TestCoerceInputValue(SimpleTestCase):diff --git a/products/cdp/backend/test/test_site_functions.py b/products/cdp/backend/test/test_site_functions.pyindex c6170eced714..7f8ac786a5ba 100644--- a/products/cdp/backend/test/test_site_functions.py+++ b/products/cdp/backend/test/test_site_functions.py@@ -10,7 +10,6 @@ from django.test import TestCasefrom parameterized import parameterized-from posthog.cdp.templates.helpers import mock_transpilefrom posthog.models.organization import Organizationfrom posthog.models.project import Projectfrom posthog.models.user import User@@ -20,6 +19,7 @@ from products.actions.backend.models.action import Actionfrom products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.cdp.backend.models.plugin import TranspilerErrorfrom products.cdp.backend.site_functions import get_transpiled_function+from products.cdp.backend.templates.helpers import mock_transpilefrom products.cohorts.backend.models.cohort import Cohortdiff --git a/products/customer_analytics/backend/test/test_event_stream.py b/products/customer_analytics/backend/test/test_event_stream.pyindex eb4365e83856..363e4f6fc6ad 100644--- a/products/customer_analytics/backend/test/test_event_stream.py+++ b/products/customer_analytics/backend/test/test_event_stream.py@@ -6,12 +6,12 @@ from django.core.cache import cachefrom rest_framework import statusfrom slack_sdk.errors import SlackApiError-from posthog.cdp.templates.fixtures import template_slackfrom posthog.constants import AvailableFeaturefrom posthog.models import Integration, Organization, OrganizationMembership, Teamfrom products.access_control.backend.models.access_control import AccessControlfrom products.cdp.backend.models.hog_functions.hog_function import HogFunction+from products.cdp.backend.templates.fixtures import template_slackfrom products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.customer_analytics.backend.logic.event_stream_destination import _NO_MEMBERS_SENTINELfrom products.customer_analytics.backend.models import EventStream, EventStreamMember, TeamCustomerAnalyticsConfigdiff --git a/products/early_access_features/backend/test/test_early_access_feature.py b/products/early_access_features/backend/test/test_early_access_feature.pyindex 600b1e40c460..3e8c47d8e5d8 100644--- a/products/early_access_features/backend/test/test_early_access_feature.py+++ b/products/early_access_features/backend/test/test_early_access_feature.py@@ -37,7 +37,7 @@ class TestEarlyAccessFeatureSiteAppTemplate(unittest.TestCase):def test_site_app_template_escapes_user_controlled_fields(self):import re- from posthog.cdp.templates._siteapps.template_early_access_features import template+ from products.cdp.backend.templates._siteapps.template_early_access_features import templatecode = template.code@@ -58,7 +58,7 @@ class TestEarlyAccessFeatureSiteAppTemplate(unittest.TestCase):unlike raw encodeURI which would allow javascript: URLs through."""import re- from posthog.cdp.templates._siteapps.template_early_access_features import template+ from products.cdp.backend.templates._siteapps.template_early_access_features import templatecode = template.codediff --git a/products/logs/backend/test/test_alerts_api.py b/products/logs/backend/test/test_alerts_api.pyindex a2cf6c4386fa..74279cae2ce6 100644--- a/products/logs/backend/test/test_alerts_api.py+++ b/products/logs/backend/test/test_alerts_api.py@@ -11,13 +11,13 @@ from parameterized import parameterizedfrom rest_framework import statusfrom rest_framework.test import APIClient-from posthog.cdp.templates.fixtures import template_pagerduty, template_slackfrom posthog.clickhouse.client import sync_executefrom posthog.models.team.team import Teamfrom posthog.models.user import Userfrom products.cdp.backend.models.hog_function_template import HogFunctionTemplatefrom products.cdp.backend.models.hog_functions.hog_function import HogFunction+from products.cdp.backend.templates.fixtures import template_pagerduty, template_slackfrom products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.cdp.backend.templates.microsoft_teams.template_microsoft_teams import template as template_microsoft_teamsfrom products.logs.backend.alert_check_query import AlertCheckQuery, BucketedCountdiff --git a/products/replay_vision/backend/tests/test_vision_alerts_api.py b/products/replay_vision/backend/tests/test_vision_alerts_api.pyindex 927594c7005d..2f561a1e3696 100644--- a/products/replay_vision/backend/tests/test_vision_alerts_api.py+++ b/products/replay_vision/backend/tests/test_vision_alerts_api.py@@ -10,7 +10,6 @@ from django.db import IntegrityError, transactionfrom parameterized import parameterized-from posthog.cdp.templates.fixtures import template_slackfrom posthog.constants import AvailableFeaturefrom posthog.models import Organization, PersonalAPIKey, Team, Userfrom posthog.models.activity_logging.activity_log import ActivityLog@@ -18,6 +17,7 @@ from posthog.models.utils import generate_random_token_personal, hash_key_valuefrom products.access_control.backend.models.access_control import AccessControlfrom products.cdp.backend.models.hog_functions.hog_function import HogFunction, HogFunctionTemplate+from products.cdp.backend.templates.fixtures import template_slackfrom products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.replay_vision.backend.models.replay_scanner import ReplayScanner, ScannerModel, ScannerTypefrom products.replay_vision.backend.models.vision_alert import (diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/attentive/tests/test_attentive_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/attentive/tests/test_attentive_webhook_template.pyindex 315a9d9bd2ef..f6eee61cabb8 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/attentive/tests/test_attentive_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/attentive/tests/test_attentive_webhook_template.py@@ -2,8 +2,7 @@ import hmacimport jsonimport hashlib-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.attentive.webhook_template import templateSOURCE_ID = "source_test_123"diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/calendly/tests/test_calendly_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/calendly/tests/test_calendly_webhook_template.pyindex fd99f906b382..814bcf0ef31a 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/calendly/tests/test_calendly_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/calendly/tests/test_calendly_webhook_template.py@@ -5,8 +5,7 @@ import hashlibfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.calendly.webhook_template import templateSOURCE_ID = "source_test_123"diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/test/test_default_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/test/test_default_webhook_template.pyindex 2ba9c6896470..37da3d44c2d8 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/test/test_default_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/test/test_default_webhook_template.py@@ -1,7 +1,6 @@from parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.default_webhook_template import templatediff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/customer_io/tests/test_customer_io_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/customer_io/tests/test_customer_io_webhook_template.pyindex 782d8e89a925..81e3e640858e 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/customer_io/tests/test_customer_io_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/customer_io/tests/test_customer_io_webhook_template.py@@ -5,8 +5,7 @@ import hashlibfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.customer_io.webhook_template import templateSOURCE_ID = "source_test_123"diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/fourthwall/tests/test_fourthwall_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/fourthwall/tests/test_fourthwall_webhook_template.pyindex fb36f951df2f..1749268cd1e9 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/fourthwall/tests/test_fourthwall_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/fourthwall/tests/test_fourthwall_webhook_template.py@@ -5,8 +5,7 @@ import hashlibfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.fourthwall.webhook_template import templateSOURCE_ID = "source_test_123"diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/gitea/tests/test_gitea_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/gitea/tests/test_gitea_webhook_template.pyindex f80e2314e30b..523f5e40a782 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/gitea/tests/test_gitea_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/gitea/tests/test_gitea_webhook_template.py@@ -3,8 +3,7 @@ import jsonimport hashlibfrom typing import Any-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.gitea.webhook_template import templatediff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/github/tests/test_github_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/github/tests/test_github_webhook_template.pyindex db7ff3a0658a..4359461f52e2 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/github/tests/test_github_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/github/tests/test_github_webhook_template.py@@ -3,8 +3,7 @@ from typing import Anyfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.github.webhook_template import templatediff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/mailgun/tests/test_mailgun_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/mailgun/tests/test_mailgun_webhook_template.pyindex d204b8e7055f..63edd56081da 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/mailgun/tests/test_mailgun_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/mailgun/tests/test_mailgun_webhook_template.py@@ -5,8 +5,7 @@ import hashlibfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.mailgun.settings import (WEBHOOK_EVENT_NAMES,WEBHOOK_RESOURCE_KEY,diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/mailjet/tests/test_mailjet_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/mailjet/tests/test_mailjet_webhook_template.pyindex af1aac815e3c..c1839294b330 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/mailjet/tests/test_mailjet_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/mailjet/tests/test_mailjet_webhook_template.py@@ -4,8 +4,7 @@ import hashlibfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.mailjet.settings import MAILJET_WEBHOOK_EVENTSfrom products.warehouse_sources.backend.temporal.data_imports.sources.mailjet.webhook_template import templatediff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/pipedrive/tests/test_pipedrive_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/pipedrive/tests/test_pipedrive_webhook_template.pyindex df1e59aecb07..c3926eb9d618 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/pipedrive/tests/test_pipedrive_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/pipedrive/tests/test_pipedrive_webhook_template.py@@ -4,8 +4,7 @@ from typing import Anyfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.pipedrive.webhook_template import templateSOURCE_ID = "source_test_123"diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/postmark/tests/test_postmark_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/postmark/tests/test_postmark_webhook_template.pyindex 8f4d3449709d..f67a6583fac0 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/postmark/tests/test_postmark_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/postmark/tests/test_postmark_webhook_template.py@@ -2,8 +2,7 @@ import jsonfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.postmark.settings import WEBHOOK_SECRET_HEADERfrom products.warehouse_sources.backend.temporal.data_imports.sources.postmark.webhook_template import templatediff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/slack/tests/test_slack_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/slack/tests/test_slack_webhook_template.pyindex be94748ea16e..3fb5b0c89d69 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/slack/tests/test_slack_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/slack/tests/test_slack_webhook_template.py@@ -5,8 +5,7 @@ import hashlibfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.slack.webhook_template import templatediff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/sparkpost/tests/test_sparkpost_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/sparkpost/tests/test_sparkpost_webhook_template.pyindex 36f460d43858..493fe7a8d8bc 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/sparkpost/tests/test_sparkpost_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/sparkpost/tests/test_sparkpost_webhook_template.py@@ -3,8 +3,7 @@ import base64from parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.sparkpost.settings import WEBHOOK_BATCH_KEYfrom products.warehouse_sources.backend.temporal.data_imports.sources.sparkpost.webhook_template import templatediff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/stripe/tests/test_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/stripe/tests/test_webhook_template.pyindex 434190d9c60d..4a54951fd67c 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/stripe/tests/test_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/stripe/tests/test_webhook_template.py@@ -5,8 +5,7 @@ import hashlibfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.stripe.webhook_template import templatediff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/webflow/tests/test_webflow_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/webflow/tests/test_webflow_webhook_template.pyindex bbfade17eda7..f02e6aeb7d46 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/webflow/tests/test_webflow_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/webflow/tests/test_webflow_webhook_template.py@@ -5,8 +5,7 @@ import hashlibfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.webflow.webhook_template import templateSOURCE_ID = "source_test_123"diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/woocommerce/tests/test_woocommerce_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/woocommerce/tests/test_woocommerce_webhook_template.pyindex 796c51d58f6f..2527e4689bd0 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/woocommerce/tests/test_woocommerce_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/woocommerce/tests/test_woocommerce_webhook_template.py@@ -5,8 +5,7 @@ import hashlibfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.woocommerce.webhook_template import templateSOURCE_ID = "source_test_123"diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/workos/tests/test_workos_webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/workos/tests/test_workos_webhook_template.pyindex 80d3bc6e1471..f33eaf652c6f 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/workos/tests/test_workos_webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/workos/tests/test_workos_webhook_template.py@@ -5,8 +5,7 @@ import hashlibfrom parameterized import parameterized-from posthog.cdp.templates.helpers import BaseHogFunctionTemplateTest-+from products.cdp.backend.templates.helpers import BaseHogFunctionTemplateTestfrom products.warehouse_sources.backend.temporal.data_imports.sources.workos.settings import WEBHOOK_EVENT_TO_SCHEMAfrom products.warehouse_sources.backend.temporal.data_imports.sources.workos.webhook_template import templatediff --git a/products/workflows/backend/test/test_refresh_hog_flows.py b/products/workflows/backend/test/test_refresh_hog_flows.pyindex 2d0d09ad370f..5ff9ac1cfcf2 100644--- a/products/workflows/backend/test/test_refresh_hog_flows.py+++ b/products/workflows/backend/test/test_refresh_hog_flows.py@@ -9,11 +9,11 @@ from django.core.management import call_commandfrom parameterized import parameterized-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom posthog.models import Teamfrom products.cdp.backend.api.test.test_hog_function_templates import MOCK_NODE_TEMPLATESfrom products.cdp.backend.filters import RUNTIME_CONTRACT+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.workflows.backend.models.hog_flow.hog_flow import HogFlowdiff --git a/products/workflows/backend/tests/api/test_hog_flow.py b/products/workflows/backend/tests/api/test_hog_flow.pyindex d7efb9f4e5cb..e835eee87fbc 100644--- a/products/workflows/backend/tests/api/test_hog_flow.py+++ b/products/workflows/backend/tests/api/test_hog_flow.py@@ -17,8 +17,6 @@ from django.utils import timezonefrom parameterized import parameterizedfrom rest_framework import status-from posthog.cdp.templates.fixtures import template_slack-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom posthog.constants import AvailableFeaturefrom posthog.event_usage import EventSourcefrom posthog.models import Organization, OrganizationMembership, Team, User@@ -34,6 +32,8 @@ from products.cdp.backend.api.test.test_hog_function_templates import MOCK_NODE_from products.cdp.backend.filters import RUNTIME_CONTRACTfrom products.cdp.backend.flag_gated_templates import gated_template_enabledfrom products.cdp.backend.models.hog_functions.hog_function import HogFunction+from products.cdp.backend.templates.fixtures import template_slack+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.cohorts.backend.models.cohort import Cohortfrom products.skills.backend.models.skills import LLMSkillfrom products.tasks.backend.facade.contracts import WorkflowLastRunDTOdiff --git a/products/workflows/backend/tests/api/test_hog_flow_template.py b/products/workflows/backend/tests/api/test_hog_flow_template.pyindex 960996118e9d..05bda0bad20f 100644--- a/products/workflows/backend/tests/api/test_hog_flow_template.py+++ b/products/workflows/backend/tests/api/test_hog_flow_template.py@@ -5,11 +5,11 @@ from posthog.test.base import APIBaseTestfrom parameterized import parameterizedfrom rest_framework import status-from posthog.cdp.templates.fixtures import template_slackfrom posthog.models import Organization, Team, Userfrom products.cdp.backend.api.test.test_hog_function_templates import MOCK_NODE_TEMPLATESfrom products.cdp.backend.models.hog_function_template import HogFunctionTemplate+from products.cdp.backend.templates.fixtures import template_slackfrom products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.workflows.backend.models.hog_flow.hog_flow_template import HogFlowTemplatefrom products.workflows.backend.templates import clear_template_cache, load_global_templates