: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(data-warehouse): redirect /data-warehouse/new to the new-source wizard (#87543)
Tom Owersbeddcfc8f69c
diff --git a/frontend/src/products.tsx b/frontend/src/products.tsxindex 74ac14efb41d..faa5f7a16caa 100644--- a/frontend/src/products.tsx+++ b/frontend/src/products.tsx@@ -396,6 +396,7 @@ export const productRedirects: Record<return combineUrl(defaultTab, searchParams, hashParams).url},'/data-warehouse': () => urls.sources(),+ '/data-warehouse/new': () => urls.dataWarehouseSourceNew(),'/data-warehouse/sources': () => urls.sources(),'/data-warehouse/sources/:id': ({ id }) => urls.dataWarehouseSource(id, 'schemas'),'/data-warehouse/sources/:id/:tab': ({ id, tab }) => urls.dataWarehouseSource(id, tab as SourceSceneTab),diff --git a/frontend/src/scenes/sceneLogic.test.tsx b/frontend/src/scenes/sceneLogic.test.tsxindex fcd42565afd8..88628733aef3 100644--- a/frontend/src/scenes/sceneLogic.test.tsx+++ b/frontend/src/scenes/sceneLogic.test.tsx@@ -87,6 +87,12 @@ describe('sceneLogic', () => {expect(removeProjectIdIfPresent(router.values.location.pathname)).toEqual(urls.projectCreateFirst())})+ it('redirects /data-warehouse/new to the new-source wizard instead of a 404', async () => {+ router.actions.push('/data-warehouse/new')+ await expectLogic(logic).delay(1)+ expect(removeProjectIdIfPresent(router.values.location.pathname)).toEqual(urls.dataWarehouseSourceNew())+ })+it('redirects the old /code_review path to /code-review, preserving the ?review= deep link and hash', async () => {router.actions.push('/code_review', { review: 'r-9' }, { panel: 'max:inspect' })await expectLogic(logic).delay(1)diff --git a/products/data_warehouse/manifest.tsx b/products/data_warehouse/manifest.tsxindex 0e7a632fc327..480e04516757 100644--- a/products/data_warehouse/manifest.tsx+++ b/products/data_warehouse/manifest.tsx@@ -94,6 +94,9 @@ export const manifest: ProductManifest = {// Switching projects while in the new-source wizard truncates the URL to bare// `/data-warehouse`, which otherwise 404s. Send it to the sources list instead.'/data-warehouse': () => urls.sources(),+ // `/data-warehouse/new` is a natural URL for "add a source" but was never a real route.+ // Redirect it to the new-source wizard rather than 404ing.+ '/data-warehouse/new': () => urls.dataWarehouseSourceNew(),'/data-warehouse/sources': () => urls.sources(),'/data-warehouse/sources/:id': ({ id }) => urls.dataWarehouseSource(id, 'schemas'),'/data-warehouse/sources/:id/:tab': ({ id, tab }) => urls.dataWarehouseSource(id, tab as SourceSceneTab),