: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(experiments): register experiments in the unfiled file registry (#125418)
Andersd3dfc10e7141
diff --git a/posthog/models/file_system/unfiled_file_saver.py b/posthog/models/file_system/unfiled_file_saver.pyindex 46df02bfde2a..82fb925c7465 100644--- a/posthog/models/file_system/unfiled_file_saver.py+++ b/posthog/models/file_system/unfiled_file_saver.py@@ -16,7 +16,6 @@ from products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.cohorts.backend.models.cohort import Cohortfrom products.dashboards.backend.models.dashboard import Dashboardfrom products.early_access_features.backend.models import EarlyAccessFeature-from products.experiments.backend.models.experiment import Experimentfrom products.feature_flags.backend.models.feature_flag import FeatureFlagfrom products.notebooks.backend.models import Notebookfrom products.product_analytics.backend.facade.models import Insight@@ -25,7 +24,6 @@ from products.surveys.backend.models import SurveyMIXIN_MODELS: dict[str, type[FileSystemSyncMixin]] = {"action": Action,"feature_flag": FeatureFlag,- "experiment": Experiment,"insight": Insight,"dashboard": Dashboard,"notebook": Notebook,diff --git a/products/experiments/backend/apps.py b/products/experiments/backend/apps.pyindex 1f2f9b86d049..8ac6bc163d1e 100644--- a/products/experiments/backend/apps.py+++ b/products/experiments/backend/apps.py@@ -8,4 +8,9 @@ class ExperimentsConfig(AppConfig):def ready(self) -> None:# Registers activity signal receivers after the app registry is ready.+ from posthog.models.file_system.unfiled_file_saver import register_mixin_model # noqa: PLC0415+import products.experiments.backend.activity_logging # noqa: F401, PLC0415+ from products.experiments.backend.models.experiment import Experiment # noqa: PLC0415++ register_mixin_model("experiment", Experiment)