Repository navigation
fix: don't insert skipped test/model results into alerts_v2 when disable_skipped_*_alerts is on - #2399
fix: don't insert skipped test/model results into alerts_v2 when disable_skipped_*_alerts is on#2399masukai wants to merge 1 commit into
Conversation
…ble_skipped_*_alerts is on edr monitor inserts every test result that is not pass/reused and every model result that is not success/reused into alerts_v2, so skipped results are inserted. The default status filter of edr monitor then drops them before sending, and dropped alerts are not marked skipped either, so they stay pending forever. Honor the existing disable_skipped_test_alerts / disable_skipped_model_alerts vars (true by default) when populating alerts_v2, the same way elementary-data#2363 handles reused.
|
👋 @masukai |
|
I found a problem with this PR after opening it, so I'm marking it as a draft. The docs (Filter alerts) say that skipped alerts are filtered out by default and that you receive them with I checked this with the repro from #2385 (a skipped test and a skipped model), running
So this is a regression for that documented usage, unlike I also want to correct what I wrote in #2385: marking alerts removed by the status filter as A direction that might work: let the status filter of the current run decide which statuses are inserted when populating |
Summary
Fixes #2385.
edr monitorpopulatesalerts_v2with every test result that is notpass/reusedand every model result that is notsuccess/reused, soskippedresults are inserted. Its default status filter (fail/error/runtime error/warn) then drops them before sending, and dropped alerts are not markedskippedeither, so these rows staypendingforever.This change follows #2363 (which did the same for
reused): when populatingalerts_v2,skippedresults are left out if the existing dbt package varsdisable_skipped_test_alerts/disable_skipped_model_alertsare on. Both aretrueby default, and the macros read them withelementary.get_config_var, like the package does. Setting a var tofalsekeeps the previous behavior for that kind of result (the row is inserted; with the default filter it will still staypending, since nothing sends or marks it).In #2385 I described two possible directions. I went with the smaller one here since it matches #2363 and the existing vars. If you would rather mark alerts removed by the status filter as
skipped(the other option in the issue), I'm happy to rework this.Rows that are already
pendingin existing installations are not touched.Validation
The repro from #2385 (DuckDB, edr 0.26.1 installed from this branch, dbt-core 1.10.23, a local stand-in for the Slack webhook), with one failing model, a test and a model skipped because of it, and a control test that fails:
alerts_v2rowserror-> sent, testfail-> sent, skipped test -> pendingerror-> sent, testfail-> sent (no skipped row)disable_skipped_*_alerts: falsependingThere are no existing tests for the population macros (#2363 had none either), so I did not add one; I can add a test if you tell me where you would like it.
Summary by CodeRabbit