: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
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.pyindex 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 TeamAndOrgViewSetMixinfrom posthog.models import OrganizationMembershipfrom 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_FLAGfrom products.customer_analytics.backend.presentation.views.serializers import AccountOrganizationMemberSerializerdiff --git a/products/customer_analytics/package.json b/products/customer_analytics/package.jsonindex 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.jsonnew file mode 100644index 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.tomlindex 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]