← Back to Pull requests

fix(secret-approvals): recompute bulk review conflicts on retry #8881

Open
unknown opened this pull request with 237 lines diff across 2 files
View on GitHub
unknown unknown commented on Oct 24, 2026 12:46 UTC
Author

Context

Fixes #8879 (follow-up to #8657).

In BulkReviewChangeRequestsSheet.tsx, conflictsById previously depended on [requests, isLoadingDetails] where isLoadingDetails only checked isPending. When one of the selected change request detail queries failed initially (isPending: false, isError: true) and was retried via detailQuery.refetch(), TanStack Query v5 kept isPending: false during and after the retry, so conflictsById never recomputed once the retry succeeded. Memoizing detailsById on [requests, detailQueries] and depending on [requests, detailsById] keeps conflictsById in sync whenever query data resolves.

Also clears failedRequestErrors for unselected page rows in togglePageSelection (SecretApprovalRequest.tsx) to match toggleRequestSelection and clearSelection.

Steps to verify the change

1. Select two open change requests that modify the same secret key in the same environment/folder and open Review & Merge.
2. Retry a failed detail query and verify the Overlaps on <secret> conflict badge updates once the detail query resolves.
3. Deselect the page via the header checkbox after a bulk action error and verify failedRequestErrors is cleared for those rows.

Type

  • Fix

  • Feature

  • Improvement

  • Breaking

  • Docs

  • Chore
  • Checklist

  • Title follows the conventional commit format: type(scope): short description (scope is optional, e.g., fix: prevent crash on sync or fix(api): handle null response).

  • Tested locally

  • Updated docs (if needed)

  • Updated AGENTS.md files (if needed)

  • Read the contributing guide
  • <img width="960" height="460" alt="Image" src="https://github.com/user-attachments/assets/44605434-7d90-4663-9d9a-66a9a2c3b9ba" />

    Diff: 237 lines (+177 / -60) across 2 files Reviewer: shafiktanbir Review duration: 54027m
    All Vouch review confidence checks passed
    Residual risk 0.39 = Change Risk (0.67) × (1 − Review Confidence (0.42)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.67 · 237 lines diff across 2 files
    0.67
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.327
    Sensitive Paths sensitive_paths
    0.067
    Real PR Conversation Timeline
    1 comments
    "Review active on #8881"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 42.2% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 67.4% (HIGH) · Higher = larger blast radius
    67.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 42.2% · Lower = rushed or shallow review
    42.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 38.9% · Moderate risk
    38.9%