Skip to content

Commit

Permalink
Fix: Close open incident when it gets marked as false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
roshan8 committed Aug 24, 2021
1 parent 416a529 commit 450f918
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions store/incident.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,15 @@ func (cs *IncidentStore) Update(incident *schema.Incident, update *schema.Incide

var err *errors.AppError

if incident.MarkFalsePositive == true && update.MarkFalsePositive == false {
if incident.MarkFalsePositive && !update.MarkFalsePositive {
err = cs.SLOConn.CutErrBudget(incident.SLOID, incident.ErrorBudgetSpent)
}

if incident.MarkFalsePositive == false && update.MarkFalsePositive == true {
if !incident.MarkFalsePositive && update.MarkFalsePositive {
// Close the open incident if it's being marked as false positive
if update.State == "open" {
update.State = "closed"
}
err = cs.SLOConn.CutErrBudget(incident.SLOID, -incident.ErrorBudgetSpent)
}

Expand Down

0 comments on commit 450f918

Please sign in to comment.