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.

refactor(customer-analytics): Route org-members flag through facade and seal product (#64978)

Arthur Moreira de Deusb3c6b1812f9e
diff --git a/products/customer_analytics/backend/presentation/views/organization_members.py b/products/customer_analytics/backend/presentation/views/organization_members.py
index ff529bc03483..b7b8633eaf7a 100644
--- a/products/customer_analytics/backend/presentation/views/organization_members.py
+++ b/products/customer_analytics/backend/presentation/views/organization_members.py
@@ -10,7 +10,7 @@ from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.models import OrganizationMembership
from posthog.permissions import IsStaffUserOrImpersonating, PostHogFeatureFlagPermission
-from products.customer_analytics.backend.constants import CUSTOMER_ANALYTICS_CSP_FLAG
+from products.customer_analytics.backend.facade.constants import CUSTOMER_ANALYTICS_CSP_FLAG
from products.customer_analytics.backend.presentation.views.serializers import AccountOrganizationMemberSerializer
diff --git a/products/customer_analytics/package.json b/products/customer_analytics/package.json
index 8e3d9532ae7d..9a6bcd6c276d 100644
--- a/products/customer_analytics/package.json
+++ b/products/customer_analytics/package.json
@@ -1,7 +1,8 @@
{
"name": "@posthog/products-customer-analytics",
"scripts": {
- "backend:test": "pytest -c ../../pytest.ini --rootdir ../.. backend/ -v --tb=short"
+ "backend:test": "pytest -c ../../pytest.ini --rootdir ../.. backend/ -v --tb=short",
+ "backend:contract-check": "echo 'Contract files unchanged'"
},
"dependencies": {
"kea": "catalog:",
diff --git a/products/customer_analytics/turbo.json b/products/customer_analytics/turbo.json
new file mode 100644
index 000000000000..e16d4eabe6e9
--- /dev/null
+++ b/products/customer_analytics/turbo.json
@@ -0,0 +1,10 @@
+{
+ "extends": ["//"],
+ "tasks": {
+ "backend:contract-check": {
+ "inputs": ["backend/facade/**", "backend/presentation/**", "backend/routes.py"],
+ "outputs": [],
+ "cache": true
+ }
+ }
+}
diff --git a/pyproject.toml b/pyproject.toml
index b5cdbcd4d641..ce7b1bcf59a9 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -556,10 +556,6 @@ ignore_imports = [
"products.logs.backend.presentation.views.api -> products.exports.backend.models.exported_asset",
"products.logs.backend.presentation.views.alerts_api -> products.cdp.backend.api.hog_function",
"products.logs.backend.presentation.views.alerts_api -> products.cdp.backend.models.hog_functions.hog_function",
- # TODO: customer_analytics presentation wave — these views still reach internals directly.
- # Thin each view to parse -> facade -> serialize and delete its entry. backend:contract-check
- # stays off until this list is empty.
- "products.customer_analytics.backend.presentation.views.organization_members -> products.customer_analytics.backend.constants",
]
[tool.ty.rules]