fix(review): hold PRs whose review cannot complete, never "safe to merge" - #2008
Merged
Conversation
… merge" When preflight cannot complete the review (the repo's review lane is unknown/inactive), the disposition previously still rendered an otherwise-ready PR as approve/merge — the preflight hold only fed the advisory readiness score, never the merge/close disposition. An incomplete review must never read as "safe to merge". Thread `preflightHeld` (preflight.status === "hold") through the comment bridge into `deriveUnifiedStatus`, which downgrades an otherwise-`ready` status to a manual-review hold. Applied last and only to a would-be-`ready` status, so it can only ever downgrade, never approve. A gate `merge` verdict carrying advisory blockers stays authoritative-ready by design — the gate already weighed those; tightening that lives in the gate's confidence/approval bars, not this renderer. Also correct the preflight-hold validation-component message to describe the real cause (review lane unavailable) rather than a nonexistent blocker. Advances #1936. Refs #2002.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2008 +/- ##
=======================================
Coverage 95.69% 95.69%
=======================================
Files 222 222
Lines 24584 24586 +2
Branches 8923 8925 +2
=======================================
+ Hits 23526 23528 +2
Misses 433 433
Partials 625 625
🚀 New features to boost your workflow:
|
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.
What
When preflight cannot complete the review (the repo's review lane is unknown/inactive, so the PR isn't eligible for a confident automated recommendation), the unified disposition previously still rendered an otherwise-ready PR as Approve/Merge. The preflight hold only fed the advisory readiness score, never the merge/close disposition — so an incomplete review could read as "safe to merge."
This threads
preflightHeld(preflight.status === "hold") through the comment bridge intoderiveUnifiedStatus, which downgrades an otherwise-readystatus to a manual-review hold.Why it's safe
readystatus, so it can only ever downgrade, never approve — a real CI / merge-state / gate block still wins.mergeverdict carrying advisory blockers stays authoritative-ready by design — the gate already weighed those. Tightening that behavior belongs in the gate's confidence/approval bars, not this renderer. (Called out inline; see fix(review): disposition recommends approve/merge while blockers are active (+ approval-bar / confidence level may be too loose) #2002 for the separate discussion.)Also corrects the preflight-hold validation-component message to describe the real cause (review lane unavailable) instead of a nonexistent "blocker."
Tests
unified-comment.test.ts— a preflight hold downgrades a gatemergeverdict toheld; a clean merge with no hold still rendersready(downgrade-only invariant); a gate merge with advisory blockers stays authoritative-ready.unified-comment-bridge.test.ts— a passing PR withpreflightHeldrenders> [!WARNING]/ Manual Review, never> [!TIP]/ Approve-Merge.signals-coverage.test.ts— updated to the corrected preflight-hold message.Full unsharded
test:coveragegreen;typecheckgreen.Advances #1936. Refs #2002.