-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
The resolve on Last and First alert is relaying on the is_edge_incident_resolved().
There are 2 sub-issues.
On of them is about the compatibility with Postgres, due to the having with the max() function and the group_by.
The other is the logical behind it.
The First Resolved should evaluate the first alert received. Nevertheless, the idea here (in the code) is to select the oldest Alert, but if I've received an update to that fingerprint, the oldest and hence the First will be other...
The Last Resolved should evaluate either the last alert, in overall received, or the last alert by fingerprint. Nevertheless, here we have again a mismatch.
To finalize, the test shows this mismatch. Focusing on test_incident_resolution_on_edge test, and the (ResolveOn.LAST.value, ("fp2", "fp1")) parameters:
- FP1 Firing alert comes.
- FP2 Firing alert comes.
- FP2 Resolved alert comes.
This asserts Firing, but the Last alert is FP2.. so the incident should be resolved.