: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): drop the rolled-out flag-cleanup-pr gate from the UI (#99594)
posthog[bot]f32cd763c1cb
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex 6814458e7509..ff47d1d03784 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -319,7 +319,6 @@ export const FEATURE_FLAGS = {ERROR_TRACKING_WEEKLY_DIGEST: 'error-tracking-weekly-digest', // owner: #team-error-trackingEVENT_MEDIA_PREVIEWS: 'event-media-previews', // owner: @alexliderEXPERIMENT_BEHAVIOR_COMPARISON: 'experiment-behavior-comparison', // owner: @mp-hog #team-experiments- EXPERIMENT_FLAG_CLEANUP_PR: 'experiment-flag-cleanup-pr', // owner: @jurajmajerik #team-experimentsEXPERIMENT_METRIC_EVENT_BREAKDOWNS: 'experiment-metric-event-breakdowns', // owner: @rodrigoi #team-experimentsEXPERIMENTS_DW_AA_TEST: 'experiments-dw-aa-test', // owner: @rodrigoi #team-experimentsEXPERIMENTS_EXCLUDED_VARIANTS: 'experiments-excluded-variants', // owner: @rodrigoi #team-experimentsdiff --git a/frontend/src/scenes/experiments/ExperimentView/ExperimentModals.tsx b/frontend/src/scenes/experiments/ExperimentView/ExperimentModals.tsxindex c7e74e6e5da4..4fba6573d8be 100644--- a/frontend/src/scenes/experiments/ExperimentView/ExperimentModals.tsx+++ b/frontend/src/scenes/experiments/ExperimentView/ExperimentModals.tsx@@ -238,9 +238,8 @@ export function FinishExperimentModal(): JSX.Element {const { cleanupTarget } = useValues(flagCleanupTargetLogic({ experimentId: experiment.id as number }))- // The cleanup PR runs as a PostHog Desktop task, so the user needs Code access on top of the rollout flag.- const cleanupPrAvailable =- !!featureFlags[FEATURE_FLAGS.EXPERIMENT_FLAG_CLEANUP_PR] && !!featureFlags[FEATURE_FLAGS.TASKS]+ // The cleanup PR runs as a PostHog Desktop task, so the user needs Code access.+ const cleanupPrAvailable = !!featureFlags[FEATURE_FLAGS.TASKS]// With several connected repositories and none saved on the experiment, the backend would// skip the cleanup rather than guess — so a pick is required here.const cleanupNeedsRepositoryPick = cleanupTarget?.source === 'ambiguous'diff --git a/frontend/src/scenes/experiments/ExperimentView/flagCleanupTargetLogic.test.ts b/frontend/src/scenes/experiments/ExperimentView/flagCleanupTargetLogic.test.tsindex 27a09e620089..1629da3f2616 100644--- a/frontend/src/scenes/experiments/ExperimentView/flagCleanupTargetLogic.test.ts+++ b/frontend/src/scenes/experiments/ExperimentView/flagCleanupTargetLogic.test.ts@@ -20,20 +20,19 @@ describe('flagCleanupTargetLogic', () => {mockRetrieve.mockReset()})- it('loads the target when the finish modal opens, only for users with the cleanup feature', async () => {+ it('loads the target when the finish modal opens, only for users with Code access', async () => {mockRetrieve.mockResolvedValue({ repository: null, source: 'ambiguous', candidates: ['acme/web', 'acme/api'] })featureFlagLogic.mount()const logic = flagCleanupTargetLogic({ experimentId: 1 })logic.mount()- // Cleanup flags off: opening the modal must not hit the endpoint (it would 403).+ // Without Code access: opening the modal must not hit the endpoint (it would 403).modalsLogic.mount()modalsLogic.actions.openFinishExperimentModal()await Promise.resolve()expect(mockRetrieve).not.toHaveBeenCalled()featureFlagLogic.actions.setFeatureFlags([], {- [FEATURE_FLAGS.EXPERIMENT_FLAG_CLEANUP_PR]: true,[FEATURE_FLAGS.TASKS]: true,})modalsLogic.actions.openFinishExperimentModal()diff --git a/frontend/src/scenes/experiments/ExperimentView/flagCleanupTargetLogic.ts b/frontend/src/scenes/experiments/ExperimentView/flagCleanupTargetLogic.tsindex 252e75b9d615..a1c1cc147892 100644--- a/frontend/src/scenes/experiments/ExperimentView/flagCleanupTargetLogic.ts+++ b/frontend/src/scenes/experiments/ExperimentView/flagCleanupTargetLogic.ts@@ -78,10 +78,7 @@ export const flagCleanupTargetLogic = kea<flagCleanupTargetLogicType>([// Loaded on modal open, not on mount: the modal component mounts with the scene,// and most experiment page visits never open it.openFinishExperimentModal: () => {- if (- values.featureFlags[FEATURE_FLAGS.EXPERIMENT_FLAG_CLEANUP_PR] &&- values.featureFlags[FEATURE_FLAGS.TASKS]- ) {+ if (values.featureFlags[FEATURE_FLAGS.TASKS]) {actions.loadCleanupTarget()}},diff --git a/products/experiments/frontend/scenes/ExperimentsSettingsScene.tsx b/products/experiments/frontend/scenes/ExperimentsSettingsScene.tsxindex 9a8ec94f845e..fa4654762e20 100644--- a/products/experiments/frontend/scenes/ExperimentsSettingsScene.tsx+++ b/products/experiments/frontend/scenes/ExperimentsSettingsScene.tsx@@ -63,9 +63,8 @@ export function ExperimentsSettingsScene(): JSX.Element {const { featureFlags } = useValues(featureFlagLogic)// The cleanup PR runs as a PostHog Desktop task, so the setting is only relevant with- // Code access on top of the rollout flag (same gate as the end-experiment modal checkbox).- const cleanupPrAvailable =- !!featureFlags[FEATURE_FLAGS.EXPERIMENT_FLAG_CLEANUP_PR] && !!featureFlags[FEATURE_FLAGS.TASKS]+ // Code access (same gate as the end-experiment modal checkbox).+ const cleanupPrAvailable = !!featureFlags[FEATURE_FLAGS.TASKS]if (experimentsConfigLoading && !experimentsConfig) {return <SpinnerOverlay sceneLevel />