Publish one durable review result #5

Merged
lambadalambda merged 2 commits from fix/single-review-output into main 2026-08-05 20:05:16 +00:00

Summary

  • publish finding-bearing reviews only as one submitted pull review, without a repeated canonical issue comment
  • remove pre-existing canonical comments on successful reruns with durable, lease-safe deletion and rollback intent
  • retain canonical comments for summaries, no-finding reviews, and clean pull-review fallbacks
  • harden publication IDs and crash recovery across stale PRs, lease turnover, and missing stored review IDs

Verification

  • go test ./...
  • go test -race ./...
  • go vet ./...
  • sh scripts/adversarial-check.sh
  • independent code review with no remaining actionable findings
## Summary - publish finding-bearing reviews only as one submitted pull review, without a repeated canonical issue comment - remove pre-existing canonical comments on successful reruns with durable, lease-safe deletion and rollback intent - retain canonical comments for summaries, no-finding reviews, and clean pull-review fallbacks - harden publication IDs and crash recovery across stale PRs, lease turnover, and missing stored review IDs ## Verification - `go test ./...` - `go test -race ./...` - `go vet ./...` - `sh scripts/adversarial-check.sh` - independent code review with no remaining actionable findings
fix: publish one durable review result
All checks were successful
opencode/review OpenCode execution completed
c0f2b6d12b
Author
Owner

/oc review

/oc review
Collaborator

OpenCode Review

Execution completed for lambadalambda/opencode-forgejo-bot at 2b9763543cf7 (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.

<!-- opencode-review:v1:8f4f139a62d1f0788708e7dd89066546 --> <!-- opencode-reviewed-head:2b9763543cf7963ffa4b05276f4dcdde4a71fd8f --> ## OpenCode Review _Execution completed for `lambadalambda/opencode-forgejo-bot` at `2b9763543cf7` (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.
test: cover single review publication
All checks were successful
opencode/review OpenCode execution completed
2b9763543c
Author
Owner

/oc rerun

/oc rerun
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lambadalambda/opencode-forgejo-bot!5
No description provided.