Repository navigation
fix(alerts): explain raw-SQL sample counts and warn when they count rows - #1205
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Oct 2, 2026 in 9m 18s
Confidence 5/5 · No issues found
🟢 Confidence 5/5 · safe to merge
rawAlertSqlSelectsSamples now matches the engine's exact samples key, and the two new test files exercise both warning states.
quality 100/100 · no findings · tests covered · risk low
Documents what minimum_sample_count counts for raw-SQL rules and adds rawAlertSampleCountWarning, surfaced in the alert editor and as warnings/notices on create, update and get. No evaluation behavior changes; safe to merge.
rawAlertSampleCountWarningflags a raw-SQL rule whose minimum exceeds 1 with nosamplescolumnruleConfigWarningsfeedswarningson create/update outputs andnoticesinrenderRuleWrite- Editor shows the warning and a raw-SQL
samples/no-rows hint create_alert_ruleparameter descriptions now state the real defaults (2/2/30)
Fixed since the last review
- ✅
F1 ·rawAlertSqlSelectsSamplesacceptsSamples, which the engine never reads
What was checked
- F1: alias match is case-sensitive and rejects
Samples(raw-sql.ts:296), matchingRawSqlAlertRowSchema's exactsampleskey inquery-engine.ts - Masked text is used only to locate
AS, the alias is read from the original at the same offset (raw-sql.ts:294), so comments and string literals are ignored - New parameter/schema defaults (2, 2, 30) match
packages/db/src/schema/alerts.ts
ff972f2 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading