Skip to content

fix(review-checklist): re-request dismissed reviewer on fixup push#6479

Merged
brtnfld merged 5 commits into
HDFGroup:developfrom
brtnfld:review-checklist-requeue-dismissed
Jun 23, 2026
Merged

fix(review-checklist): re-request dismissed reviewer on fixup push#6479
brtnfld merged 5 commits into
HDFGroup:developfrom
brtnfld:review-checklist-requeue-dismissed

Conversation

@brtnfld

@brtnfld brtnfld commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

When a PR author pushes a fixup commit, GitHub dismisses existing approvals and its CODEOWNERS engine auto-assigns a fresh (possibly different) owner for the changed area. The synchronize event handler previously treated the fresh CODEOWNERS pick as the authoritative assignment and did nothing — leaving the dismissed reviewer (who already has context) off the PR.

  • Adds planSynchronizeSwaps() — a pure helper that identifies dismissed area-owners who should be re-requested and the fresh CODEOWNERS pick to remove in their place
  • On synchronize, the handler now removes the fresh pick and re-requests the dismissed reviewer
  • If GitHub didn't auto-assign anyone new, the dismissed reviewer is still re-requested
  • Explicitly excluded reviewers (via review_request_removed) are never re-requested
  • 7 new unit tests including the exact PR Add flag -tp=x86-64-v3 to CMAKE C, Fortran, and CXX flags to avoid crashing … #6475 scenario (Jordan reviewed, Larry pushed a fixup, Joe was incorrectly assigned instead of Jordan being re-requested)

When a new commit dismisses a prior reviewer's approval, GitHub's
CODEOWNERS engine auto-assigns a fresh (possibly different) owner for
the changed area. The synchronize handler now detects dismissed
area-owners and swaps them back in, removing the fresh CODEOWNERS pick.

Adds planSynchronizeSwaps() pure helper (exported) with 7 unit tests
covering the PR 6475 scenario and edge cases.
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Checklist

This PR touches the following areas. Each needs a sign-off
from its listed owners before merging.

✅ All areas have been signed off.

brtnfld and others added 4 commits June 22, 2026 14:28
…her area

planSynchronizeSwaps could remove a fresh CODEOWNERS pick to restore a
dismissed reviewer even when that pick also covered a different,
unrelated touched area — removeRequestedReviewers strips them from the
whole PR, silently uncovering the other area. Now skips removal when
the candidate owns any other touched area.

Also dedupes the consuming loop so a login needed by two areas isn't
requested/removed twice.

5 new tests covering the cross-area guard and its boundaries.
…sticky exclusion

The bot's own removeUnselected/removeRequestedReviewers calls (draft-opened
CODEOWNERS cleanup, stale-exclusion enforcement) fire review_request_removed,
which the workflow also listens on — self-triggering another run. That run
previously read its own bookkeeping removal as a deliberate human decision
and added the login to the persisted exclusion set, permanently blocking
that owner from ever being auto-assigned to the PR again. Guard on
sender.type !== 'Bot' so only human-driven removals become sticky.
… event wins the race

GitHub's CODEOWNERS engine fires one review_requested event per auto-assigned
owner on PR creation, and each re-triggers this workflow. With concurrency:
cancel-in-progress, whichever run starts last wins — and that's just as
likely to be one of those review_requested runs as the opened run itself.
A surviving review_requested run fell through to the additive-fill branch,
saw every area already "covered" by the avalanche, and pruned nothing.
This hit PR HDFGroup#6479 itself: all 4 CODEOWNERS for .github/ stayed requested.

Branch on whether a checklist comment exists yet instead of which action
survived — that signal is race-resistant: no comment means this is the PR's
first coordination pass no matter which event got here. Threads
hasExistingComment through from run() (defaulting to true, i.e. additive-fill,
on a comment-fetch failure so an API hiccup can't be mistaken for a fresh PR).

2 new tests: the HDFGroup#6479 race itself, and a contrast case confirming a routine
review_requested on an already-established PR still uses additive-fill.
@brtnfld brtnfld merged commit 0f1dfcc into HDFGroup:develop Jun 23, 2026
134 checks passed
@github-project-automation github-project-automation Bot moved this from To be triaged to Done in HDF5 - TRIAGE & TRACK Jun 23, 2026
@brtnfld brtnfld deleted the review-checklist-requeue-dismissed branch June 23, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants