: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(experiments): remove leftovers from legacy results (#118404)
Andersc5d90b4dd42a
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex 2cf84ba38faa..441f1f537960 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -224,7 +224,6 @@ export const FEATURE_FLAGS = {BATCH_EXPORTS_POSTHOG_HTTP: 'posthog-http-batch-exports', // owner: #team-batch-exportsBEHAVIORAL_PROPERTY_FILTER: 'behavioral-property-filter', // owner: #team-product-analytics, inline "performed event" filter on insightsBILLING_SKIP_FORECASTING: 'billing-skip-forecasting', // owner: @zach- EXPERIMENT_INTERVAL_TIMESERIES: 'experiments-interval-timeseries', // owner: @jurajmajerik #team-experimentsGATEWAY_PERSONAL_API_KEY: 'gateway-personal-api-key', // owner: #team-platform-featuresHEATMAPS_CLICKMAP_DISCRIMINATORS: 'heatmaps-clickmap-discriminators', // owner: #team-web-analyticsHEATMAPS_CLICKMAP_PAGINATION: 'heatmaps-clickmap-pagination', // owner: #team-web-analyticsdiff --git a/frontend/src/lib/utils/eventUsageLogic.ts b/frontend/src/lib/utils/eventUsageLogic.tsindex bef75bd90c0c..aa10fc53ee7c 100644--- a/frontend/src/lib/utils/eventUsageLogic.ts+++ b/frontend/src/lib/utils/eventUsageLogic.ts@@ -1116,39 +1116,6 @@ export interface eventUsageLogicActions {isPrimary: booleanmetricUuid: string}- reportExperimentMetricFinished: (- experimentId: ExperimentIdType,- metric: ExperimentMetric,- teamId?: number | null,- queryId?: string | null,- context?: {- duration_ms: number- execution_mode: 'async' | 'sync'- is_cached: boolean- is_primary: boolean- is_retry: boolean- metric_index: number- metric_kind: string- refresh_id: string- }- ) => {- context:- | {- duration_ms: number- execution_mode: 'async' | 'sync'- is_cached: boolean- is_primary: boolean- is_retry: boolean- metric_index: number- metric_kind: string- refresh_id: string- }- | undefined- experimentId: ExperimentIdType- metric: ExperimentMetricUnion- queryId: string | null | undefined- teamId: number | null | undefined- }reportExperimentRecordingOpened: (experimentId: ExperimentIdType,context: ExperimentRecordingsFilterContext@@ -1969,28 +1936,6 @@ export const eventUsageLogic = kea<eventUsageLogicType>([experiment,dashboardId,}),- reportExperimentMetricFinished: (- experimentId: ExperimentIdType,- metric: ExperimentMetric,- teamId?: number | null,- queryId?: string | null,- context?: {- duration_ms: number- is_cached: boolean- metric_index: number- is_primary: boolean- is_retry: boolean- refresh_id: string- metric_kind: string- execution_mode: 'sync' | 'async'- }- ) => ({- experimentId,- metric,- teamId,- queryId,- context,- }),reportExperimentFeatureFlagModalOpened: () => ({}),reportExperimentTimeseriesViewed: (experimentId: ExperimentIdType, metric: ExperimentMetric) => ({experimentId,@@ -2639,16 +2584,6 @@ export const eventUsageLogic = kea<eventUsageLogicType>([dashboard_id: dashboardId,})},- reportExperimentMetricFinished: ({ experimentId, metric, teamId, queryId, context }) => {- posthog.capture('experiment metric finished', {- experiment_id: experimentId,- team_id: teamId,- query_id: queryId,- ...getEventPropertiesForMetric(metric),- metric,- ...context,- })- },reportExperimentFeatureFlagModalOpened: () => {posthog.capture('experiment feature flag modal opened')},diff --git a/frontend/src/mocks/fixtures/api/experiments/_experiment_metric_results_error.json b/frontend/src/mocks/fixtures/api/experiments/_experiment_metric_results_error.jsondeleted file mode 100644index db3b58ac781b..000000000000--- a/frontend/src/mocks/fixtures/api/experiments/_experiment_metric_results_error.json+++ /dev/null@@ -1,20 +0,0 @@-{- "query_status": {- "complete": true,- "dashboard_id": null,- "end_time": "2025-02-06T13:33:39.890Z",- "error": true,- "error_message": "[ErrorDetail(string='{\"no-exposures\": false, \"no-control-variant\": true, \"no-test-variant\": true}', code='no-results')]",- "expiration_time": "2025-02-06T13:53:36.382Z",- "id": "a705ec2b160c493fb7f52087907ffcf3",- "insight_id": null,- "labels": null,- "pickup_time": "2025-02-06T13:33:36.382Z",- "query_async": true,- "query_progress": null,- "results": null,- "start_time": "2025-02-06T13:33:35.541Z",- "task_id": "27dd6480-a665-47dc-87b9-1e2d1f747bbb",- "team_id": 1- }-}diff --git a/frontend/src/scenes/experiments/MetricsView/new/MetricRowGroup.tsx b/frontend/src/scenes/experiments/MetricsView/new/MetricRowGroup.tsxindex 6955f8159224..76c10666ff9c 100644--- a/frontend/src/scenes/experiments/MetricsView/new/MetricRowGroup.tsx+++ b/frontend/src/scenes/experiments/MetricsView/new/MetricRowGroup.tsx@@ -51,7 +51,7 @@ import {isSignificant,isWinning,} from '~/scenes/experiments/MetricsView/shared/utils'-import { Experiment, InsightType, BreakdownAttributionType } from '~/types'+import { Experiment, BreakdownAttributionType } from '~/types'import { isLaunched } from 'products/experiments/frontend/experimentStatus'import { DetailsModal } from 'products/experiments/frontend/modals/DetailsModal/DetailsModal'@@ -515,7 +515,6 @@ interface MetricRowGroupProps {metric: ExperimentMetricresult: NewExperimentQueryResponse | nullexperiment: Experiment- metricType: InsightTypedisplayOrder: numberaxisRange: numberisSecondary: boolean@@ -547,7 +546,6 @@ export function MetricRowGroup({metric,result,experiment,- metricType,displayOrder,axisRange,isSecondary,@@ -815,7 +813,6 @@ export function MetricRowGroup({dragHandle={dragHandle}displayOrder={displayOrder}metric={metric}- metricType={metricType}isPrimaryMetric={!isSecondary}experiment={experiment}onDuplicateMetricClick={() => onDuplicateMetric?.()}@@ -892,7 +889,6 @@ export function MetricRowGroup({dragHandle={dragHandle}displayOrder={displayOrder}metric={metric}- metricType={metricType}isPrimaryMetric={!isSecondary}experiment={experiment}onDuplicateMetricClick={() => onDuplicateMetric?.()}@@ -1007,7 +1003,6 @@ export function MetricRowGroup({dragHandle={dragHandle}displayOrder={displayOrder}metric={metric}- metricType={metricType}isPrimaryMetric={!isSecondary}experiment={experiment}onDuplicateMetricClick={() => onDuplicateMetric?.()}diff --git a/frontend/src/scenes/experiments/MetricsView/new/Metrics.tsx b/frontend/src/scenes/experiments/MetricsView/new/Metrics.tsxindex 6a4b382b1133..b5e071e0e7f0 100644--- a/frontend/src/scenes/experiments/MetricsView/new/Metrics.tsx+++ b/frontend/src/scenes/experiments/MetricsView/new/Metrics.tsx@@ -32,7 +32,7 @@ export function Metrics({ isSecondary }: { isSecondary?: boolean }): JSX.Element}function MetricsContent({ experiment, isSecondary }: { experiment: Experiment; isSecondary?: boolean }): JSX.Element {- const { getInsightType, hasMinimumExposureForResults } = useValues(experimentLogic)+ const { hasMinimumExposureForResults } = useValues(experimentLogic)const {primaryMetricsResults,primaryMetricsResultsErrors,@@ -96,7 +96,6 @@ function MetricsContent({ experiment, isSecondary }: { experiment: Experiment; iresults={results}errors={errors}isSecondary={!!isSecondary}- getInsightType={getInsightType}showDetailsModal={false}embedded/>@@ -108,13 +107,7 @@ function MetricsContent({ experiment, isSecondary }: { experiment: Experiment; i/></div>) : (- <MetricsTable- metrics={metrics}- results={results}- errors={errors}- isSecondary={!!isSecondary}- getInsightType={getInsightType}- />+ <MetricsTable metrics={metrics} results={results} errors={errors} isSecondary={!!isSecondary} />)) : (<div className="border rounded bg-surface-primary pt-6 pb-8 text-secondary mt-2">diff --git a/frontend/src/scenes/experiments/MetricsView/new/MetricsTable.tsx b/frontend/src/scenes/experiments/MetricsView/new/MetricsTable.tsxindex e7dfc1a7ad17..97c1cb69194f 100644--- a/frontend/src/scenes/experiments/MetricsView/new/MetricsTable.tsx+++ b/frontend/src/scenes/experiments/MetricsView/new/MetricsTable.tsx@@ -8,7 +8,7 @@ import { verticalSortableListCollisionDetection } from 'lib/sortable'import { experimentsConfigLogic } from 'scenes/settings/environment/experimentsConfigLogic'import { ExperimentMetric, NewExperimentQueryResponse } from '~/queries/schema/schema-general'-import { ExperimentStatsMethod, InsightType } from '~/types'+import { ExperimentStatsMethod } from '~/types'import { isLaunched } from 'products/experiments/frontend/experimentStatus'@@ -37,7 +37,6 @@ interface MetricsTableProps {results: (NewExperimentQueryResponse | undefined)[]errors: any[]isSecondary: boolean- getInsightType: (metric: ExperimentMetric) => InsightTypeshowDetailsModal?: boolean/** Drops the table's own border so it can sit inside a parent panel. */embedded?: boolean@@ -48,7 +47,6 @@ export function MetricsTable({results,errors,isSecondary,- getInsightType,showDetailsModal = true,embedded = false,}: MetricsTableProps): JSX.Element {@@ -211,7 +209,6 @@ export function MetricsTable({dragHandle={dragHandle}result={result}experiment={experiment}- metricType={getInsightType(metric)}displayOrder={index}axisRange={axisRange}isSecondary={isSecondary}diff --git a/frontend/src/scenes/experiments/MetricsView/shared/ChartEmptyState.tsx b/frontend/src/scenes/experiments/MetricsView/shared/ChartEmptyState.tsxindex b5fc68fe84c8..f6e210f8f141 100644--- a/frontend/src/scenes/experiments/MetricsView/shared/ChartEmptyState.tsx+++ b/frontend/src/scenes/experiments/MetricsView/shared/ChartEmptyState.tsx@@ -2,7 +2,6 @@ import { IconClock } from '@posthog/icons'import { LemonTag } from '@posthog/lemon-ui'import { MetricErrorState } from '../new/MetricErrorState'-import { ErrorChecklist } from './ErrorChecklist'interface ChartEmptyStateProps {height: number@@ -51,19 +50,14 @@ export function ChartEmptyState({// eslint-disable-next-line react/forbid-dom-propsstyle={error ? { minHeight: `${height}px` } : { height: `${height}px` }}>- {error.hasDiagnostics ? (- <ErrorChecklist error={error} metric={metric} />- ) : (- // Use rich error state for all other errors- <MetricErrorState- error={error}- metric={metric}- query={query}- onRetry={onRetry}- retryDisabledReason={retryDisabledReason}- height={height}- />- )}+ <MetricErrorState+ error={error}+ metric={metric}+ query={query}+ onRetry={onRetry}+ retryDisabledReason={retryDisabledReason}+ height={height}+ /></div>)}diff --git a/frontend/src/scenes/experiments/MetricsView/shared/ErrorChecklist.tsx b/frontend/src/scenes/experiments/MetricsView/shared/ErrorChecklist.tsxdeleted file mode 100644index 625d863d2466..000000000000--- a/frontend/src/scenes/experiments/MetricsView/shared/ErrorChecklist.tsx+++ /dev/null@@ -1,168 +0,0 @@-import { useValues } from 'kea'-import { combineUrl } from 'kea-router/lib/utils'--import { IconCheck, IconX } from '@posthog/icons'-import { Link, Tooltip } from '@posthog/lemon-ui'--import { IconOpenInNew } from 'lib/lemon-ui/icons'-import { urls } from 'scenes/urls'--import { NodeKind } from '~/queries/schema/schema-general'-import { ActivityTab, Experiment, InsightType, MultivariateFlagVariant } from '~/types'--import { experimentLogic } from '../../experimentLogic'-import {- EXPOSURE_DEFAULT_EVENT,- EXPOSURE_FEATURE_FLAG_PROPERTY,- featureFlagVariantProperty,-} from '../../exposureContract'--export enum ResultErrorCode {- NO_CONTROL_VARIANT = 'no-control-variant',- NO_TEST_VARIANT = 'no-test-variant',- NO_EXPOSURES = 'no-exposures',-}--interface ErrorChecklistProps {- error: any- metric: any-}--type ChecklistItemProps = {- errorCode: ResultErrorCode- value: boolean- experiment: Experiment- metric: any- variants: MultivariateFlagVariant[]- getInsightType: (metric: any) => InsightType-}--function ChecklistItem({- errorCode,- value,- experiment,- metric,- variants,- getInsightType,-}: ChecklistItemProps): JSX.Element {- const failureText: Record<ResultErrorCode, string> = {- [ResultErrorCode.NO_CONTROL_VARIANT]: 'Events with the control variant not received',- [ResultErrorCode.NO_TEST_VARIANT]: 'Events with at least one test variant not received',- [ResultErrorCode.NO_EXPOSURES]: 'Exposure events not received',- }-- const successText: Record<ResultErrorCode, string> = {- [ResultErrorCode.NO_CONTROL_VARIANT]: 'Events with the control variant received',- [ResultErrorCode.NO_TEST_VARIANT]: 'Events with at least one test variant received',- [ResultErrorCode.NO_EXPOSURES]: 'Exposure events have been received',- }-- const insightType = getInsightType(metric)- const hasMissingExposure = errorCode === ResultErrorCode.NO_EXPOSURES-- const requiredEvent =- insightType === InsightType.TRENDS- ? hasMissingExposure- ? metric.exposure_query?.series[0]?.event || EXPOSURE_DEFAULT_EVENT- : metric.count_query?.series[0]?.event- : metric.funnels_query?.series[0]?.event-- const query = {- kind: NodeKind.DataTableNode,- full: true,- source: {- kind: NodeKind.EventsQuery,- select: [- '*',- 'event',- `properties."${featureFlagVariantProperty(experiment.feature_flag?.key ?? '')}"`,- 'timestamp',- ],- orderBy: ['timestamp DESC'],- after: experiment.start_date,- event: requiredEvent,- properties: [- {- key: featureFlagVariantProperty(experiment.feature_flag?.key ?? ''),- value: hasMissingExposure- ? variants.map((variant) => variant.key)- : errorCode === ResultErrorCode.NO_CONTROL_VARIANT- ? ['control']- : variants.slice(1).map((variant) => variant.key),- operator: 'exact',- type: 'event',- },- ...(hasMissingExposure- ? [- {- key: EXPOSURE_FEATURE_FLAG_PROPERTY,- value: [experiment.feature_flag?.key],- operator: 'exact',- type: 'event',- },- ]- : []),- ],- filterTestAccounts: metric.count_query?.filter_test_accounts,- },- propertiesViaUrl: true,- showPersistentColumnConfigurator: true,- }-- return (- <div className="flex items-center deprecated-space-x-2">- {value === false ? (- <span className="flex items-center deprecated-space-x-2">- <IconCheck className="text-success" fontSize={16} />- <span className="text-secondary">{successText[errorCode]}</span>- </span>- ) : (- <span className="flex items-center deprecated-space-x-2">- <IconX className="text-danger" fontSize={16} />- <span>{failureText[errorCode]}</span>- <Tooltip title="Verify missing events in the Activity tab">- <Link- target="_blank"- className="font-semibold"- to={combineUrl(urls.activity(ActivityTab.ExploreEvents), {}, { q: query }).url}- >- <IconOpenInNew fontSize="16" className="-ml-1" />- </Link>- </Tooltip>- </span>- )}- </div>- )-}--export function ErrorChecklist({ error, metric }: ErrorChecklistProps): JSX.Element | null {- const { experiment, variants, getInsightType } = useValues(experimentLogic)-- /**- * bail if no error or no diagnostics- */- if (!error || !error.hasDiagnostics) {- return <></>- }-- const checklistItems = []- for (const [errorCode, value] of Object.entries(error.detail as Record<ResultErrorCode, boolean>)) {- // Check if the error code is valid (cached response might still have old error codes)- if (!Object.values(ResultErrorCode).includes(errorCode as ResultErrorCode)) {- continue- }- checklistItems.push(- <ChecklistItem- key={errorCode}- errorCode={errorCode as ResultErrorCode}- value={value}- experiment={experiment}- metric={metric}- variants={variants}- getInsightType={getInsightType}- />- )- }-- return <div>{checklistItems}</div>-}diff --git a/frontend/src/scenes/experiments/MetricsView/shared/MetricHeader.tsx b/frontend/src/scenes/experiments/MetricsView/shared/MetricHeader.tsxindex e18153fc7cd8..cb17a3787516 100644--- a/frontend/src/scenes/experiments/MetricsView/shared/MetricHeader.tsx+++ b/frontend/src/scenes/experiments/MetricsView/shared/MetricHeader.tsx@@ -96,7 +96,6 @@ export const MetricHeader = ({dragHandle,displayOrder,metric,- metricType,isPrimaryMetric,experiment,onDuplicateMetricClick,@@ -108,7 +107,6 @@ export const MetricHeader = ({dragHandle?: JSX.Element | nulldisplayOrder?: numbermetric: ExperimentMetric- metricType: anyisPrimaryMetric: booleanexperiment: ExperimentonDuplicateMetricClick: (metric: ExperimentMetric) => void@@ -239,7 +237,7 @@ export const MetricHeader = ({<div className="flex items-start justify-between gap-2 min-w-0"><div className="text-xs font-semibold flex items-start min-w-0 flex-1"><div className="min-w-0 flex-1">- <MetricTitle metric={metric} metricType={metricType} />+ <MetricTitle metric={metric} /></div></div>{!readOnly && (diff --git a/frontend/src/scenes/experiments/MetricsView/shared/MetricTitle.tsx b/frontend/src/scenes/experiments/MetricsView/shared/MetricTitle.tsxindex b141fa0c93cc..c0bcc1a7f00b 100644--- a/frontend/src/scenes/experiments/MetricsView/shared/MetricTitle.tsx+++ b/frontend/src/scenes/experiments/MetricsView/shared/MetricTitle.tsx@@ -1,20 +1,10 @@-import { IconArrowRight, IconFunnels } from '@posthog/icons'import { Tooltip } from '@posthog/lemon-ui'import { NodeKind } from '~/queries/schema/schema-general'-import { InsightType } from '~/types'import { getDefaultMetricTitle } from './utils'-export const MetricTitle = ({- metric,- metricType,- singleLine,-}: {- metric: any- metricType?: InsightType- singleLine?: boolean-}): JSX.Element => {+export const MetricTitle = ({ metric, singleLine }: { metric: any; singleLine?: boolean }): JSX.Element => {const shouldShowTooltip = (text: string): boolean => {// Show tooltip for longer text that might be clampedreturn text.length > 50@@ -42,32 +32,5 @@ export const MetricTitle = ({return wrapWithTooltip(title, element)}- if (metricType === InsightType.TRENDS && metric.count_query?.series?.[0]?.name) {- const name = metric.count_query.series[0].name- const element = <span className={getTextClassName(name)}>{name}</span>- return wrapWithTooltip(name, element)- }-- if (metricType === InsightType.FUNNELS && metric.funnels_query?.series) {- const series = metric.funnels_query.series- if (series.length > 0) {- const firstStep = series[0]?.name- const lastStep = series[series.length - 1]?.name-- return (- <div className="inline-flex flex-wrap items-center gap-1 min-w-0">- <div className="inline-flex items-center gap-1 min-w-0">- <IconFunnels className="text-secondary flex-shrink-0" fontSize="14" />- {wrapWithTooltip(firstStep, <span className={getTextClassName(firstStep)}>{firstStep}</span>)}- </div>- <div className="inline-flex items-center gap-1 min-w-0 @max-[200px]:ml-5">- <IconArrowRight className="text-secondary flex-shrink-0" fontSize="14" />- {wrapWithTooltip(lastStep, <span className={getTextClassName(lastStep)}>{lastStep}</span>)}- </div>- </div>- )- }- }-return <span className={`text-secondary ${getTextClassName('Untitled metric')}`}>Untitled metric</span>}diff --git a/frontend/src/scenes/experiments/SharedMetrics/SharedMetric.tsx b/frontend/src/scenes/experiments/SharedMetrics/SharedMetric.tsxindex 5c74c3c7dfdb..07870e2f6aba 100644--- a/frontend/src/scenes/experiments/SharedMetrics/SharedMetric.tsx+++ b/frontend/src/scenes/experiments/SharedMetrics/SharedMetric.tsx@@ -281,7 +281,7 @@ export function SharedMetric(): JSX.Element {{isLegacy ? (<LemonBanner type="warning">Legacy shared metrics can no longer be edited. When you migrate an experiment that uses this- metric with PostHog AI, the metric is migrated too.+ metric, the metric is migrated too.</LemonBanner>) : (<ExperimentMetricFormdiff --git a/frontend/src/scenes/experiments/experimentLogic.test.ts b/frontend/src/scenes/experiments/experimentLogic.test.tsindex 145d590e9a18..8528d5599529 100644--- a/frontend/src/scenes/experiments/experimentLogic.test.ts+++ b/frontend/src/scenes/experiments/experimentLogic.test.ts@@ -49,9 +49,6 @@ jest.mock('scenes/approvals/ApprovalRequiredBanner', () => ({showApprovalRequiredToast: (...args: any[]) => mockShowApprovalRequiredToast(...args),}))-const RUNNING_EXP_ID = 45-const RUNNING_FUNNEL_EXP_ID = 46-const setHealthFindingsFlag = (enabled: boolean): void => {featureFlagLogic.actions.setFeatureFlags(enabled ? [FEATURE_FLAGS.EXPERIMENT_HEALTH_FINDINGS] : [],@@ -92,38 +89,6 @@ describe('experimentLogic', () => {results: [],},'/api/projects/:team/experiments/:id': experiment,- [`/api/projects/:team/experiments/${RUNNING_EXP_ID}/results`]: {- filters: { breakdown: '$feature/test-experiment', breakdown_type: 'event', insight: 'TRENDS' },- insight: [- { breakdown_value: 'control', count: 200 },- { breakdown_value: 'test_1', count: 400 },- { breakdown_value: 'test_2', count: 500 },- { breakdown_value: 'test_3', count: 100 },- ],- probability: { control: 0.7, test_1: 0.1, test_2: 0.2, test_3: 0 },- },- [`/api/projects/:team/experiments/${RUNNING_FUNNEL_EXP_ID}/results`]: {- filters: { breakdown: '$feature/test-experiment', breakdown_type: 'event', insight: 'FUNNELS' },- insight: [- [- { breakdown_value: ['control'], count: 200, order: 0 },- { breakdown_value: ['control'], count: 100, order: 1 },- ],- [- { breakdown_value: ['test_1'], count: 200, order: 0 },- { breakdown_value: ['test_1'], count: 120, order: 1 },- ],- [- { breakdown_value: ['test_2'], count: 200, order: 0 },- { breakdown_value: ['test_2'], count: 140, order: 1 },- ],- [- { breakdown_value: ['test_3'], count: 200, order: 0 },- { breakdown_value: ['test_3'], count: 160, order: 1 },- ],- ],- probability: { control: 0.7, test_1: 0.1, test_2: 0.2, test_3: 0 },- },},})initKeaTests()diff --git a/frontend/src/scenes/experiments/experimentLogic.tsx b/frontend/src/scenes/experiments/experimentLogic.tsxindex 9046612e683e..22be74f2787c 100644--- a/frontend/src/scenes/experiments/experimentLogic.tsx+++ b/frontend/src/scenes/experiments/experimentLogic.tsx@@ -30,7 +30,6 @@ import { addProjectIdIfMissing } from 'lib/utils/kea-router'import { objectsEqual } from 'lib/utils/objects'import { showApprovalRequiredToast } from 'scenes/approvals/ApprovalRequiredBanner'import { dispatchChangeRequestCreated } from 'scenes/approvals/utils'-import { billingLogic } from 'scenes/billing/billingLogic'import {hasMultipleVariantsActive,hasZeroRollout,@@ -38,13 +37,11 @@ import {} from 'scenes/feature-flags/featureFlagLogic'import { featureFlagsLogic } from 'scenes/feature-flags/featureFlagsLogic'import { projectLogic } from 'scenes/projectLogic'-import { experimentsConfigLogic } from 'scenes/settings/environment/experimentsConfigLogic'import { teamLogic } from 'scenes/teamLogic'import { urls } from 'scenes/urls'import { refreshTreeItem } from '~/layout/panel-layout/ProjectTree/projectTreeLogic'import { cohortsModel } from '~/models/cohortsModel'-import { groupsModel } from '~/models/groupsModel'import { tagsModel } from '~/models/tagsModel'import { performQuery } from '~/queries/query'import {@@ -53,7 +50,6 @@ import {ExperimentExposureQueryResponse,ExperimentFunnelsQuery,ExperimentMetric,- ExperimentMetricType,ExperimentTrendsQuery,FunnelsQuery,InsightVizNode,@@ -70,7 +66,6 @@ import {ExperimentConclusion,ExperimentStatsMethod,FeatureFlagType,- InsightType,MultivariateFlagVariant,} from '~/types'@@ -98,11 +93,8 @@ import {isSingleVariantShipped,} from 'products/experiments/frontend/scenes/experimentsLogic'-import type { ProductIntentProperties } from '../../lib/utils/product-intents'-import type { Noun } from '../../models/groupsModel'import type { ExperimentMetricUnion } from '../../queries/schema/schema-general'-import type { BillingType, ExperimentHoldoutType, ExperimentIdType, GroupType, GroupTypeIndex } from '../../types'-import type { ExperimentsConfig } from '../settings/environment/experimentsConfigLogic'+import type { ExperimentHoldoutType, ExperimentIdType } from '../../types'import { experimentMetricsLogic } from './experimentMetricsLogic'import { featureFlagVariantProperty, resolvedExposureEvent } from './exposureContract'import { holdoutsLogic } from './holdoutsLogic'@@ -344,13 +336,7 @@ async function inflightUpdateOutcome(cache: Record<string, any>): Promise<'saved// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface experimentLogicValues {- billing: BillingType | null // billingLogic- defaultMinimumDetectableEffect: number // experimentsConfigLogic- experimentsConfig: ExperimentsConfig | null // experimentsConfigLogicfeatureFlags: FeatureFlagsSet // featureFlagLogic- aggregationLabel: (groupTypeIndex: number | null | undefined, deferToUserWording?: boolean) => Noun // groupsModel- groupTypes: Map<GroupTypeIndex, GroupType> // groupsModel- showGroupsOptions: boolean // groupsModelholdouts: ExperimentHoldoutType[] // holdoutsLogiccurrentProjectId: number | null // projectLogicsharedMetrics: SharedMetric[] // sharedMetricsLogic@@ -377,9 +363,6 @@ export interface experimentLogicValues {exposuresLoading: booleanformMode: FormModesfreezeExposureLoading: boolean- getInsightType: (- metric: ExperimentFunnelsQuery | ExperimentMetricUnion | ExperimentTrendsQuery | undefined- ) => InsightTypehasMetrics: booleanhasMinimumExposureForResults: booleanhealthFindings: HealthPanelFinding[] | null@@ -396,7 +379,6 @@ export interface experimentLogicValues {launchExperimentLoading: booleanmigrateLegacyExperimentLoading: booleanopenDatePicker: 'end' | 'start' | null- primaryMetricsLengthWithSharedMetrics: numberprops: anyresolvedExposureEvent: stringshippedVariantKey: string | null@@ -469,13 +451,6 @@ export interface experimentLogicActions {experimentId: ExperimentIdTypesharedMetric: SharedMetric} // eventUsageLogic- reportExperimentTimeseriesRecalculated: (- experimentId: ExperimentIdType,- metric: ExperimentMetricUnion- ) => {- experimentId: ExperimentIdType- metric: ExperimentMetricUnion- } // eventUsageLogicreportExperimentTimeseriesViewed: (experimentId: ExperimentIdType,metric: ExperimentMetricUnion@@ -524,7 +499,6 @@ export interface experimentLogicActions {loadTags: () => {value: true} // tagsModel- addProductIntent: (properties: ProductIntentProperties) => ProductIntentProperties // teamLogicaddSharedMetricsToExperiment: (sharedMetricIds: SharedMetric['id'][],metadata: {@@ -797,9 +771,6 @@ export interface experimentLogicActions {resumeExperiment: () => {value: true}- setEditExperiment: (editing: boolean) => {- editing: boolean- }setEndExperimentLoading: (loading: boolean) => {loading: boolean}@@ -999,7 +970,6 @@ export interface experimentLogicMeta {exposures: any,isExperimentDraft: boolean) => HealthPanelFinding[] | null- primaryMetricsLengthWithSharedMetrics: (experiment: Experiment) => numberusesNewQueryRunner: (experiment: Experiment) => booleanhasMinimumExposureForResults: (exposures: any, usesNewQueryRunner: boolean) => booleanexposureCriteria: (experiment: Experiment) => ExperimentExposureCriteria | undefined@@ -1026,18 +996,12 @@ export const experimentLogic = kea<experimentLogicType>([['currentProjectId'],teamLogic,['currentTeamId'],- groupsModel,- ['aggregationLabel', 'groupTypes', 'showGroupsOptions'],featureFlagLogic,['featureFlags'],holdoutsLogic,['holdouts'],- billingLogic,- ['billing'],sharedMetricsLogic,['sharedMetrics'],- experimentsConfigLogic,- ['experimentsConfig', 'defaultMinimumDetectableEffect'],],actions: [experimentsLogic,@@ -1055,13 +1019,10 @@ export const experimentLogic = kea<experimentLogicType>(['reportExperimentSharedMetricAssigned','reportExperimentDashboardCreated','reportExperimentTimeseriesViewed',- 'reportExperimentTimeseriesRecalculated','reportExperimentAiSummaryRequested','reportExperimentMetricBreakdownAdded','reportExperimentMetricBreakdownRemoved',],- teamLogic,- ['addProductIntent'],featureFlagsLogic,['updateFlagFromPartial'],modalsLogic,@@ -1102,7 +1063,6 @@ export const experimentLogic = kea<experimentLogicType>([setExperiment: (experiment: Partial<Experiment>) => ({ experiment }),setLaunchExperimentLoading: (loading: boolean) => ({ loading }),setEndExperimentLoading: (loading: boolean) => ({ loading }),- setEditExperiment: (editing: boolean) => ({ editing }),refreshExperimentResults: (forceRefresh?: boolean,triggeredBy?: ExperimentTriggeredBy,@@ -2706,20 +2666,6 @@ export const experimentLogic = kea<experimentLogicType>([(experimentId): Experiment['id'] => experimentId,],formMode: [() => [(_, props) => props.formMode ?? FORM_MODES.update], (formMode): FormModes => formMode],- getInsightType: [- () => [],- () =>- (- metric: ExperimentMetric | ExperimentTrendsQuery | ExperimentFunnelsQuery | undefined- ): InsightType => {- return metric &&- ((metric.kind === NodeKind.ExperimentMetric &&- metric.metric_type === ExperimentMetricType.MEAN) ||- metric?.kind === NodeKind.ExperimentTrendsQuery)- ? InsightType.TRENDS- : InsightType.FUNNELS- },- ],isExperimentDraft: [(s) => [s.experiment],(experiment: Experiment): boolean => {@@ -2881,15 +2827,6 @@ export const experimentLogic = kea<experimentLogicType>([): HealthPanelFinding[] | null =>healthPending ? [] : healthPanelFindings(shownHealth, exposures, isExperimentDraft),],- primaryMetricsLengthWithSharedMetrics: [- (s) => [s.experiment],- (experiment: Experiment): number => {- return (- experiment.metrics.length +- experiment.saved_metrics.filter((savedMetric) => savedMetric.metadata.type === 'primary').length- )- },- ],usesNewQueryRunner: [(s) => [s.experiment],(experiment: Experiment): boolean => {diff --git a/frontend/src/scenes/experiments/experimentResultsNotificationLogic.ts b/frontend/src/scenes/experiments/experimentResultsNotificationLogic.tsindex 42c48141d6ed..915529923d1e 100644--- a/frontend/src/scenes/experiments/experimentResultsNotificationLogic.ts+++ b/frontend/src/scenes/experiments/experimentResultsNotificationLogic.ts@@ -46,7 +46,7 @@ export type experimentResultsNotificationLogicType = MakeLogicType</*** Browser notification for the recalculation flow: the status bar's "Notify me" button opts in, and a* notification fires when the run finishes. Driven entirely by `experimentMetricsLogic.isRecalculating`- * so it's decoupled from how results are loaded. The legacy equivalent still lives in experimentLogic.+ * so it's decoupled from how results are loaded.*/export const experimentResultsNotificationLogic = kea<experimentResultsNotificationLogicType>([props({} as ExperimentResultsNotificationLogicProps),diff --git a/frontend/src/scenes/experiments/experimentSceneLogic.test.ts b/frontend/src/scenes/experiments/experimentSceneLogic.test.tsindex c92f1ebf15b2..1e179e5c256c 100644--- a/frontend/src/scenes/experiments/experimentSceneLogic.test.ts+++ b/frontend/src/scenes/experiments/experimentSceneLogic.test.ts@@ -27,7 +27,6 @@ type ExperimentLogicMock = {__logic: {mount: jest.Mock<any, any>actions: {- setEditExperiment: jest.MockresetExperiment: jest.MockloadExperiment: jest.MockloadExposures: jest.Mock@@ -43,7 +42,6 @@ jest.mock('./experimentLogic', () => {const logicInstance = {mount: jest.fn(() => jest.fn()),actions: {- setEditExperiment: jest.fn(),resetExperiment: jest.fn(),loadExperiment: jest.fn(),loadExposures: jest.fn(),diff --git a/frontend/src/scenes/experiments/experimentSceneLogic.tsx b/frontend/src/scenes/experiments/experimentSceneLogic.tsxindex 2cbabdab7769..c31ef763cfdd 100644--- a/frontend/src/scenes/experiments/experimentSceneLogic.tsx+++ b/frontend/src/scenes/experiments/experimentSceneLogic.tsx@@ -428,7 +428,6 @@ export const experimentSceneLogic = kea<experimentSceneLogicType>([},setEditMode: (payload, breakpoint, action, previousState) => {sharedListeners.ensureExperimentLogicMounted(payload, breakpoint, action, previousState)- values.experimentLogicRef?.logic.actions.setEditExperiment(payload.editing)},resetExperimentState: (payload, breakpoint, action, previousState) => {sharedListeners.ensureExperimentLogicMounted(payload, breakpoint, action, previousState)diff --git a/frontend/src/scenes/experiments/exposureContract.ts b/frontend/src/scenes/experiments/exposureContract.tsindex be8aa893e0ca..588b2c37904d 100644--- a/frontend/src/scenes/experiments/exposureContract.ts+++ b/frontend/src/scenes/experiments/exposureContract.ts@@ -25,7 +25,6 @@ import { Experiment } from '~/types'export const EXPOSURE_DEFAULT_EVENT = '$feature_flag_called'export const EXPERIMENT_EXPOSURE_EVENT = '$experiment_exposure'export const EXPOSURE_FEATURE_FLAG_RESPONSE_PROPERTY = '$feature_flag_response'-export const EXPOSURE_FEATURE_FLAG_PROPERTY = '$feature_flag'/*** The event an experiment's default exposure is actually counted on, as resolved by the backenddiff --git a/frontend/src/scenes/experiments/metricQueryUtils.ts b/frontend/src/scenes/experiments/metricQueryUtils.tsindex fbd97087bbbc..a3ac6369e240 100644--- a/frontend/src/scenes/experiments/metricQueryUtils.ts+++ b/frontend/src/scenes/experiments/metricQueryUtils.ts@@ -21,7 +21,6 @@ import type {DateRange,EntityNode,EventsNode,- ExperimentEventExposureConfig,ExperimentFunnelMetric,ExperimentMetric,ExperimentMetricSource,@@ -36,10 +35,8 @@ import type {} from '~/queries/schema/schema-general'import { ExperimentMetricType, NodeKind } from '~/queries/schema/schema-general'import { setLatestVersionsOnQuery } from '~/queries/utils'-import type { IntervalType, MultivariateFlagVariant } from '~/types'-import { ChartDisplayType, ExperimentMetricMathType, PropertyFilterType, PropertyOperator } from '~/types'--import { EXPOSURE_DEFAULT_EVENT, EXPOSURE_FEATURE_FLAG_PROPERTY, featureFlagVariantProperty } from './exposureContract'+import type { IntervalType } from '~/types'+import { ChartDisplayType, ExperimentMetricMathType } from '~/types'/*** We extract all the math properties from the EntityNode type so we can use them as@@ -304,52 +301,6 @@ export function seriesToMetricConfig(.otherwise(() => undefined)}-/**- * converts the experiment exposure config in to an events node- */-export const getExposureConfigEventsNode = (- exposureConfig: ExperimentEventExposureConfig,- options: {- featureFlagKey: string- featureFlagVariants: MultivariateFlagVariant[]- /** The experiment's server-resolved default exposure event, see `resolvedExposureEvent`. */- resolvedExposureEvent?: string- }-): EventsNode => {- const exposure_step_name = 'Experiment exposure'- if (exposureConfig && exposureConfig.event !== EXPOSURE_DEFAULT_EVENT) {- const { featureFlagKey, featureFlagVariants } = options- return {- kind: NodeKind.EventsNode,- custom_name: exposure_step_name,- event: exposureConfig.event,- properties: [- ...(exposureConfig.properties || []),- {- key: featureFlagVariantProperty(featureFlagKey),- type: PropertyFilterType.Event,- value: featureFlagVariants.map(({ key }) => key),- operator: PropertyOperator.Exact,- },- ],- }- }-- return {- kind: NodeKind.EventsNode,- custom_name: exposure_step_name,- event: options.resolvedExposureEvent ?? EXPOSURE_DEFAULT_EVENT,- properties: [- {- key: EXPOSURE_FEATURE_FLAG_PROPERTY,- type: PropertyFilterType.Event,- value: options.featureFlagKey,- operator: PropertyOperator.Exact,- },- ],- }-}-/*** we can only add exposure to funnel metrics, that have a series.* we may want to add exposure at this stage to process all items in the seriesdiff --git a/frontend/src/scenes/experiments/modalsLogic.ts b/frontend/src/scenes/experiments/modalsLogic.tsindex b4efb2647ad8..db6221a29ce9 100644--- a/frontend/src/scenes/experiments/modalsLogic.ts+++ b/frontend/src/scenes/experiments/modalsLogic.ts@@ -1,15 +1,7 @@-import { MakeLogicType, actions, connect, kea, path, reducers } from 'kea'--import { featureFlagsLogic } from 'scenes/feature-flags/featureFlagsLogic'-import { projectLogic } from 'scenes/projectLogic'-import { teamLogic } from 'scenes/teamLogic'--import type { FeatureFlagType } from '../../types'+import { MakeLogicType, actions, kea, path, reducers } from 'kea'// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface modalsLogicValues {- currentProjectId: number | null // projectLogic- currentTeamId: number | null // teamLogicisCopyToProjectModalOpen: booleanisCupedModalOpen: booleanisDescriptionModalOpen: boolean@@ -19,20 +11,15 @@ export interface modalsLogicValues {isExposureCriteriaModalOpen: booleanisFinishExperimentModalOpen: booleanisPauseExperimentModalOpen: boolean- isPrimaryMetricSourceModalOpen: booleanisQuickSurveyModalOpen: booleanisReleaseConditionsModalOpen: booleanisResumeExperimentModalOpen: booleanisRunningTimeConfigModalOpen: boolean- isSecondaryMetricSourceModalOpen: booleanisStatsEngineModalOpen: boolean}// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface modalsLogicActions {- updateFlag: (flag: FeatureFlagType) => {- flag: FeatureFlagType- } // featureFlagsLogiccloseAllModals: () => {value: true}@@ -63,9 +50,6 @@ export interface modalsLogicActions {closePauseExperimentModal: () => {value: true}- closePrimaryMetricSourceModal: () => {- value: true- }closeQuickSurveyModal: () => {value: true}@@ -78,9 +62,6 @@ export interface modalsLogicActions {closeRunningTimeConfigModal: () => {value: true}- closeSecondaryMetricSourceModal: () => {- value: true- }closeStatsEngineModal: () => {value: true}@@ -111,9 +92,6 @@ export interface modalsLogicActions {openPauseExperimentModal: () => {value: true}- openPrimaryMetricSourceModal: () => {- value: true- }openQuickSurveyModal: () => {value: true}@@ -126,9 +104,6 @@ export interface modalsLogicActions {openRunningTimeConfigModal: () => {value: true}- openSecondaryMetricSourceModal: () => {- value: true- }openStatsEngineModal: () => {value: true}@@ -138,10 +113,6 @@ export type modalsLogicType = MakeLogicType<modalsLogicValues, modalsLogicActionexport const modalsLogic = kea<modalsLogicType>([path(['scenes', 'experiments', 'modalsLogic']),- connect(() => ({- values: [projectLogic, ['currentProjectId'], teamLogic, ['currentTeamId']],- actions: [featureFlagsLogic, ['updateFlag']],- })),actions({closeAllModals: true,openExposureCriteriaModal: true,@@ -164,10 +135,6 @@ export const modalsLogic = kea<modalsLogicType>([closeStatsEngineModal: true,openCupedModal: true,closeCupedModal: true,- openPrimaryMetricSourceModal: true,- closePrimaryMetricSourceModal: true,- openSecondaryMetricSourceModal: true,- closeSecondaryMetricSourceModal: true,openRunningTimeConfigModal: true,closeRunningTimeConfigModal: true,openDuplicateExperimentModal: true,@@ -234,22 +201,6 @@ export const modalsLogic = kea<modalsLogicType>([closeAllModals: () => false,},],- isPrimaryMetricSourceModalOpen: [- false,- {- openPrimaryMetricSourceModal: () => true,- closePrimaryMetricSourceModal: () => false,- closeAllModals: () => false,- },- ],- isSecondaryMetricSourceModalOpen: [- false,- {- openSecondaryMetricSourceModal: () => true,- closeSecondaryMetricSourceModal: () => false,- closeAllModals: () => false,- },- ],isDescriptionModalOpen: [false,{diff --git a/frontend/src/scenes/experiments/utils.ts b/frontend/src/scenes/experiments/utils.tsindex 1f2b50169eda..59850ab036bd 100644--- a/frontend/src/scenes/experiments/utils.ts+++ b/frontend/src/scenes/experiments/utils.ts@@ -621,10 +621,8 @@ export const isLegacyExperimentQuery = (query: unknown): query is ExperimentTren}/**- * The legacy query runner uses ExperimentTrendsQuery and ExperimentFunnelsQuery- * to run experiments.- *- * We should remove these legacy metrics once we've migrated all experiments to the new query runner.+ * True when an inline or shared metric of the experiment still uses the legacy ExperimentTrendsQuery or+ * ExperimentFunnelsQuery shape. The app shows no results for such an experiment until it is migrated.*/export const isLegacyExperiment = (experiment?: Experiment | null): boolean => {if (!experiment) {diff --git a/frontend/src/types.ts b/frontend/src/types.tsindex e351a86be81e..4a7c067b60cd 100644--- a/frontend/src/types.ts+++ b/frontend/src/types.ts@@ -5269,19 +5269,6 @@ export interface ExperimentVelocityStats {completed_last_30d: number}-export interface FunnelExperimentVariant {- key: string- success_count: number- failure_count: number-}--export interface TrendExperimentVariant {- key: string- count: number- exposure: number- absolute_exposure: number-}-export interface SecondaryExperimentMetric {name: stringfilters: Partial<FilterType>@@ -5404,14 +5391,6 @@ export interface PathEdgeParameters {maxEdgeWeight?: number | undefined}-export enum SignificanceCode {- Significant = 'significant',- NotEnoughExposure = 'not_enough_exposure',- LowWinProbability = 'low_win_probability',- HighLoss = 'high_loss',- HighPValue = 'high_p_value',-}-export enum HelpType {Slack = 'slack',GitHub = 'github',diff --git a/products/experiments/frontend/constants.ts b/products/experiments/frontend/constants.tsindex 7042c7216222..67e7bb65b9b8 100644--- a/products/experiments/frontend/constants.ts+++ b/products/experiments/frontend/constants.ts@@ -12,7 +12,6 @@ export const CONFIDENCE_LEVEL_OPTIONS = []export const EXPERIMENT_MIN_EXPOSURES_FOR_RESULTS = 50-export const EXPERIMENT_MIN_METRIC_VALUE_FOR_RESULTS = 10// CUPED lookback window (days)export const DEFAULT_LOOKBACK_DAYS = 14diff --git a/products/experiments/skills/diagnosing-experiment-health/references/interpretation.md b/products/experiments/skills/diagnosing-experiment-health/references/interpretation.mdindex 2a7e078b1568..c217091901d6 100644--- a/products/experiments/skills/diagnosing-experiment-health/references/interpretation.md+++ b/products/experiments/skills/diagnosing-experiment-health/references/interpretation.md@@ -126,7 +126,7 @@ significant difference, work through:_Sanity check:_ re-aggregate the warehouse table byorg/group once (deduped) and compare to the per-user sum; a large gap confirms repeated-rowinflation.-5. **Is it a legacy experiment?** An experiment with legacy metrics runs on the older engine (E13 in `mid-run-changes.md`).+5. **Is it a legacy experiment?** A legacy experiment shows no results (E13 in `mid-run-changes.md`).Migrate it before reading an A/A result.**Recommend:** if chance and exposure do not explain the result, investigate instrumentation rather than@@ -181,10 +181,8 @@ PostHog defaults to Bayesian, unless the project's default method says otherwise- **Flat priors.** PostHog uses a non-informative prior. Early swingsaren't the prior pushing things around — they're the data being sparse.- **The displayed effect is relative** to the baseline: 10% against 12% conversion reads as +20%.-- **Legacy experiments.** An experiment with legacy metrics (`is_legacy` in `experiment-get`) uses an older engine with- different multivariate semantics and different significance gates. See E13 in `mid-run-changes.md`, and PostHog's- [legacy-methodology docs page](https://posthog.com/docs/experiments/legacy-methodology).- Legacy experiments no longer show results. Migrate them with `experiment-migrate`.+- **Legacy experiments.** Legacy experiments (`is_legacy` in `experiment-get`) no longer show results.+ Migrate them with `experiment-migrate`. See E13 in `mid-run-changes.md`.<!-- Source for maintainers (may rot): is_decisive in products/experiments/stats/bayesian/tests.py;credible_interval in products/experiments/stats/bayesian/utils.py. -->