Skip to content

refactor(#447): move shop-charts.json/ontime-charts.json to Dashboard v2 - #507

Merged
BorisTyshkevich merged 2 commits into
mainfrom
examples/dashboard-variable-migration
Jul 27, 2026
Merged

refactor(#447): move shop-charts.json/ontime-charts.json to Dashboard v2#507
BorisTyshkevich merged 2 commits into
mainfrom
examples/dashboard-variable-migration

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

Summary

  • shop-charts.json and ontime-charts.json move to portable-bundle v2 / Dashboard document v2, dropping their curated filters arrays in favor of inferred Variables — completing the "phase 3" example rewrite spec-examples.test.js had been pinning them against, following clickhouse-operations.json's earlier move (feat(#447): inferred Dashboard Variables, replacing the curated filter model (phase 1) #458 follow-up).
  • Audited every from/to/country/category/carrier/origin filter's targets list against the {name:Type} placeholders actually present in each tile's SQL: they already matched exactly, so this is a mechanical model migration with no change to which variables apply to which tiles.
  • Fixed a latent bug in build-ontime-charts.mjs: it wasn't threading version through to writeExampleBundle, so regenerating the file would have silently reverted it to v1.
  • Updated examples/mjs/normalize-examples.mjs, examples/mjs/README.md, and tests/unit/spec-examples.test.js to reflect the new pinned versions.

Test plan

  • node examples/mjs/normalize-examples.mjs --check
  • npx tsc --noEmit
  • node build/compile-json-schemas.mjs --check
  • node build/check-boundaries.mjs
  • TZ=America/New_York npx vitest run --config tests/vitest.config.ts (5935/5935 passing)

🤖 Generated with Claude Code

https://claude.ai/code/session_011sMwR4BHM85MExSBYXzTYj

BorisTyshkevich and others added 2 commits July 27, 2026 17:20
…oard v2

Completes the phase-3 example rewrite spec-examples.test.js's pinned-version
test had been waiting on: shop-charts.json and ontime-charts.json move to
portable-bundle v2 / Dashboard document v2, dropping their curated `filters`
arrays in favor of inferred Variables, matching clickhouse-operations.json's
earlier migration (#458 follow-up).

Audited every from/to/country/category/carrier/origin filter's `targets`
list against the {name:Type} placeholders actually present in each tile's
SQL: they already matched exactly, so removing the curated model changes no
runtime variable-to-query assignment. build-ontime-charts.mjs now threads its
bundle's own `version` through to writeExampleBundle instead of silently
reverting to v1 on regeneration.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011sMwR4BHM85MExSBYXzTYj
…riables

The v2 migration left every Array/enum-shaped variable (country/category,
carrier/origin, user/query_kind/exception_code/query_hash/metric/
is_initial_query) as bare freeform-text input, with no configured
variableConfigs. This wasn't new breakage from the v2 move itself: #447's
mechanical minimum pass had already dropped every curated filter's
sourceQueryId, and the pre-#447 option-source queries (shop-filter-options,
ontime-filter-options, gco-filter) returned one row of ARRAY-typed columns
-- a shape the v2 option-SQL contract (one row per option, two String
columns: value, then label) can't reuse directly.

Port each old option-source query into its own variableConfigs[name].sql
under the new contract, restoring the searchable (multi-)select these
variables used to have before #447.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011sMwR4BHM85MExSBYXzTYj
@BorisTyshkevich

Copy link
Copy Markdown
Collaborator Author

Added a follow-up commit: the v2 migration left every Array/enum-shaped variable (country/category, carrier/origin, user/query_kind/exception_code/query_hash/metric/is_initial_query) on bare freeform-text input, with no variableConfigs. Traced back through git history to the pre-#447 curated-filter option-source queries (shop-filter-options, ontime-filter-options, gco-filter) and ported each into its own variableConfigs[name].sql under the new two-String-column (value, then label) contract — restoring the searchable (multi-)select these variables had before #447.

Verified the full compiled option batch (compileVariableOptionBatch) builds cleanly for all three dashboards, and every new option SQL passes optionSqlDiagnostics locally. Not run against a live ClickHouse server (sandboxed environment has no reachable cluster) — worth a manual smoke test against system.query_log before merge, since the clickhouse-operations.json queries in particular depend on real server activity/log retention.

@BorisTyshkevich
BorisTyshkevich merged commit 2646292 into main Jul 27, 2026
7 checks passed
@BorisTyshkevich
BorisTyshkevich deleted the examples/dashboard-variable-migration branch August 6, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant