GH-5266: fix(autopilot): review-merge hold is blind after re-adoption and cleared by COMMENTED reviews — harden the CHANGES_REQUESTED backstop - #5269
Merged
Conversation
…on and COMMENTED reviews (GH-5266) hasChangesRequested filtered reviews against prState.CreatedAt, which both OnPRCreated (fresh registration) and the reconciler's orphan-PR sweep (re-adoption after a restart) stamp to time.Now() — so a standing CHANGES_REQUESTED review submitted before a restart looked "older than tracking" and the hold silently vanished on re-adoption, letting the PR auto-merge over the reviewer's objection (#5263's race scenario). The per-user latest-review map also let a later COMMENTED review from the same reviewer overwrite and clear a standing CHANGES_REQUESTED, which GitHub's own review model does not do. Anchor the review-hold cutoff on the PR's own GitHub creation time (ghPR.CreatedAt, already fetched by both call sites) instead of prState.CreatedAt, falling back to prState.CreatedAt only when ghPR is unavailable. Only APPROVED or an explicit DISMISSED may now supersede a recorded CHANGES_REQUESTED in the per-user map; COMMENTED no longer clears it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Collaborator
Author
Post-merge review — APPROVE (w-notes)Verified against merged main (
Notes (no action required):
|
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
Automated PR created by Pilot for task GH-5266.
Closes #5266
Changes
GitHub Issue GH-5266: fix(autopilot): review-merge hold is blind after re-adoption and cleared by COMMENTED reviews — harden the CHANGES_REQUESTED backstop
Problem
Follow-up from the PR#5264 post-merge review (notes N1/N2 — both pre-existing in the reused hasChangesRequested logic in internal/autopilot/controller.go, now load-bearing for the merge hold):
Fix shape
Acceptance
Refs