Skip to content

Keep a dismissed alert dismissed when its branch head is replaced - #1531

Draft
epompeii wants to merge 1 commit into
develfrom
u/ep/changepoint/alert-fix
Draft

epompeii wants to merge 1 commit into
develfrom
u/ep/changepoint/alert-fix

Conversation

@epompeii

Copy link
Copy Markdown
Member

When a branch head is replaced (a reset or a new start point), the old head's alerts are silenced. Until now that rewrote every alert on the head: a dismissed alert became silenced and lost its modified, so the record of what a user dismissed, and when, was gone.

QueryAlert::silence_all now silences only active alerts. A dismissed or already silenced alert keeps its status and its modified. The update reaches the head through alert.report_id and report.head_id, served by the existing index_alert_report and index_report_head, instead of joining through boundary, metric, and report benchmark.

Tests

  • silence_all_silences_only_active_alerts_for_head replaces the test that pinned the old behavior: one active, one dismissed, and one silenced alert on a head, and only the active one changes.
  • for_branch_silences_only_active_old_head_alerts runs the real head replacement (insert_for_branch) instead of a copy of the old query.
  • alerts_a_head_reset_silences_only_active_alerts resets a branch through the API. No existing API test had alerts on a replaced head, so it is a new test beside the other alert tests.
  • silence_all_ignores_other_heads and silence_all_empty_returns_zero now call the real function.

Each new test failed on the old code before the fix.

Changelog

A dismissed Alert stays dismissed when its Branch head is replaced.

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectBencher
Branchu/ep/changepoint/alert-fix
Testbedintel-v1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
Adapter::Json📈 view plot
🚷 view threshold
5.39 µs
(+3.66%)Baseline: 5.20 µs
5.47 µs
(98.45%)
Adapter::Magic (JSON)📈 view plot
🚷 view threshold
5.21 µs
(+3.61%)Baseline: 5.03 µs
5.29 µs
(98.58%)
Adapter::Magic (Rust)📈 view plot
🚷 view threshold
26.66 µs
(-0.70%)Baseline: 26.85 µs
28.64 µs
(93.07%)
Adapter::Rust📈 view plot
🚷 view threshold
4.58 µs
(+2.50%)Baseline: 4.47 µs
4.67 µs
(98.08%)
Adapter::RustBench📈 view plot
🚷 view threshold
4.53 µs
(+1.57%)Baseline: 4.46 µs
4.67 µs
(97.02%)
🐰 View full continuous benchmarking report in Bencher

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant