Publish one durable review result #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/single-review-output"
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
Verification
go test ./...go test -race ./...go vet ./...sh scripts/adversarial-check.sh/oc review
OpenCode Review
Execution completed for
lambadalambda/opencode-forgejo-botat2b9763543cf7(job #35).Rating: 5/5
The PR cleanly refactors result publication so each successful job emits exactly one durable artifact. Reviews with findings publish a COMMENT pull review and remove any prior canonical comment, persisting a bounded id+body removal intent (SaveRemovedComment) so interrupted reruns recover. Summaries, no-finding reviews, and clean inline fallbacks publish the canonical issue comment. removeCanonicalComment reconciles by body when the Forgejo comment id drifted, refuses to delete a changed canonical, and is lease/generation guarded. rollbackResultPublication restores the canonical from the persisted body after deleting the review, and only clears the intent when restoration succeeds. CompleteLeasedJob now requires at least one positive publication id, CreateIssueComment/SaveCommentID reject non-positive ids, and recovering publications fail closed (errPullReviewAmbiguous) when reconcile is ambiguous. Coverage is strong and all mandated checks (go test, vet, gofmt, -race, adversarial-check) pass. The prior MEDIUM finding (adversarial-check.sh silently skipping renamed publication tests) is fully resolved in the head commit, which also pins the three newly critical removal/recovery tests.
No findings were reported.
Correct, well-tested, production-ready. The compensation/recovery matrix around canonical-comment removal is sound: persisted intent enables idempotent recovery, body-based reconcile handles Forgejo id drift, rollback ordering restores the canonical only after the review is deleted, and fail-closed behavior prevents duplicate durable artifacts on ambiguous recoveries. No significant correctness, security, data-integrity, performance, or maintainability issues found.
/oc rerun