Make @hyperdx/common-utils forward-compatible with @clickhouse/client 1.23#2500
Make @hyperdx/common-utils forward-compatible with @clickhouse/client 1.23#2500Copilot wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 4c2c9b3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR repoints ClickHouse type imports from the deprecated
Confidence Score: 3/5Safe at the current 1.12.1 pin — no runtime behaviour changes — but the stated goal of requiring no further code changes when upgrading to 1.23 is not fully achieved for ProxyClickhouseClient in cli/client.ts. The packages/cli/src/api/client.ts — ProxyClickhouseClient.__query needs the same getClient() narrowing override and processClickhouseSettings() cast that node.ts and browser.ts received. Important Files Changed
Class Diagram%%{init: {'theme': 'neutral'}}%%
classDiagram
class BaseClickhouseClient {
+client: WebClickHouseClient | NodeClickHouseClient
+getClient() WebClickHouseClient | NodeClickHouseClient
+processClickhouseSettings() ClickHouseSettings~client-common~
+abstract __query()
}
class ClickhouseClient_node {
+getClient() NodeClickHouseClient ✅ override added
+__query() cast applied ✅
}
class ClickhouseClient_browser {
+getClient() WebClickHouseClient ✅ override added
+__query() cast applied ✅
}
class ProxyClickhouseClient {
+getClient() WebClickHouseClient | NodeClickHouseClient ❌ no override
+__query() no cast ❌
}
BaseClickhouseClient <|-- ClickhouseClient_node : node.ts
BaseClickhouseClient <|-- ClickhouseClient_browser : browser.ts
BaseClickhouseClient <|-- ProxyClickhouseClient : cli/client.ts
note for ClickhouseClient_node "Types from @clickhouse/client"
note for ClickhouseClient_browser "Types from @clickhouse/client-web"
note for ProxyClickhouseClient "Types from @clickhouse/client\nbut missing 1.23 bridge fixes"
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
classDiagram
class BaseClickhouseClient {
+client: WebClickHouseClient | NodeClickHouseClient
+getClient() WebClickHouseClient | NodeClickHouseClient
+processClickhouseSettings() ClickHouseSettings~client-common~
+abstract __query()
}
class ClickhouseClient_node {
+getClient() NodeClickHouseClient ✅ override added
+__query() cast applied ✅
}
class ClickhouseClient_browser {
+getClient() WebClickHouseClient ✅ override added
+__query() cast applied ✅
}
class ProxyClickhouseClient {
+getClient() WebClickHouseClient | NodeClickHouseClient ❌ no override
+__query() no cast ❌
}
BaseClickhouseClient <|-- ClickhouseClient_node : node.ts
BaseClickhouseClient <|-- ClickhouseClient_browser : browser.ts
BaseClickhouseClient <|-- ProxyClickhouseClient : cli/client.ts
note for ClickhouseClient_node "Types from @clickhouse/client"
note for ClickhouseClient_browser "Types from @clickhouse/client-web"
note for ProxyClickhouseClient "Types from @clickhouse/client\nbut missing 1.23 bridge fixes"
|
The coding agent session tested the changes in this PR against the 1.23 here: https://github.com/hyperdxio/hyperdx/sessions/09fe9533-5802-414b-892d-0b6f057a7c20 If that's actually the case, I'll iterate on it until the gating PR turns green. |
E2E Test Results✅ All tests passed • 217 passed • 3 skipped • 1502s
Tests ran across 4 shards in parallel. |
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Summary
Discovered in:
@clickhouse/clientpackage beta version #1553 by @peter-leonov-chIn
@clickhouse/client*1.23,@clickhouse/client-commonis deprecated:@clickhouse/client(Node) and@clickhouse/client-web(Web) no longer depend on it — each now bundles and re-exports its own copy of the shared types. This repo imported types fromclient-commonbut got its runtime from the platform packages, so under 1.23 the two same-namedClickHouseSettingsaliases become distinct nominal types (their index signature references a private-memberedSettingsMapclass), breaking thecommon-utilsdeclaration build and cascading into every downstream job.This change repoints imports so each file's ClickHouse types come from the same platform package as its runtime, making the repo compile against both the current pin and 1.23. No
@clickhouse/client*version bumps — the actual upgrade can land later with no further code changes.clickhouse/browser.ts(web runtime) →@clickhouse/client-webclickhouse/node.ts(node runtime) →@clickhouse/client__tests__/clickhouse.test.ts,metadata.int.test.ts,queryChartConfig.int.test.ts→@clickhouse/client(matches the client they instantiate; also clears theclientClickHouseSettingsprivate-property errors)packages/cli/src/api/client.ts→@clickhouse/client; dropped the now-unused@clickhouse/client-commondep from clipackage.jsonclient-common—clickhouse/index.tsandcore/metadata.ts. These are cross-platform/barrel modules, andResponseHeadersis not re-exported by the platform packages at the pinned 1.12.1, so migrating them would break the current build. This is the only remaining (justified)client-commonusage.BaseClickhouseClientfeeds one platform-neutral settings object into both aWebClickHouseClient | NodeClickHouseClientunion and both subclasses, whose settings types diverge under 1.23. Bridged with a single typedgetClient()override per subclass plus a neutral→platform cast onprocessClickhouseSettings()— type-only, following the file's existing// client library type mismatchconvention.The only lockfile delta is the cli
client-commonremoval; no version entries change.Screenshots or video
N/A — non-UI change.
How to test on Vercel preview
N/A — non-UI change.
References
@clickhouse/clientpackage beta version #1553 (experimental 1.23 bump that surfaced the failure; not landing)