Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 1017e51 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
E2E Test Results✅ All tests passed • 467 passed • 1 skipped • 1036s
Tests ran across 4 shards in parallel. |
Duplicate code analysis4 new clones introduced by this PR.
If one of these duplicates a helper that already exists, import it instead jscpd compared this branch against |
e3a8941 to
99b9fdd
Compare
e1f30a7 to
dc3094d
Compare
99b9fdd to
b3c9d46
Compare
dc3094d to
99f91cc
Compare
b3c9d46 to
2d42ba3
Compare
99f91cc to
ca49e2c
Compare
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
PR Review
5 finding(s): 🔴 0 critical · 🟠 1 major · 🔵 4 minor 5 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. |
Deep ReviewScope: PR #3654 — data source / connection-type dashboard variables ( ✅ No critical issues found. The change is well-structured and well-tested: reference resolution is centralized in 🟡 P2 -- recommended
🔵 P3 nitpicks (1)
Reviewers (2 returned + orchestrator analysis): previous-comments, learnings-researcher. The correctness, adversarial, kieran-typescript, testing, maintainability, api-contract, project-standards, and agent-native reviewers were dispatched but did not return results before synthesis was finalized; the findings above come from an independent full read of the diff plus the two completed reviewers. Treat correctness/adversarial coverage as partial. Testing gaps:
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 |
2d42ba3 to
8d348eb
Compare
ca49e2c to
696e73e
Compare
696e73e to
3569649
Compare
55a0535 to
e0ba99b
Compare
6bc2461 to
a795499
Compare
a795499 to
48f2179
Compare
48f2179 to
335259d
Compare
| : []), | ||
| ]; | ||
| return ( | ||
| <DashboardFilterSelect |
There was a problem hiding this comment.
🟠 major — CONNECTION filters fall through to an empty value dropdown, so a data source variable scoped to $conn never offers any source
Add a connection picker branch next to the isDataSourceFilter one (for example a ConnectionDashboardFilter built on ReferenceVariableSelect). As written, a CONNECTION filter skips the DATA_SOURCE and ADHOC branches and reaches DashboardFilterSelect. useDashboardFilterValues only fetches query-expression, static, and PromQL filters (hooks/useDashboardFilterValues.tsx:45-47), so that dropdown never gets options. The connection variable can then never be selected. Any DATA_SOURCE filter with connection: '$conn', which this PR resolves in useDashboardFilters, stays empty, and every tile that uses it stays blocked. The PR says these filters can be created through MCP, the API, or import. If the picker is planned for a later PR, hide or flag CONNECTION filters until then.
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
|
|
||
| // Reference variables are always single-select and required, so only the | ||
| // global requirement checkbox is consulted | ||
| if (isReferenceVariableFilterType(values.type)) { |
There was a problem hiding this comment.
🔵 minor — The new CONNECTION save path can't be reached from the edit form
In DashboardFilterEditForm.tsx, add a formFilterType === 'CONNECTION' branch (it only needs the variable name input) and a CONNECTION entry in the type picker. Today a CONNECTION filter opened for editing falls to the default QueryExpressionFilterEditForm branch. That form's source and expression fields have rules={{ required: true }} (QueryExpressionFilterEditForm.tsx:134,187), so submitting is blocked before toSavedFilter runs. The type picker also shows a blank value because FILTER_TYPE_OPTIONS has no CONNECTION entry. The new CONNECTION branch in toSavedFilter and its unit test never run in the real UI.
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
| }, | ||
| ] | ||
| : []), | ||
| { value: DashboardFilterType.enum.DATA_SOURCE, label: 'Data source' }, |
There was a problem hiding this comment.
🔵 minor — 'Data source' filter type is offered unconditionally, but nothing in the UI can consume it yet
Put the DATA_SOURCE option behind a flag, the way IS_PROMQL_ENABLED and IS_ADHOC_FILTERS_ENABLED gate the options above it, until tiles and filters can reference it from the UI. The PR description says the variable can't be referenced from the UI yet. Users can still create one: an always-required picker that shows a 'required' warning in the filter bar. If they check 'Block every tile', it blocks every tile on the dashboard even though no tile can use it.
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
| value: string | undefined, | ||
| sourceKindMap: ReadonlyMap<string, SourceKind>, | ||
| ): React.ReactNode { | ||
| if (parseVariableReference(value) != null) return VARIABLE_ICON; |
There was a problem hiding this comment.
🔵 minor — getSourceOptionIcon's variable-reference branch can never run
Drop the parseVariableReference/VARIABLE_ICON branch, or add it in the PR that introduces a caller passing $name values. The only caller is ReferenceVariableDashboardFilter.tsx:150, and the values it passes are always concrete source IDs from the filter bar options or the validated selection. A reference like $logs can never reach it.
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
| source.connection !== chart.config.connection; | ||
| // A variable's kinds can change after tiles use it, and saves don't check a | ||
| // source's kind against the tile's display type. | ||
| const isSourceKindUnsupported = |
There was a problem hiding this comment.
🔵 minor — New tile resolution and placeholder logic has no tests
Add a component or E2E test where a tile's stored source is $var. It should cover: (a) the tile is blocked while the variable is unselected; (b) it queries the selected source once one is chosen; (c) tile-unsupported-source-kind shows for a source kind the chart type can't use; (d) the different-connection placeholder shows for raw SQL. Also check that onUpdateChart (for example a display-type switch) saves $var back, not the resolved ID. The new E2E spec only covers a fixed-source tile blocked by a global requirement. Nothing would catch restoreConfigReferences being dropped from onUpdateChart, which would silently overwrite the variable reference with a concrete source ID.
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
Summary
PR 3/5 adding data source and data connection type variables. This PR adds the UI for defining and rendering a source variable / filter. The dashboard page substitutes source variables for source IDs when rendering the dashboard, and shows placeholder / error states for invalid or missing source variables.
The variable cannot yet be referenced by a tile or another filter via the UI but can via MCP, API, or Import.
Source and connection variables allow for dashboards variable inputs that define a source or connection queried by a tile or other filters. Selected values are stored in source or connection id slots in the saved chart config, in the
$varNameformat, then converted to source or connection IDs at runtime when there is a selection.Variables are substituted prior to rendering the dashboard, at the top level, so that components and configs down the stack can just use source and connection IDs like they have been.
Direct
$sourcereferences are not yet allowed in SQL tiles - the source is selected at the chart level and $__sourceTable can be used to reference it. Connection variables are mostly only useful for (a) raw sql tiles and (b) source variables that can be scoped to a single connection, dynamically.Screenshots or video
How to test on Vercel preview
The E2E feature can be tested on PR 5: #3656
References