feat: Expand variables as empty in alert queries - #2910
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Greptile SummaryThe PR makes dashboard-tile alerts evaluate variables using empty selections and aligns alert previews and editor messaging with that behavior.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/api/src/tasks/checkAlerts/index.ts | Adds empty dashboard-variable declarations to raw-SQL and builder tile alert configurations. |
| packages/app/src/components/alerts/AlertDetailChart.tsx | Aligns tile-alert previews with scheduled execution by supplying empty variable selections. |
| packages/app/src/components/DBEditTimeChartForm/EditTimeChartForm.tsx | Computes variable-reference warnings from the debounced editor configuration while an alert is configured. |
| packages/common-utils/src/filters.ts | Centralizes ordered, deduplicated extraction of variable declarations from dashboard filters. |
| packages/common-utils/src/variables.ts | Adds shared warning text identifying variables referenced by an alerting tile. |
| scripts/ci/ratchet-baseline.json | Updates suppression-count baselines to match the repository state. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
DashboardFilters[Dashboard variable declarations] --> EmptyVariables[Attach empty selections]
EmptyVariables --> AlertTask[Scheduled alert execution]
EmptyVariables --> AlertPreview[Alert detail preview]
EmptyVariables --> EditorPreview[Chart editor preview]
AlertTask --> QueryRenderer[Shared variable substitution]
AlertPreview --> QueryRenderer
EditorPreview --> QueryRenderer
QueryRenderer --> ClickHouse[(ClickHouse)]
EditorPreview --> Warning[Empty-state warning]
Reviews (3): Last reviewed commit: "chore: Update rachet" | Re-trigger Greptile
E2E Test Results✅ All tests passed • 296 passed • 1 skipped • 1106s
Tests ran across 4 shards in parallel. |
f89980d to
c0e271a
Compare
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Additional context: touches background tasks or the delivery pipeline lightly (11 lines, under the 30-line bar for Tier 4) Review process: Full human review — logic, architecture, edge cases. Stats
|
Deep ReviewScope: 15 files vs base ✅ No critical (P0/P1) issues found. The alert-execution path is well-contained: 🟡 P2 — recommended
🔵 P3 nitpicks (8)
Reviewers (6): correctness, adversarial, reliability, testing, maintainability, kieran-typescript. Testing gaps:
|
Summary
This PR extends the dashboard variable functionality to support substitution in alerts.
Screenshots or video
Empty variable state in alert previews
Empty states substituted in execution
Warning
How to test locally
NEXT_PUBLIC_ENABLE_DASHBOARD_VARIABLES=trueReferences