Repository navigation
fix(engine): approve once the findings that held approval back are settled - #70
Conversation
…ttled A reply that dismissed or resolved a finding rebuilt the summary, but kept the review's verdict and its "Not approving while a bug finding is open" note, and left the check run on the old tier. A pull request whose only open finding was talked away stayed at "Commented" until the next push. The review now marks its summary when only open findings kept it from approving: the whole diff was seen, the author may be approved and reviews.approve is on. Settling the last such finding in its thread then approves the reviewed head, drops the note, and posts a check run with the new tier and conclusion. It never approves while a review is running, over a newer head, or from a summary without the mark (a partial diff, an outside contributor, or one written before this change). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3M7tu37atmEwQALkjzmjx Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com>
Code review
The pull request records when open findings alone withheld approval and preserves that eligibility as findings are settled. Settlement rebuilds recalculate the summary, grade, verdict, change-request state, and check run, and can approve the reviewed head when eligible. The newest changes add a marker for approvals confirmed by GitHub and make capped finding lists leave the existing standing untouched. Latest changes: The newest commits add a marker that is written only after GitHub accepts a settlement approval, use it instead of inferring approval from summary text, and stop settlement refreshes when the findings list reaches its cap; tests cover these cases. Walkthrough (11)
Fixed since the last review (2)
Reviewed the commits since Tip Comment |
…whole list - A settlement that already approved shows it in the summary, which a later settlement now reads, so it neither approves again nor reverts the summary to the stored "Commented" verdict. - The approval is submitted before the summary is written, and a refused one leaves the summary on the settled verdict. - A findings list cut at its limit may leave open findings out, so it never approves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3M7tu37atmEwQALkjzmjx Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com>
…ist alone - A settlement that GitHub took an approval from writes its own hidden mark. Later settlements read that instead of the summary's verdict column, which a review job writes before its own GitHub review is posted. - A findings list at its limit may leave open blockers out, so the settlement no longer rebuilds the grade, the summary or the change request from it, not only the approval. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3M7tu37atmEwQALkjzmjx Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com>

Requested by Torsten · project thread
What happened
On appwrite-labs/infrastructure#1157 the review left one finding, a minor bug, so it commented instead of approving. A reply showed the finding was intended, and Hansi dismissed it and rebuilt the summary. But the rebuilt summary still said 💬 Commented, still carried "Not approving while a bug finding is open: Held drafts stop being retried after two days", and the check run stayed at neutral Tier A.
refreshSummaryAfterSettlementcarried the review's verdict over on purpose ("a conversation is not a review of the code, so it never approves"). It also copied the withheld-approval note back from the old body as it was, and nothing updated the check run. A full re-review already lets a reply dismiss a finding and then approve, so a settlement in the thread now does the same.The fix
runReviewreturnsapprovesWhenSettled: true when only open findings held approval back. That means the whole diff was seen, the author may be approved, andreviews.approveis on. The review job writes it into the summary as a hiddenapproves-when-settledmarker, and rebuilds (settlement, merge-only) carry it over.refreshSummaryAfterSettlement:decideVerdict), using the base branch config;APPROVEreview and a newHansicheck run withsuccess) when the marker is there and nothing open holds approval back;CHECK_NAMEandcheckConclusionsmoved toshared.tsso the summary code can use them without importingreview-job.Tests
chat-job.test.tsreplays #1157's case. Dismissing the finding approves the reviewed head, removes the note and the finding, grades S and posts a success check run. Without the marker, only the summary and the check run's tier are refreshed. After a push, nothing is approved.core.test.ts:approvesWhenSettledfor a trusted author, an outside contributor, a truncated diff, and a review held back by a minor bug.summary.test.ts: the marker survives a rebuild.bun run lint,bun run checkandbun run test(494 pass) are green.Not in this PR
PATCH /reviews/:reviewId/tieronly takes the tier, so after a settlement approval the Console still shows the review's original verdict.Generated by Claude Code