Repository navigation
feat: Block alerts on tiles whose text references a data source or connection variable - #3890
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: eacb324 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 • 490 passed • 1 skipped • 1091s
Tests ran across 4 shards in parallel. |
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
🔴 Tier 4 — CriticalTouches authentication, tenancy data models, the public API or shipped database config — or substantially changes the query rendering engine, background tasks, the OTel pipeline, image build, or release CI. Why this tier:
Additional context: touches background tasks or the delivery pipeline lightly (9 lines, under the 30-line bar for Tier 4) Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
PR Review
3 finding(s): 🔴 0 P0/P1 · 🟡 2 P2 · 🔵 1 P3 2 posted as inline comment(s) on the changed lines. 1 P3 folded at the bottom. 🔵 1 P3 — no action needed before merge
Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 365ffcd. Configure here.
Deep Review✅ No critical issues found. This PR is well-scoped and well-tested. All save paths (internal API controller, external REST v2 No P2-recommended issues surfaced. The items below are P3 observations. 🔵 P3 nitpicks (3)
Reviewers (9): correctness, testing, maintainability, project-standards, kieran-typescript, api-contract, adversarial, previous-comments, reliability Testing gaps: The filters-only 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 |
365ffcd to
728e9f9
Compare
29e854b to
1f41f3d
Compare
1f41f3d to
eacb324
Compare

Summary
Part 2 of 4. Alerts run with every variable unselected, so a tile whose text references a data source or connection variable would alert on an empty query (
FROM). This PR blocks alerts on those tiles everywhere they can be saved.Screenshots or video
Alert button is now disabled when the tile uses a source or connection variable, instead of being invisible:
APIs reject alert creation on tiles referencing data source or connection variables:
How to test on Vercel preview
Locally, test via the API:
References
Note
Medium Risk
Changes alert eligibility and cleanup across all dashboard save and alert APIs; incorrect detection could drop valid alerts or allow broken ones, but behavior is centralized in common-utils with broad integration test coverage.
Overview
Alerts run with every dashboard variable unselected, so tiles whose SQL, filters, or expressions reference a data source or connection variable would evaluate broken queries. This PR extends alert blocking beyond
source: "$var"to any text reference against variables declared on the dashboard filters.Backend:
savedChartConfigSupportsAlertsnow accepts dashboard filters and usesconfigDependsOnReferenceVariable(source/connection refs plus text refs). Create/update paths (dashboard controller, alerts API, external API v2, MCP) pass filters when deciding whether to persist alerts; standalone alert creation returns 400 with a clear message. Filters-only dashboard PATCH deletes alerts on tiles that become unsupported when a variable is added.Frontend: The chart editor keeps the alert control visible but disabled with a tooltip, drops the alert on save when blocked, and widens validation to text references (not only variable source/connection picks).
Runtime: Tile alert evaluation and alert detail previews use
getEmptyDashboardVariablesfor consistent empty-variable behavior.Reviewed by Cursor Bugbot for commit 29e854b. Bugbot is set up for automated code reviews on this repo. Configure here.