: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(clerk): skip the OAuth applications table when the plan lacks it (#88344)
Tom Owers15d5054089c2
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/clerk/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/clerk/settings.pyindex a294fa988ff3..185277a89bea 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/clerk/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/clerk/settings.py@@ -83,7 +83,13 @@ CLERK_ENDPOINTS: dict[str, ClerkEndpointConfig] = {name="enterprise_connections", path="/enterprise_connections", is_wrapped_response=True),"oauth_applications": ClerkEndpointConfig(- name="oauth_applications", path="/oauth_applications", is_wrapped_response=True+ name="oauth_applications",+ path="/oauth_applications",+ is_wrapped_response=True,+ # Clerk answers 404 resource_not_found for the OAuth applications list on instances that+ # haven't switched the feature on — the same feature-off signal the Restrictions endpoints+ # give. Skip zero rows instead of failing the schema every run.+ gated_feature="OAuth applications",),"machines": ClerkEndpointConfig(name="machines", path="/machines", is_wrapped_response=True),# /api_keys and /m2m_tokens cap `limit` at 100 rather than 500.diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/clerk/tests/test_clerk.py b/products/warehouse_sources/backend/temporal/data_imports/sources/clerk/tests/test_clerk.pyindex d4eaaa916d98..c1f97c164242 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/clerk/tests/test_clerk.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/clerk/tests/test_clerk.py@@ -520,6 +520,8 @@ class TestClerkFeatureGatedEndpoints:("commerce_plans", 403, {"errors": [{"code": "feature_not_enabled"}]}),# Restrictions off: the allow-list endpoint answers 404 resource_not_found, not a 4xx code.("allowlist_identifiers", 404, {"errors": [{"code": "resource_not_found"}]}),+ # OAuth applications off: the list endpoint answers the same 404 resource_not_found.+ ("oauth_applications", 404, {"errors": [{"code": "resource_not_found"}]}),],)def test_feature_not_enabled_syncs_no_rows_instead_of_failing(