Skip to content

[MEDIUM] Guard review dismissal against already-dismissed reviews #38

Description

@don-petry

Context

From health check report #33 — Recommendation #5.

Problem

The mark_prior_agent_items_obsolete function in post-pr-review.sh attempts to dismiss reviews that may already be in a non-dismissable state (already dismissed, merged PR, etc.), producing 422 errors and ::warning:: annotations about stacking duplicates.

The jq filter already excludes DISMISSED reviews, but the 422 can still occur if the review state changes between enumeration and dismissal (race condition), or if the review is in a state like PENDING that slipped through.

Proposed Fix

Before calling the dismiss API, verify the review's current state with a single GET call. If the review is already dismissed or in a terminal state, skip it silently. This eliminates the noisy warnings and prevents stale duplicate reviews from accumulating.

Expected Impact

Eliminates noisy 422 warnings in logs and prevents stacked duplicate reviews that confuse PR authors.

Urgency

MEDIUM — the 422 will recur on any PR that gets reviewed twice in short succession.

Metadata

Metadata

Assignees

No one assigned

    Labels

    health-checkAutomated health check report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions