Repository navigation
fix: point the Connect to Demo Server connection at the new demo ClickHouse #3419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@hyperdx/app': patch | ||
| --- | ||
|
|
||
| fix: point the "Connect to Demo Server" connection at the new demo ClickHouse |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,11 @@ import { | |
| IS_LOCAL_MODE, | ||
| IS_PROMQL_ENABLED, | ||
| } from '@/config'; | ||
| import { useConnections, useCreateConnection } from '@/connection'; | ||
| import { | ||
| useConnections, | ||
| useCreateConnection, | ||
| useUpdateConnection, | ||
| } from '@/connection'; | ||
| import { useMetadataWithSettings } from '@/hooks/useMetadata'; | ||
| import { | ||
| inferTableSourceConfig, | ||
|
|
@@ -36,6 +40,17 @@ import { useBrandDisplayName } from '@/theme/ThemeProvider'; | |
| import { TableSourceForm } from './Sources/SourceForm'; | ||
| import { SourcesList } from './Sources/SourcesList'; | ||
|
|
||
| const DEMO_CONNECTION = { | ||
| name: 'Demo', | ||
| host: 'https://b1g1gnrrz3.us-central1.gcp.clickhouse-staging.com:8443', | ||
| username: 'otel_demo', | ||
| password: '', | ||
| }; | ||
| const LEGACY_DEMO_CONNECTION = { | ||
| host: 'https://sql-clickhouse.clickhouse.com', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — CONTRIBUTING.md still tells contributors to use the old demo host and the Update CONTRIBUTING.md lines 124-127 (the manual full-stack demo setup) to the new host and database Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond |
||
| username: 'otel_demo', | ||
| }; | ||
|
|
||
| async function addOtelDemoSources({ | ||
| connectionId, | ||
| createSourceMutation, | ||
|
|
@@ -260,6 +275,7 @@ function OnboardingModalComponent({ | |
|
|
||
| const createSourceMutation = useCreateSource(); | ||
| const createConnectionMutation = useCreateConnection(); | ||
| const updateConnectionMutation = useUpdateConnection(); | ||
|
greptile-apps[bot] marked this conversation as resolved.
Resolved
|
||
| const updateSourceMutation = useUpdateSource(); | ||
| const deleteSourceMutation = useDeleteSource(); | ||
| const metadata = useMetadataWithSettings(); | ||
|
|
@@ -652,16 +668,19 @@ function OnboardingModalComponent({ | |
| // Reuse existing demo connection if available, otherwise create one | ||
| const existingDemoConnection = connections?.find(c => c.name === 'Demo'); | ||
| let createdConnectionId = existingDemoConnection?.id ?? ''; | ||
| if (!existingDemoConnection) { | ||
| if ( | ||
|
pulpdrew marked this conversation as resolved.
Resolved
|
||
| existingDemoConnection?.host === LEGACY_DEMO_CONNECTION.host && | ||
| existingDemoConnection.username === LEGACY_DEMO_CONNECTION.username | ||
| ) { | ||
| // Demo connections created before the demo server moved still point | ||
| // at the old host | ||
| await updateConnectionMutation.mutateAsync({ | ||
| id: existingDemoConnection.id, | ||
| connection: { ...existingDemoConnection, ...DEMO_CONNECTION }, | ||
|
greptile-apps[bot] marked this conversation as resolved.
Resolved
|
||
| }); | ||
| } else if (!existingDemoConnection) { | ||
| await createConnectionMutation.mutateAsync( | ||
| { | ||
| connection: { | ||
| name: 'Demo', | ||
| host: 'https://sql-clickhouse.clickhouse.com', | ||
| username: 'otel_demo', | ||
| password: '', | ||
| }, | ||
| }, | ||
| { connection: DEMO_CONNECTION }, | ||
| { | ||
| onSuccess(data) { | ||
| createdConnectionId = data.id; | ||
|
|
@@ -680,23 +699,23 @@ function OnboardingModalComponent({ | |
| createSourceMutation, | ||
| deleteSourceMutation, | ||
|
|
||
| logSourceDatabaseName: 'otel_v2', | ||
| logSourceDatabaseName: 'otel', | ||
| logSourceName: 'Demo Logs', | ||
| logSourceTableName: 'otel_logs', | ||
|
|
||
| metricsSourceDatabaseName: 'otel_v2', | ||
| metricsSourceDatabaseName: 'otel', | ||
| metricsSourceName: 'Demo Metrics', | ||
|
|
||
| sessionSourceDatabaseName: 'otel_v2', | ||
| sessionSourceDatabaseName: 'otel', | ||
| sessionSourceName: 'Demo Sessions', | ||
| sessionSourceTableName: 'hyperdx_sessions', | ||
|
|
||
| traceSourceDatabaseName: 'otel_v2', | ||
| traceSourceDatabaseName: 'otel', | ||
| traceSourceName: 'Demo Traces', | ||
| traceSourceTableName: 'otel_traces', | ||
| traceSourceMaterializedViews: [ | ||
| { | ||
| databaseName: 'otel_v2', | ||
| databaseName: 'otel', | ||
| tableName: 'otel_traces_1m', | ||
| dimensionColumns: 'ServiceName, StatusCode', | ||
| minGranularity: '1 minute', | ||
|
|
@@ -716,7 +735,7 @@ function OnboardingModalComponent({ | |
| ], | ||
| }, | ||
| { | ||
| databaseName: 'otel_v2', | ||
| databaseName: 'otel', | ||
| tableName: 'otel_traces_1m_v2', | ||
| dimensionColumns: 'ServiceName, SpanName, SpanKind', | ||
| minGranularity: '1 minute', | ||
|
|
@@ -788,6 +807,7 @@ function OnboardingModalComponent({ | |
| connections, | ||
| createSourceMutation, | ||
| createConnectionMutation, | ||
| updateConnectionMutation, | ||
| updateSourceMutation, | ||
| deleteSourceMutation, | ||
| sources, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,9 +38,11 @@ jest.mock('@/source', () => ({ | |
| const mockConnectionsResult = { | ||
| data: [{ id: 'conn-1', name: 'Default', host: 'http://localhost:8123' }], | ||
| }; | ||
| const mockUpdateConnectionMutation = { mutateAsync: jest.fn() }; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — New legacy-connection migration path has no test; the mock only exists so the import resolves Add a test that seeds Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond |
||
| jest.mock('@/connection', () => ({ | ||
| useConnections: () => mockConnectionsResult, | ||
| useCreateConnection: () => ({ mutate: jest.fn() }), | ||
| useUpdateConnection: () => mockUpdateConnectionMutation, | ||
| })); | ||
|
|
||
| const mockMetadata = { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 major — Demo connection is hardcoded to a ClickHouse staging host (
*.clickhouse-staging.com:8443)Before merging, point
DEMO_CONNECTION.hostat a production or stable public endpoint. Like the oldsql-clickhouse.clickhouse.com, it should be a*.clickhouse.comhost, not an auto-generated staging instance ID. Every self-hosted install and every Vercel preview will be wired to this host, and the legacy-migration branch rewrites existing Demo connections to it permanently.Nothing blocks merge automatically, but a maintainer will expect this fixed if it is a real defect in code this PR changes. If it is about surrounding code, reply and say so instead of patching. Do not widen the PR. How to respond