fix(review): headline a held PR as held, not Closed, when the disposition won't close it - #1412
Merged
Merged
Conversation
…tion won't close it The unified comment derived its headline from the gate verdict, so a 'close' verdict always rendered 'Closed' — even when the disposition would NOT close the PR. Two cases mislabel: an owner / automation-bot PR (never auto-closed) and a guarded-path PR (held for owner review unless a red required check forces the close). The comment said 'Closed' while the action was a hold. Thread the disposition's held-vs-closed reality into deriveUnifiedStatus: - neverClosed (author is repo owner or a protected automation bot) → a close verdict renders 'held'. - a guarded-path close (heldForReview) renders 'held' unless CI is failing — ciState 'failed' mirrors the planner's redVerifiedRequiredCi, which is the only thing that closes a guarded PR. A genuine contributor close (red required CI, or a non-guarded block) still headlines 'Closed'. Action-only change; the disposition was already correct.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (71.42%) is below the target coverage (97.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1412 +/- ##
==========================================
- Coverage 95.36% 95.35% -0.01%
==========================================
Files 192 192
Lines 20779 20786 +7
Branches 7512 7519 +7
==========================================
+ Hits 19816 19821 +5
Misses 383 383
- Partials 580 582 +2
🚀 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.
Summary
The unified PR comment derived its headline from the gate verdict, so a
closeverdict always rendered "Closed" — even when the disposition would NOT actually close the PR. Two cases mislabel the action (audit #8/#9, the #4220 comment↔action class):The fix threads the disposition's held-vs-closed reality into
deriveUnifiedStatus:neverClosed(author is the repo owner or a protected automation bot) → a close verdict renders held.heldForReview) renders held unlessciState === "failed"— which mirrors the planner'sredVerifiedRequiredCi(agent-actions.ts:316), the only thing that closes a guarded PR.The disposition was already correct (it never closes these); only the comment text was wrong. This is the piece deferred from #1374, now done with the author + guard nuance modeled so a red-CI guardrail PR that does close is not mislabeled.
No GitHub issue — internal review-subsystem audit finding (#8/#9).
Scope
src/) only —unified-comment.ts,unified-comment-bridge.ts,processors.tswrangler.jsonc, or UI changeValidation
npm run test:ci— green (4470 passed | 4 skipped)npm run test:coverage— every changed line and branch covered (verified againstcoverage/lcov.info)npm audit --audit-level=moderate— 0 vulnerabilities;typecheck/ui:typecheckclean;git diff --checkcleanderiveUnifiedStatus(owner/bot → held incl. red CI; guarded close → held unless red CI; genuine contributor close → Closed) and a bridge test that a gate-failure PR renders held underneverClosed. Corrected the prior test that asserted the old (buggy) "guarded close stays blocked".Safety