Drop FAILED status from access review campaigns
Source fetch failures stay surfaced on the source fetch (status and last error) instead of failing the entire campaign, so reviewers can proceed on the sources that succeeded. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -242,22 +242,13 @@ func (h *sourceFetchHandler) finalizeCampaignFetchLifecycle(
|
||||
return nil
|
||||
}
|
||||
|
||||
hasFailure := false
|
||||
for _, fetch := range fetches {
|
||||
if !fetch.Status.IsTerminal() {
|
||||
return nil
|
||||
}
|
||||
if fetch.Status == coredata.AccessReviewCampaignSourceFetchStatusFailed {
|
||||
hasFailure = true
|
||||
}
|
||||
}
|
||||
|
||||
if hasFailure {
|
||||
campaign.Status = coredata.AccessReviewCampaignStatusFailed
|
||||
} else {
|
||||
campaign.Status = coredata.AccessReviewCampaignStatusPendingActions
|
||||
}
|
||||
|
||||
campaign.Status = coredata.AccessReviewCampaignStatusPendingActions
|
||||
campaign.UpdatedAt = time.Now()
|
||||
return campaign.Update(ctx, tx, scope)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user