: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): import template dataclasses from products/cdp in other callers (#115478)
Harley Alexandere1f55528cfdc
diff --git a/posthog/management/commands/sync_hog_function_templates.py b/posthog/management/commands/sync_hog_function_templates.pyindex cc0123112435..ee4a88782ff6 100644--- a/posthog/management/commands/sync_hog_function_templates.py+++ b/posthog/management/commands/sync_hog_function_templates.py@@ -7,11 +7,11 @@ from django.core.management.base import BaseCommandimport structlogfrom posthog.cdp.templates import HOG_FUNCTION_TEMPLATES-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.models.hog_function_template import HogFunctionTemplatefrom products.cdp.backend.models.hog_functions.hog_function import HogFunctionType+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.warehouse_sources.backend.facade.source_management import (SourceRegistry,WebhookSource,diff --git a/posthog/models/test/test_hog_function_template.py b/posthog/models/test/test_hog_function_template.pyindex 9c5a39495a24..f646a592fad4 100644--- a/posthog/models/test/test_hog_function_template.py+++ b/posthog/models/test/test_hog_function_template.py@@ -1,9 +1,9 @@from django.test import TestCasefrom posthog.cdp.templates.fixtures import template_slack as slack_template-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom products.cdp.backend.models.hog_function_template import HogFunctionTemplate+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbclass TestHogFunctionTemplate(TestCase):@@ -72,7 +72,7 @@ class TestHogFunctionTemplate(TestCase):def test_update_existing_template(self):"""Test updating an existing template with new content"""- from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC+ from products.cdp.backend.templates.hog_function_template import HogFunctionTemplateDC# First create a simple templateoriginal_dto = HogFunctionTemplateDC(diff --git a/products/alerts/backend/tests/api/test_alert.py b/products/alerts/backend/tests/api/test_alert.pyindex 53c1e10c2aa0..1a00771b1bc2 100644--- a/products/alerts/backend/tests/api/test_alert.py+++ b/products/alerts/backend/tests/api/test_alert.py@@ -16,7 +16,6 @@ from posthog.schema import AlertCalculationInterval, AlertConditionType, AlertStfrom posthog.api.tagged_item import set_tags_on_objectfrom posthog.cdp.templates.fixtures import template_slack-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom posthog.constants import AvailableFeaturefrom posthog.models import Userfrom posthog.models.integration import Integration@@ -34,6 +33,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.hog_function_template import sync_template_to_dbfrom products.product_analytics.backend.facade.models import InsightTEST_DESTINATION_DELIVERY = AlertDelivery(diff --git a/products/customer_analytics/backend/test/test_event_stream.py b/products/customer_analytics/backend/test/test_event_stream.pyindex 539624a4aef1..eb4365e83856 100644--- a/products/customer_analytics/backend/test/test_event_stream.py+++ b/products/customer_analytics/backend/test/test_event_stream.py@@ -7,12 +7,12 @@ from rest_framework import statusfrom slack_sdk.errors import SlackApiErrorfrom posthog.cdp.templates.fixtures import template_slack-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom 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.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, TeamCustomerAnalyticsConfigfrom products.customer_analytics.backend.test.factories import create_accountdiff --git a/products/logs/backend/test/test_alerts_api.py b/products/logs/backend/test/test_alerts_api.pyindex f9e0ceae4240..a2cf6c4386fa 100644--- a/products/logs/backend/test/test_alerts_api.py+++ b/products/logs/backend/test/test_alerts_api.py@@ -12,13 +12,13 @@ from rest_framework import statusfrom rest_framework.test import APIClientfrom posthog.cdp.templates.fixtures import template_pagerduty, template_slack-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom 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.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, BucketedCountfrom products.logs.backend.models import LogsAlertConfiguration, LogsAlertEventdiff --git a/products/replay_vision/backend/tests/test_vision_alerts_api.py b/products/replay_vision/backend/tests/test_vision_alerts_api.pyindex 0e5e60035101..927594c7005d 100644--- a/products/replay_vision/backend/tests/test_vision_alerts_api.py+++ b/products/replay_vision/backend/tests/test_vision_alerts_api.py@@ -11,7 +11,6 @@ from django.db import IntegrityError, transactionfrom parameterized import parameterizedfrom posthog.cdp.templates.fixtures import template_slack-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom posthog.constants import AvailableFeaturefrom posthog.models import Organization, PersonalAPIKey, Team, Userfrom posthog.models.activity_logging.activity_log import ActivityLog@@ -19,6 +18,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.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 (VisionAlertConfiguration,diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/zapsign/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/zapsign/source.pyindex 45239bbb2e7f..652e29f688bf 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/zapsign/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/zapsign/source.py@@ -40,7 +40,7 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.zapsign.zafrom products.warehouse_sources.backend.types import ExternalDataSourceTypeif TYPE_CHECKING:- from posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC+ from products.cdp.backend.templates.hog_function_template import HogFunctionTemplateDC@SourceRegistry.registerdiff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/zapsign/webhook_template.py b/products/warehouse_sources/backend/temporal/data_imports/sources/zapsign/webhook_template.pyindex 7d09fc3c6064..196ef1935db4 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/zapsign/webhook_template.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/zapsign/webhook_template.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="alpha",diff --git a/products/workflows/backend/tests/api/test_hog_flow_action_email.py b/products/workflows/backend/tests/api/test_hog_flow_action_email.pyindex 6e22be068786..8c0722cf4ca9 100644--- a/products/workflows/backend/tests/api/test_hog_flow_action_email.py+++ b/products/workflows/backend/tests/api/test_hog_flow_action_email.py@@ -6,9 +6,8 @@ from unittest.mock import patchfrom parameterized import parameterized-from posthog.cdp.templates.hog_function_template import sync_template_to_db-from products.cdp.backend.api.test.test_hog_function_templates import MOCK_NODE_TEMPLATES+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.messaging.backend.facade.api import UnlayerRenderErrorfrom products.messaging.backend.facade.testing import create_message_template_for_testfrom products.workflows.backend.models.hog_flow.hog_flow import HogFlowdiff --git a/products/workflows/backend/tests/api/test_hog_flow_draft_publish.py b/products/workflows/backend/tests/api/test_hog_flow_draft_publish.pyindex 81b1a478cc4f..aa06915c57ab 100644--- a/products/workflows/backend/tests/api/test_hog_flow_draft_publish.py+++ b/products/workflows/backend/tests/api/test_hog_flow_draft_publish.py@@ -6,10 +6,10 @@ from unittest.mock import MagicMock, patchfrom parameterized import parameterized-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom posthog.models.activity_logging.activity_log import ActivityLogfrom products.cdp.backend.api.test.test_hog_function_templates import MOCK_NODE_TEMPLATES+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.workflows.backend.models.hog_flow.hog_flow import HogFlowfrom products.workflows.backend.models.hog_flow_revision import HogFlowRevisionfrom products.workflows.backend.presentation.views.hog_flow import WRITABLE_DRAFT_CONTENT_FIELDSdiff --git a/products/workflows/backend/tests/api/test_hog_flow_revisions.py b/products/workflows/backend/tests/api/test_hog_flow_revisions.pyindex 6f76a7ebf134..7a03720d2759 100644--- a/products/workflows/backend/tests/api/test_hog_flow_revisions.py+++ b/products/workflows/backend/tests/api/test_hog_flow_revisions.py@@ -5,10 +5,10 @@ from unittest.mock import MagicMock, patchfrom parameterized import parameterized-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom posthog.models.activity_logging.activity_log import ActivityLogfrom products.cdp.backend.api.test.test_hog_function_templates import MOCK_NODE_TEMPLATES+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.workflows.backend.models.hog_flow.hog_flow import HogFlowfrom products.workflows.backend.services.hog_flow_content import DRAFT_CONTENT_FIELDS, snapshot_flow_contentdiff --git a/products/workflows/backend/tests/api/test_hog_flow_template.py b/products/workflows/backend/tests/api/test_hog_flow_template.pyindex d483b095a43b..c1638d667984 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 rest_framework import statusfrom posthog.cdp.templates.fixtures import template_slack-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom 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.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_templatesdiff --git a/products/workflows/backend/tests/api/test_hog_flow_timing_reschedule.py b/products/workflows/backend/tests/api/test_hog_flow_timing_reschedule.pyindex ec4c860e9dce..849ad54b5f56 100644--- a/products/workflows/backend/tests/api/test_hog_flow_timing_reschedule.py+++ b/products/workflows/backend/tests/api/test_hog_flow_timing_reschedule.py@@ -3,9 +3,8 @@ from unittest.mock import patchfrom parameterized import parameterized-from posthog.cdp.templates.hog_function_template import sync_template_to_db-from products.cdp.backend.api.test.test_hog_function_templates import MOCK_NODE_TEMPLATES+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.workflows.backend.models.hog_flow.hog_flow import HogFlowwebhook_template = MOCK_NODE_TEMPLATES[0]diff --git a/products/workflows/backend/tests/api/test_workflow_proposals.py b/products/workflows/backend/tests/api/test_workflow_proposals.pyindex 4bed19586ca8..b821b6f5c6d4 100644--- a/products/workflows/backend/tests/api/test_workflow_proposals.py+++ b/products/workflows/backend/tests/api/test_workflow_proposals.py@@ -8,7 +8,6 @@ from unittest.mock import MagicMock, patchfrom parameterized import parameterized-from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom posthog.models import Team, Userfrom posthog.models.activity_logging.activity_log import ActivityLogfrom posthog.models.organization import OrganizationMembership@@ -17,6 +16,7 @@ from posthog.models.utils import generate_random_token_personal, hash_key_valuefrom products.access_control.backend.facade.user_access_control import UserAccessControlfrom products.cdp.backend.api.test.test_hog_function_templates import MOCK_NODE_TEMPLATES+from products.cdp.backend.templates.hog_function_template import sync_template_to_dbfrom products.signals.backend.models import SignalScoutConfigfrom products.skills.backend.models.skills import LLMSkillfrom products.workflows.backend.models.hog_flow.hog_flow import HogFlow