: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
fix(flags): use 'all' not 'both' for evaluation_runtime filter enum (#64105)
Phil Haackc806f3de65ab
diff --git a/products/feature_flags/backend/api/feature_flag.py b/products/feature_flags/backend/api/feature_flag.pyindex 0d5ff77c4872..cf0d1577bc3c 100644--- a/products/feature_flags/backend/api/feature_flag.py+++ b/products/feature_flags/backend/api/feature_flag.py@@ -2546,7 +2546,7 @@ class FeatureFlagViewSet(OpenApiTypes.STR,location=OpenApiParameter.QUERY,required=False,- enum=["server", "client", "both"],+ enum=[choice[0] for choice in FeatureFlag.EVALUATION_RUNTIME_CHOICES],description="Filter feature flags by their evaluation runtime.",),OpenApiParameter(diff --git a/products/feature_flags/backend/api/test/test_feature_flag.py b/products/feature_flags/backend/api/test/test_feature_flag.pyindex 08d7856604de..d5d7e1601f7b 100644--- a/products/feature_flags/backend/api/test/test_feature_flag.py+++ b/products/feature_flags/backend/api/test/test_feature_flag.py@@ -6253,8 +6253,8 @@ class TestFeatureFlag(APIBaseTest, ClickhouseTestMixin):FeatureFlag.objects.create(team=self.team,created_by=self.user,- key="both_flag",- evaluation_runtime="both",+ key="all_flag",+ evaluation_runtime="all",)# Test filtering by server environment@@ -6269,11 +6269,11 @@ class TestFeatureFlag(APIBaseTest, ClickhouseTestMixin):assert len(response["results"]) == 1assert response["results"][0]["key"] == "client_flag"- # Test filtering by both environment- filtered_flags_list = self.client.get(f"/api/projects/@current/feature_flags?evaluation_runtime=both")+ # Test filtering by all environment+ filtered_flags_list = self.client.get(f"/api/projects/@current/feature_flags?evaluation_runtime=all")response = filtered_flags_list.json()assert len(response["results"]) == 1- assert response["results"][0]["key"] == "both_flag"+ assert response["results"][0]["key"] == "all_flag"@patch("django.db.transaction.on_commit", side_effect=lambda func: func())def test_flag_is_cached_on_create_and_update(self, mock_on_commit):diff --git a/products/feature_flags/frontend/generated/api.schemas.ts b/products/feature_flags/frontend/generated/api.schemas.tsindex fc9ed807ec89..8b8320eefe7d 100644--- a/products/feature_flags/frontend/generated/api.schemas.ts+++ b/products/feature_flags/frontend/generated/api.schemas.ts@@ -1412,7 +1412,7 @@ export type FeatureFlagsListEvaluationRuntime =(typeof FeatureFlagsListEvaluationRuntime)[keyof typeof FeatureFlagsListEvaluationRuntime]export const FeatureFlagsListEvaluationRuntime = {- Both: 'both',+ All: 'all',Client: 'client',Server: 'server',} as constdiff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 450a2d0f5e13..0e240c261b99 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -55906,7 +55906,7 @@ export namespace Schemas {export const FeatureFlagsListEvaluationRuntime = {- Both: 'both',+ All: 'all',Client: 'client',Server: 'server',} as const;diff --git a/services/mcp/src/generated/feature_flags/api.ts b/services/mcp/src/generated/feature_flags/api.tsindex 65167e97a2b8..4388d419869d 100644--- a/services/mcp/src/generated/feature_flags/api.ts+++ b/services/mcp/src/generated/feature_flags/api.ts@@ -57,7 +57,7 @@ export const FeatureFlagsListQueryParams = /* @__PURE__ */ zod.object({active: zod.enum(['STALE', 'false', 'true']).optional(),created_by_id: zod.string().optional().describe('The User ID which initially created the feature flag.'),evaluation_runtime: zod- .enum(['both', 'client', 'server'])+ .enum(['all', 'client', 'server']).optional().describe('Filter feature flags by their evaluation runtime.'),excluded_properties: zoddiff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/feature-flag-get-all.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/feature-flag-get-all.jsonindex a22c26a45da8..edb7dda5f18a 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/feature-flag-get-all.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/feature-flag-get-all.json@@ -11,7 +11,7 @@},"evaluation_runtime": {"description": "Filter feature flags by their evaluation runtime.",- "enum": ["both", "client", "server"],+ "enum": ["all", "client", "server"],"type": "string"},"excluded_properties": {