Repository navigation
Start fresh when re-adding a reviewer - #288
Conversation
Signed-off-by: Sean Prashad <13009507+seanprashad@users.noreply.github.com>
Signed-off-by: Sean Prashad <13009507+seanprashad@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Review removal leaves obsolete decision labels on surviving comments, and reviewer reassignment leaves open composers submitting to stale URLs that return 404.
2 open issues
What changed in this PR
This PR separates reviewer removal in CoPlan’s web UI from API withdrawal. Removal deletes prior review decisions so re-adding the reviewer creates a fresh Pending request, while preserving discussion comments and request/withdrawal history.
Changes:
- Add permanent removal and replacement of withdrawn requests.
- Reject stale request IDs and preserve other active reviews.
- Update agent guidance and add service, request, and browser coverage.
| File | Description |
|---|---|
spec/system/plan_reviews_spec.rb |
Covers re-addition, themes, history, and stale forms. |
spec/services/coplan/reviews/remove_spec.rb |
Tests removal, replacement, audit preservation, and concurrent retries. |
spec/requests/review_requests_spec.rb |
Checks authorization for permanent removal. |
spec/requests/api/v1/review_requests_spec.rb |
Verifies removed IDs cannot affect replacement requests. |
engine/app/views/coplan/reviews/_roster.html.erb |
Renames the action to “Remove reviewer.” |
engine/app/views/coplan/agent_instructions/guides/live.text.erb |
Documents removal events. |
engine/app/views/coplan/agent_instructions/guides/comments.text.erb |
Explains removal versus withdrawal and stale-ID handling. |
engine/app/services/coplan/reviews/request.rb |
Supports fresh replacements and identity-bound re-requests. |
engine/app/services/coplan/reviews/remove.rb |
Deletes requests and decisions while preserving request history. |
engine/app/javascript/controllers/coplan/review_tray_controller.js |
Sends removal and replacement options from web controls. |
engine/app/controllers/coplan/review_requests_controller.rb |
Routes web removal and guards updates against deleted requests. |
engine/app/controllers/coplan/api/v1/review_requests_controller.rb |
Binds updates to the original request identity. |
Review effort: Balanced
Signed-off-by: Sean Prashad <13009507+seanprashad@users.noreply.github.com>
Signed-off-by: Sean Prashad <13009507+seanprashad@users.noreply.github.com>
Signed-off-by: Sean Prashad <13009507+seanprashad@users.noreply.github.com>
Signed-off-by: Sean Prashad <13009507+seanprashad@users.noreply.github.com>
Signed-off-by: Sean Prashad <13009507+seanprashad@users.noreply.github.com>
Signed-off-by: Sean Prashad <13009507+seanprashad@users.noreply.github.com>
|
🤖 @codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ca85272e4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
HamptonMakes
left a comment
There was a problem hiding this comment.
There is a gap where we are losing old approvals, which I thikn we should keep for provenance... I'll add that in a follow-on PR.
|
🤖 Follow-up requested by @HamptonMakes: #305 preserves historical approvals, change requests, notes, and attribution when a reviewer is removed, while re-addition still starts a fresh Pending assignment. It also records the removal actor and time. This is a standalone PR against main. The gap in this merged PR is that removal deletes earlier decisions; #305 prevents future loss but cannot recover decisions already deleted. Local regression tests pass; CI and automated reviews are running on the follow-up. |

What changed and why
Removing a reviewer clears their review decisions across all reviewed versions. Re-adding them creates a fresh Pending request. Old response retries cannot restore a removed decision. Other active reviews remain unchanged.
Discussion comments and request/withdrawal audit history stay in place. API withdrawal still preserves review decisions.
Demo