Skip to content

fix: point the Connect to Demo Server connection at the new demo ClickHouse - #3419

Merged
kodiakhq[bot] merged 2 commits into
mainfrom
drew/update-demo-connection
Oct 22, 2026
Merged

kodiakhq[bot] merged 2 commits into
mainfrom
drew/update-demo-connection

Conversation

@pulpdrew

@pulpdrew pulpdrew commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR updates the demo connection details to point to a new service.

Screenshots or video

Preview environment: https://hyperdx-oss-git-drew-update-demo-connection-hyperdx.vercel.app/search?source=32d9cd5f45baf5d2&where=&select=&whereLanguage=lucene&filters=%255B%255D&orderBy=&from=1792512199482&to=1792513099482

Screenshot 2026-10-20 at 12 17 49 PM Screenshot 2026-10-20 at 12 18 04 PM

How to reproduce

How to test on Vercel preview

Connect to the demo server in the preview environment, validate in the network tab that the new connection is being hit.

References

  • Linear Issue: Closes HDX-5765
  • Related PRs:

@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Oct 22, 2026 3:03pm UTC
hyperdx-storybook Ready Ready Preview Oct 22, 2026 3:03pm UTC

Request Review

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 116 in total (1.43%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues remain.

Summary

Updates “Connect to Demo Server” to use the new ClickHouse host and otel database.

  • Onboarding connects the demo setup to the replacement ClickHouse.

Reviews (4) · Last reviewed commit: "Merge branch 'main' into drew/update-dem..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 457 passed • 1 skipped • 1525s

Status Count
✅ Passed 457
❌ Failed 0
⚠️ Flaky 2
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

@pulpdrew
pulpdrew force-pushed the drew/update-demo-connection branch from 8b79d4d to 9c472ab Compare October 20, 2026 15:27
@changeset-bot

changeset-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e2a56f0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

🔵 Tier 2 — Low Risk

Small, isolated change with no API route or data model modifications.

Why this tier:

  • Standard feature/fix — introduces new logic or modifies core functionality

Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns.
SLA: Resolve within 4 business hours.

Stats
  • Production files changed: 1
  • Production lines changed: 52 (+ 2 in test files, excluded from tier calculation)
  • Branch: drew/update-demo-connection
  • Author: pulpdrew

To override this classification, remove the review/tier-2 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 critical or 🟠 major in code this PR adds or changes: fix before asking for review.
  • 🔵 minor in code this PR changes: your call. Fix if small, otherwise reply.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    severity. Reply with one sentence; if it is critical, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

3 finding(s): 🔴 0 critical · 🟠 1 major · 🔵 2 minor

3 posted as inline comment(s) on the changed lines.


Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

Scope: .changeset/demo-server-new-host.md, packages/app/src/components/OnboardingModal.tsx, packages/app/src/components/__tests__/OnboardingModal.test.tsx (base f41027f2).
Intent: Point the "Connect to Demo Server" onboarding shortcut at a new demo ClickHouse host, migrate a legacy demo connection in place, and move demo sources from the otel_v2 database to otel.

✅ No critical issues found.

Both prior P1 review comments are resolved in this diff: the test now mocks useUpdateConnection (component renders), and the in-place update is guarded by an exact legacy host + username match so a user's own Demo connection is left untouched. Type logic for the merged-connection spread and optional-chain narrowing is sound.

🟡 P2 -- recommended

  • packages/app/src/components/OnboardingModal.tsx:46 -- The new demo host resolves to a clickhouse-staging.com domain, so a user-facing onboarding shortcut now depends on a staging endpoint that may be ephemeral.
    • Fix: Confirm this host is the intended durable public demo endpoint before merge, or substitute the production demo domain.
    • correctness, maintainability
  • packages/app/src/components/OnboardingModal.tsx:671 -- The new three-way demo-connection logic (legacy-match → update, none → create, otherwise → reuse) has no behavioral test; handleDemoServerClick is entirely uncovered and the useCreateConnection mock exposes only mutate while the code calls mutateAsync.
    • Fix: Add tests seeding a legacy-matching Demo connection (assert updateConnectionMutation.mutateAsync with the merged connection) and no Demo connection (assert create with DEMO_CONNECTION), and change the mock to expose mutateAsync.
    • testing, correctness, maintainability
🔵 P3 nitpicks (5)
  • packages/app/src/components/OnboardingModal.tsx:702 -- The demo database name otel is hardcoded in ~8 literal sites (source databaseName fields and materialized-view entries), inviting a partial rename next time.
    • Fix: Extract a single DEMO_DATABASE_NAME constant and reference it in every databaseName field.
  • packages/app/src/components/OnboardingModal.tsx:669 -- The literal 'Demo' is repeated for connection lookup and source-name matching instead of reusing DEMO_CONNECTION.name.
    • Fix: Reference DEMO_CONNECTION.name so the connection name is defined once.
  • packages/app/src/components/OnboardingModal.tsx:43 -- DEMO_CONNECTION and LEGACY_DEMO_CONNECTION are structurally typed, so a typo'd key is not caught at the definition site.
    • Fix: Add satisfies Omit<Connection, 'id'> / satisfies Pick<Connection, 'host' | 'username'> to the constants.
  • packages/app/src/components/OnboardingModal.tsx:874 -- (pre-existing) The demo button has no in-flight guard, so a rapid double-click can run two concurrent flows off the same stale cache snapshot and create duplicate Demo connections.
    • Fix: Disable the button / add a re-entrancy guard for the duration of handleDemoServerClick.
  • packages/app/src/components/OnboardingModal.tsx:655 -- (pre-existing) Demo/ClickPy sources are deleted before the connection is ensured, so a failure in the connection step leaves the user with sources removed and none recreated until retry.
    • Fix: Resolve or create the connection before deleting existing sources.

Reviewers (6): correctness, testing, maintainability, kieran-typescript, julik-frontend-races, previous-comments.

Testing gaps: The core migration path (legacy Demo connection updated in place) and the otel_v2 → otel database rename are not asserted by any test; the otel-database source arguments and the leave-unrelated-connection-alone branch are also uncovered.

No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond


const DEMO_CONNECTION = {
name: 'Demo',
host: 'https://b1g1gnrrz3.us-central1.gcp.clickhouse-staging.com:8443',

Copy link
Copy Markdown
Contributor

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.host at a production or stable public endpoint. Like the old sql-clickhouse.clickhouse.com, it should be a *.clickhouse.com host, 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

const mockConnectionsResult = {
data: [{ id: 'conn-1', name: 'Default', host: 'http://localhost:8123' }],
};
const mockUpdateConnectionMutation = { mutateAsync: jest.fn() };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 mockConnectionsResult with {name:'Demo', host:'https://sql-clickhouse.clickhouse.com', username:'otel_demo'}, clicks "Connect to Demo Server", and checks that mockUpdateConnectionMutation.mutateAsync received the new host while create did not run. Add a second case where a Demo connection with a non-legacy host is left alone. Also check that the sources are created with databaseName: 'otel'.

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

password: '',
};
const LEGACY_DEMO_CONNECTION = {
host: 'https://sql-clickhouse.clickhouse.com',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 otel_v2 database

Update CONTRIBUTING.md lines 124-127 (the manual full-stack demo setup) to the new host and database otel, or reference DEMO_CONNECTION. Contributors who follow it now create a connection that the onboarding code treats as legacy and rewrites.

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

@kodiakhq
kodiakhq Bot merged commit 0444e3e into main Oct 22, 2026
35 of 44 checks passed
@kodiakhq
kodiakhq Bot deleted the drew/update-demo-connection branch October 22, 2026 16:14

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — e2a56f07 Deployed Oct 22, 2026 by vercel[bot]
Preview – hyperdx-storybook — e2a56f07 Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge review/tier-2 Low risk — AI review + quick human skim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants