Skip to content

A carried approval carries the review it rests on, and that review stays in sight - #781

Merged
nambok merged 1 commit into
mainfrom
reviewer/carried-approval-keeps-its-review
Nov 18, 2026
Merged

nambok merged 1 commit into
mainfrom
reviewer/carried-approval-keeps-its-review

Conversation

@nambok

@nambok nambok commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

After a person merged the base branch into a pull request CoderHelm had approved, CoderHelm posted a new approval whose whole body was one line: "Approved: the new commits only bring in the base branch; the PR's own change is the same as the approved <sha>." Posting it rewrote the earlier full review to "Outdated: see CoderHelm's latest review", and the tidy between reviews (#761) cuts any review of an older commit to one line. The pull request's only visible approval had no review in it, so nobody could see what had been checked.

Now a carried approval stands on its own: it carries the earlier review's content (what was checked, criteria, verification, tests, notes and findings) stated against the new head. While it is CoderHelm's latest review, the review it rests on is never rewritten, cut or hidden. If there is no stored review to carry, the pull request is reviewed in full instead of getting a one-line approval.

Changes

  • worker/src/passes/review_pr.rs
    • Every review record now keeps the posted body without the rating footer (posted_body).
    • carried_review reads the stored review of the approved commit. On an older record without posted_body it uses the summary and findings. It returns None when there is no record, or when the record is an old one-line carry.
    • carried_approval_body writes the carried approval in this order: the verdict, then "the PR's own change is unchanged since <sha>; the new commits only bring in <base>", then the earlier review itself. It leaves out the earlier review's marks and footer. Its marks name the commit it rests on and the commit the review was written for, so a carry of a carry keeps the one review instead of nesting. The model is not called again.
    • When nothing can be carried, the push is reviewed in full: no one-line approval, and no "triage only" diff note.
  • worker/src/passes/review_sweep.rs: ReviewRecord::posted_body is read back. The test literals in the other review modules got the new field.
  • common/src/review_supersede.rs
    • New: carried_from, live_carried_sha and kept_for_carry. carried_from also recognizes the old one-line wording.
    • plan (run when a review is posted) no longer rewrites the review a carried approval rests on, and leaves its comments in sight and its threads open.
    • tidy (run between reviews) never cuts the review that CoderHelm's latest carried approval rests on while the pull request is open. A later real review, a merge or a close cuts both reviews as before.
  • New incident case kr_carried_approval_keeps_its_review, with its test and its page in docs/incidents/.

Verification

  • The replay test follows the incident: a full review on commit A, a person merges main (new head B, same change of the PR's own), then the carried approval on B. It checks:
    • the latest visible review contains the earlier review's verdict, criteria, verification, tests and finding;
    • plan and tidy never rewrite, cut or hide the review of A, its comment or its thread;
    • an approval already posted the old one-line way still keeps A in sight;
    • a later real review, or a merge, cuts both;
    • a second merge carries the same review only once;
    • with no stored review, or only a one-line one, there is nothing to carry and the pipeline reviews in full.
  • The test fails on main: the carried-review API does not exist there, and tidy/plan on main cut the review a one-line carry rests on.
  • cargo fmt --all -- --check, cargo clippy --all-targets -- -D warnings and cargo test --workspace all pass locally (6,201 passed, 0 failed).

…ays in sight

After a person merged the base branch into an approved pull request,
CoderHelm posted a new approval whose whole body was one line ("the new
commits only bring in the base branch; the PR's own change is the same as
the approved <sha>"). Posting it rewrote the earlier full review to
"Outdated", and the tidy between reviews cuts a review of an older commit
to one line, so the pull request's only visible approval had no review in it.

- The carried approval now carries the stored review of the approved
  commit as it was posted (the posted body is now kept on every review
  record), stated against the new head; a carry of a carry keeps the one
  review without nesting.
- With no stored review to carry (or only an old one-line carry), the pull
  request is reviewed in full instead.
- review_supersede::plan and tidy never rewrite, cut or hide the review the
  latest carried approval rests on, nor its comments and threads; the old
  one-line wording is read the same way.
- Incident case kr_carried_approval_keeps_its_review with its page.
@nambok
nambok merged commit ac98afa into main Nov 18, 2026
10 checks passed
@nambok
nambok deleted the reviewer/carried-approval-keeps-its-review branch November 18, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant