Allow closing access reviews when a connector fetch fails - #1568
Draft
gearnode wants to merge 1 commit into
Draft
Conversation
Pending decisions on sources whose latest fetch failed no longer block closeAccessReviewCampaign, matching the rule that reviewers finish reachable sources and acknowledge failed connectors in the UI. The source-fetch worker now finalizes the campaign lifecycle after every failed attempt and waits until each campaign source has a latest fetch attempt before moving to pending actions. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes ENG-661: reviewers could finish every reachable account decision but still could not complete a campaign when one connector/source fetch failed.
CloseCampaignignores pending decisions on campaign sources whose latest fetch attempt isFAILED, so a broken connector no longer blocks closure after successful sources are reviewed.FetchSourceerrors), and a campaign moves toPENDING_ACTIONSonly when each campaign source has a latest fetch attempt and all of those are terminal.PENDING_ACTIONSso pending counts stay in sync after decisions.Test plan
go test ./pkg/accessreview/...(integration testTestCloseCampaign_IgnoresPendingOnFailedSourceFetchwhen Postgres is available)Linear Issue: ENG-661
Summary by cubic
Allows closing access review campaigns even if a connector fetch failed, by ignoring pending decisions on those failed sources. Addresses ENG-661 so API, worker, and console use the same rule.
Service
+161-22CloseCampaignsubtracts pending entries from sources whose latest fetch isFAILED(viacountPendingEntriesBlockingClose).PENDING_ACTIONSonly when every source has a latest attempt.failAttemptAndFinalizeCampaignandloadCampaignIDForCampaignSourceto handle failures more reliably.App: console
+51-3countPendingEntriesBlockingCloseto mirror backend logic for pending counts.CampaignDetailPageenables Complete only when blocking pending count is zero and auto-refreshes whilePENDING_ACTIONS.Tests
+259-0TestCloseCampaign_IgnoresPendingOnFailedSourceFetchto verify pending entries on failed sources do not block close.Written for commit e4b877b. Summary will update on new commits.