Skip to content

: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.

chore(cdp): move the hog invocation serializers into products/cdp (#115433)

Harley Alexander3ec3af4c9cfd
diff --git a/products/cdp/backend/api/hog_function.py b/products/cdp/backend/api/hog_function.py
index 4aea8085c39a..7d7b91c1382c 100644
--- a/products/cdp/backend/api/hog_function.py
+++ b/products/cdp/backend/api/hog_function.py
@@ -24,7 +24,6 @@ from rest_framework.serializers import BaseSerializer
from posthog.api.app_metrics2 import AppMetricsMixin
from posthog.api.forbid_destroy_model import ForbidDestroyModel
-from posthog.api.hog_invocation_rerun import HogInvocationRerunRequestSerializer, HogInvocationRerunResponseSerializer
from posthog.api.log_entries import LogEntryMixin
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.shared import SearchMatchTypeSerializerMixin, UserBasicSerializer
@@ -79,6 +78,10 @@ from products.cdp.backend.models.hog_functions.hog_function import (
from products.cdp.backend.models.hog_functions.hog_function_revision import HogFunctionRevision
from products.cdp.backend.models.hog_functions.utils import humanize_hog_function_type
from products.cdp.backend.models.plugin import TranspilerError
+from products.cdp.backend.presentation.hog_invocations.rerun import (
+ HogInvocationRerunRequestSerializer,
+ HogInvocationRerunResponseSerializer,
+)
# Maximum size of HOG code as a string in bytes (100KB)
MAX_HOG_CODE_SIZE_BYTES = 100 * 1024
diff --git a/products/cdp/backend/presentation/__init__.py b/products/cdp/backend/presentation/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/cdp/backend/presentation/hog_invocations/__init__.py b/products/cdp/backend/presentation/hog_invocations/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/posthog/api/hog_invocation_cancel.py b/products/cdp/backend/presentation/hog_invocations/cancel.py
similarity index 95%
rename from posthog/api/hog_invocation_cancel.py
rename to products/cdp/backend/presentation/hog_invocations/cancel.py
index 5a64c110411e..a0356ba5f564 100644
--- a/posthog/api/hog_invocation_cancel.py
+++ b/products/cdp/backend/presentation/hog_invocations/cancel.py
@@ -10,7 +10,7 @@ their lifecycle rows, metrics, and logs.
from rest_framework import serializers
-from posthog.api.hog_invocation_rerun import HOG_INVOCATION_RERUN_MAX_COUNT
+from products.cdp.backend.presentation.hog_invocations.rerun import HOG_INVOCATION_RERUN_MAX_COUNT
class HogInvocationCancelRequestSerializer(serializers.Serializer):
diff --git a/posthog/api/hog_invocation_rerun.py b/products/cdp/backend/presentation/hog_invocations/rerun.py
similarity index 100%
rename from posthog/api/hog_invocation_rerun.py
rename to products/cdp/backend/presentation/hog_invocations/rerun.py
diff --git a/posthog/api/hog_invocation_results.py b/products/cdp/backend/presentation/hog_invocations/results.py
similarity index 100%
rename from posthog/api/hog_invocation_results.py
rename to products/cdp/backend/presentation/hog_invocations/results.py
diff --git a/products/workflows/backend/presentation/views/hog_flow.py b/products/workflows/backend/presentation/views/hog_flow.py
index 77db59b3f93f..1ff2e80b0538 100644
--- a/products/workflows/backend/presentation/views/hog_flow.py
+++ b/products/workflows/backend/presentation/views/hog_flow.py
@@ -50,22 +50,6 @@ from posthog.api.app_metrics2 import (
fetch_app_metrics_trends,
)
from posthog.api.documentation import _FallbackSerializer
-from posthog.api.hog_invocation_cancel import (
- HogInvocationCancelRequestSerializer,
- HogInvocationCancelResponseSerializer,
-)
-from posthog.api.hog_invocation_rerun import HogInvocationRerunRequestSerializer, HogInvocationRerunResponseSerializer
-from posthog.api.hog_invocation_results import (
- HogInvocationResultDetailSerializer,
- HogInvocationResultsCountSerializer,
- HogInvocationResultSerializer,
- HogInvocationResultsFiltersSerializer,
- HogInvocationResultsRequestSerializer,
- fetch_hog_invocation_result,
- fetch_hog_invocation_results,
- fetch_hog_invocation_results_count,
- tag_invocation_results_query,
-)
from posthog.api.log_entries import LogEntryMixin
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.shared import UserBasicSerializer
@@ -104,6 +88,25 @@ from products.access_control.backend.presentation.access_control import (
AccessControlViewSetMixin,
UserAccessControlSerializerMixin,
)
+from products.cdp.backend.presentation.hog_invocations.cancel import (
+ HogInvocationCancelRequestSerializer,
+ HogInvocationCancelResponseSerializer,
+)
+from products.cdp.backend.presentation.hog_invocations.rerun import (
+ HogInvocationRerunRequestSerializer,
+ HogInvocationRerunResponseSerializer,
+)
+from products.cdp.backend.presentation.hog_invocations.results import (
+ HogInvocationResultDetailSerializer,
+ HogInvocationResultsCountSerializer,
+ HogInvocationResultSerializer,
+ HogInvocationResultsFiltersSerializer,
+ HogInvocationResultsRequestSerializer,
+ fetch_hog_invocation_result,
+ fetch_hog_invocation_results,
+ fetch_hog_invocation_results_count,
+ tag_invocation_results_query,
+)
from products.messaging.backend.presentation.views.serializers import DesignOperationSerializer
from products.notifications.backend.facade.api import publish_resource_edited
from products.tasks.backend.facade.api import list_workflow_last_runs