mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-03 00:52:32 +00:00
The rule table mapped HOG_ -> FN_ ahead of any POSTHOG rule, so POSTHOG_FOO split into POST + HOG_ and came out POSTFN_FOO. Nothing sets that. The live pods set INSIGHTS_SKIP_MIGRATION_CHECKS, which bin/migrate-check reads on the container entrypoint, so the misspelling does not degrade a feature -- it runs migrate --check against a database whose history this tree does not share and the container never starts. Both replacements are measured against the shipped tree rather than chosen: every HOG_ name with a counterpart there is spelled INSIGHTS_ (HOG_QL -> INSIGHTS_QL, HOG_FUNCTION_TEMPLATES -> INSIGHTS_FUNCTION_TEMPLATES, 12 of 12 determinate cases), and FN_ appears in it nowhere. Upstream carries 95 HOG_ tokens and zero FN_ ones, so repairing FN_ back out is exactly the inverse of the bad rule and cannot collide with an upstream name. The rule is fixed for the next convergence, and the tree it already produced is repaired in the same commit -- the codemod is idempotent against its own output, so it cannot undo this itself.
208 lines
8.3 KiB
TypeScript
208 lines
8.3 KiB
TypeScript
import { FEATURE_FLAGS } from 'lib/constants'
|
|
import { urls } from 'scenes/urls'
|
|
|
|
import { ProductItemCategory, ProductKey } from '~/queries/schema/schema-general'
|
|
import { ActivityScope, ProductManifest } from '~/types'
|
|
|
|
import type { ModelsSceneTab } from '../../frontend/src/scenes/models/modelsSceneLogic'
|
|
import type { SchemaConfigurationSection, SchemaSceneTab } from './frontend/scenes/SchemaScene/SchemaScene'
|
|
import type { SourceSceneTab } from './frontend/scenes/SourceScene/SourceScene'
|
|
|
|
export const manifest: ProductManifest = {
|
|
name: 'Data ops',
|
|
scenes: {
|
|
DataOps: {
|
|
name: 'Data ops',
|
|
import: () => import('./DataWarehouseScene'),
|
|
projectBased: true,
|
|
activityScope: 'DataWarehouse',
|
|
description: "Manage your organization's shared data warehouse.",
|
|
iconType: 'data_warehouse',
|
|
},
|
|
Models: {
|
|
name: 'Models',
|
|
import: () => import('../../frontend/src/scenes/models/ModelsScene'),
|
|
projectBased: true,
|
|
description: 'Create and manage views and materialized views for transforming and organizing your data.',
|
|
iconType: 'sql_editor',
|
|
},
|
|
NodeDetail: {
|
|
name: 'Model detail',
|
|
import: () => import('../../frontend/src/scenes/models/NodeDetailScene'),
|
|
projectBased: true,
|
|
},
|
|
SQLEditor: {
|
|
projectBased: true,
|
|
name: 'SQL editor',
|
|
layout: 'app-raw-no-header',
|
|
hideProjectNotice: true,
|
|
description: 'Write and execute SQL queries against your data warehouse',
|
|
},
|
|
Sources: {
|
|
import: () => import('./frontend/scenes/SourcesScene/SourcesScene'),
|
|
projectBased: true,
|
|
name: 'Sources',
|
|
description:
|
|
'Import data into Insights from external sources including webhooks, application connectors, and self-managed databases.',
|
|
activityScope: ActivityScope.INSIGHTS_FUNCTION,
|
|
iconType: 'data_pipeline',
|
|
},
|
|
DataWarehouseSource: {
|
|
import: () => import('./frontend/scenes/SourceScene/SourceScene'),
|
|
projectBased: true,
|
|
name: 'Data warehouse source',
|
|
},
|
|
DataWarehouseSourceNew: {
|
|
import: () => import('./frontend/scenes/NewSourceScene/NewSourceScene'),
|
|
projectBased: true,
|
|
name: 'New data warehouse source',
|
|
},
|
|
DataWarehouseSourceConnect: {
|
|
import: () => import('./frontend/scenes/SourceConnectScene/SourceConnectScene'),
|
|
projectBased: true,
|
|
name: 'Connect data warehouse source',
|
|
},
|
|
DataWarehouseSourceSchema: {
|
|
import: () => import('./frontend/scenes/SchemaScene/SchemaScene'),
|
|
projectBased: true,
|
|
name: 'Data warehouse schema',
|
|
},
|
|
},
|
|
routes: {
|
|
'/data-ops': ['DataOps', 'dataOps'],
|
|
'/models': ['Models', 'models'],
|
|
'/models/dags': ['Models', 'models'],
|
|
'/models/:id': ['NodeDetail', 'nodeDetail'],
|
|
'/data-management/sources': ['Sources', 'sources'],
|
|
'/data-management/sources/:sourceId/schemas/:schemaId': [
|
|
'DataWarehouseSourceSchema',
|
|
'dataWarehouseSourceSchema',
|
|
],
|
|
'/data-management/sources/:sourceId/schemas/:schemaId/:tab': [
|
|
'DataWarehouseSourceSchema',
|
|
'dataWarehouseSourceSchema',
|
|
],
|
|
'/data-management/sources/:sourceId/schemas/:schemaId/configuration/:section': [
|
|
'DataWarehouseSourceSchema',
|
|
'dataWarehouseSourceSchema',
|
|
],
|
|
'/data-management/sources/:id/:tab': ['DataWarehouseSource', 'dataWarehouseSource'],
|
|
'/data-warehouse/new-source': ['DataWarehouseSourceNew', 'dataWarehouseSourceNew'],
|
|
'/data-warehouse/connect': ['DataWarehouseSourceConnect', 'dataWarehouseSourceConnect'],
|
|
},
|
|
redirects: {
|
|
// 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/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),
|
|
},
|
|
urls: {
|
|
dataOps: (tab?: string, dagId?: string): string => {
|
|
const params = new URLSearchParams()
|
|
if (tab) {
|
|
params.set('tab', tab)
|
|
}
|
|
if (dagId) {
|
|
params.set('dag', dagId)
|
|
}
|
|
const query = params.toString()
|
|
return query ? `/data-ops?${query}` : '/data-ops'
|
|
},
|
|
models: (tab?: ModelsSceneTab): string => `/models${tab ? `/${tab}` : ''}`,
|
|
nodeDetail: (id: string): string => `/models/${id}`,
|
|
sources: (): string => '/data-management/sources',
|
|
dataWarehouseSource: (id: string, tab?: SourceSceneTab): string =>
|
|
`/data-management/sources/${id}/${tab ?? 'schemas'}`,
|
|
dataWarehouseSourceSchema: (
|
|
sourceId: string,
|
|
schemaId: string,
|
|
tab?: SchemaSceneTab,
|
|
section?: SchemaConfigurationSection
|
|
): string => {
|
|
const base = `/data-management/sources/${sourceId}/schemas/${schemaId}`
|
|
if (tab === 'configuration' && section) {
|
|
return `${base}/configuration/${section}`
|
|
}
|
|
return tab ? `${base}/${tab}` : base
|
|
},
|
|
dataWarehouseSourceNew: (
|
|
kind?: string,
|
|
returnUrl?: string,
|
|
returnLabel?: string,
|
|
accessMethod?: 'warehouse' | 'direct'
|
|
): string => {
|
|
const params = new URLSearchParams()
|
|
if (kind) {
|
|
params.set('kind', kind)
|
|
}
|
|
if (returnUrl) {
|
|
params.set('returnUrl', returnUrl)
|
|
}
|
|
if (returnLabel) {
|
|
params.set('returnLabel', returnLabel)
|
|
}
|
|
if (accessMethod) {
|
|
params.set('access_method', accessMethod)
|
|
}
|
|
const queryString = params.toString()
|
|
return `/data-warehouse/new-source${queryString ? `?${queryString}` : ''}`
|
|
},
|
|
dataWarehouseSourceConnect: (kind?: string): string =>
|
|
`/data-warehouse/connect${kind ? `?kind=${encodeURIComponent(kind)}` : ''}`,
|
|
},
|
|
treeItemsProducts: [
|
|
{
|
|
path: 'SQL editor',
|
|
intents: [ProductKey.DATA_WAREHOUSE_SAVED_QUERY, ProductKey.DATA_WAREHOUSE],
|
|
category: ProductItemCategory.ANALYTICS,
|
|
type: 'sql',
|
|
iconType: 'sql_editor',
|
|
iconColor: ['var(--color-product-data-warehouse-light)'],
|
|
href: urls.sqlEditor(),
|
|
sceneKey: 'SQLEditor',
|
|
sceneKeys: ['SQLEditor'],
|
|
},
|
|
{
|
|
path: 'Data warehouse',
|
|
displayLabel: 'Data ops',
|
|
intents: [ProductKey.DATA_WAREHOUSE, ProductKey.DATA_WAREHOUSE_SAVED_QUERY],
|
|
category: ProductItemCategory.UNRELEASED,
|
|
href: urls.dataOps(),
|
|
flag: FEATURE_FLAGS.DATA_WAREHOUSE_SCENE,
|
|
iconType: 'data_warehouse',
|
|
iconColor: ['var(--color-product-data-warehouse-light)'],
|
|
sceneKey: 'DataOps',
|
|
},
|
|
],
|
|
treeItemsMetadata: [
|
|
{
|
|
path: `Sources`,
|
|
category: 'Pipeline',
|
|
type: 'insights_function/source',
|
|
iconType: 'data_pipeline_metadata',
|
|
href: urls.sources(),
|
|
sceneKey: 'Sources',
|
|
sceneKeys: ['Sources'],
|
|
},
|
|
{
|
|
path: 'Models',
|
|
category: 'Tools',
|
|
type: 'sql',
|
|
iconType: 'sql_editor',
|
|
iconColor: ['var(--color-product-data-warehouse-light)'],
|
|
href: urls.models(),
|
|
sceneKey: 'Models',
|
|
sceneKeys: ['Models'],
|
|
},
|
|
{
|
|
path: 'Managed viewsets',
|
|
category: 'Unreleased',
|
|
iconType: 'managed_viewsets',
|
|
href: urls.dataWarehouseManagedViewsets(),
|
|
flag: FEATURE_FLAGS.MANAGED_VIEWSETS,
|
|
},
|
|
],
|
|
}
|