Block review requests on merged/closed PRs (Fix #599) #607
No reviewers
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub!607
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-599"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Reviewer requests (POST/DELETE review-requests) plus the PR-page picker stayed live on merged/closed PRs. This change gates both ends on open-PR state.
Server (
internal/review/threads.go)AddRequests/RemoveRequestsrefuse422 ErrUnprocessable(review requests are only accepted on open pull requests) whenthreadLocked(h, side)on the already-loadedprHeadOfheader + sidecar — zero new store reads (law 6), placed before summary refresh + notify emit. GET/suggest stay allowed.Client (
Pull.jsx+pull-state.js)reviewRequestsEditable(canEdit, thread, pr)(role first, then the #594 live lock — reopen restores with no reload).ReviewersPanel: picker<Show>readseditable(); chips<ul>moved outside the gate, × follows the same gate (terminal PRs read read-only).Spec (law 12, same commit)
docs/features/04_code_review.md: §5 lifecycle rule (addition, not amendment), §7 table 422 notes, Decisions entry.docs/go/12_web_ui.md: Decisions entry.Verification
go test ./internal/review/... -race: pass (newrequests599_test.go: open vs closed vs merged incl. self-removal + GET-allowed + reopen; open-path wire-shape + notify-class pins).go vetclean.review-requests-599.test.js, 4 tests).vite buildgreen, esbuild SDK bundle green,web/dist/.keeprestored.Server: AddRequests/RemoveRequests refuse 422 ErrUnprocessable ('review requests are only accepted on open pull requests') on closed/merged PRs, gated on the prHeadOf-loaded header+sidecar via threadLocked — zero new store reads, before summary refresh + notify emit; GET/suggest stay allowed. Self-removal blocked uniformly (named decision: terminal request list is frozen curation). Client: ReviewersPanel picker gated by headless reviewRequestsEditable(role + live thread/pr lock); chips stay read-only. Docs: 04 §5/§7 + Decisions, 12_web_ui Decisions.APPROVED — independent review of fix/issue-599 (
0679f4d) vs #599.Verified in /tmp/walhub-599:
moved outside picker (Pull.jsx:284), × follows editable() (:289) — terminal PRs read read-only, request list stays visible.- Open-PR pins: wire shape (Principal/By/At) + notify classes review_requested/review_request_removed asserted; no wire/notify change.
- Docs (law 12): features/04 §5 lifecycle rule (addition, noted as such) + §7 table 422 notes + Decisions entry; go/12_web_ui Decisions entry. No contradiction of stated rules.
- Coverage: go test ./internal/review/ -cover = 96.0% (≥95%). -race pass. web: 4/4 new + 1538/1538 full-minus-smoke pass. gofmt/vet clean (Go files).
- Pre-fix check: new tests fail on origin/main threads.go (closed add + merged add: want 422, got nil) — true regression tests.
- No new deps: diff touches 8 files only; no go.mod/package.json/pnpm changes.
One non-blocking nit: merged-PR picker fallback reuses the #594 reason ('Merged — commenting is locked') for a reviewer picker — slightly off-noun but consistent shared lock language; left as-is, no churn.
No fix commits — worktree clean. Verdict: APPROVED.