fix(review): include prior PR discussion in follow-up reviews #178

Merged
jwilger merged 2 commits from issue-176-pr-discussion-history into main 2026-05-10 07:21:21 -07:00
Owner

Summary

  • Incorporate top-level PR comments and inline review-thread comments into follow-up review prompt context.
  • Add duplicate-suppression guidance so the reviewer avoids re-raising addressed concerns unless new evidence remains.
  • Treat prior discussion retrieval as optional enrichment so review generation continues if history endpoints are unavailable.

Verification

  • nix develop -c cargo fmt --all -- --check
  • nix develop -c cargo nextest run -p ar-review
  • nix develop -c cargo nextest run -p ar-forgejo
  • nix develop -c cargo nextest run -p ar-prompts
  • nix develop -c cargo clippy --workspace --all-targets -- -D warnings

Closes #176

PR artifacts for 37d1f26d67:

Docker image: git.johnwilger.com/jwilger/auto_review/ar-gateway-pr:pr-178-37d1f26d67edfdb09c76359579199b94c4b0b27c
binary download: https://git.johnwilger.com/api/packages/jwilger/generic/auto-review-pr/178-37d1f26d67edfdb09c76359579199b94c4b0b27c/auto-review-pr-178-37d1f26d67edfdb09c76359579199b94c4b0b27c-linux-x86_64.tar.gz
SHA256SUMS: https://git.johnwilger.com/api/packages/jwilger/generic/auto-review-pr/178-37d1f26d67edfdb09c76359579199b94c4b0b27c/SHA256SUMS

## Summary - Incorporate top-level PR comments and inline review-thread comments into follow-up review prompt context. - Add duplicate-suppression guidance so the reviewer avoids re-raising addressed concerns unless new evidence remains. - Treat prior discussion retrieval as optional enrichment so review generation continues if history endpoints are unavailable. ## Verification - `nix develop -c cargo fmt --all -- --check` - `nix develop -c cargo nextest run -p ar-review` - `nix develop -c cargo nextest run -p ar-forgejo` - `nix develop -c cargo nextest run -p ar-prompts` - `nix develop -c cargo clippy --workspace --all-targets -- -D warnings` Closes #176 <!-- auto_review:artifact-links:start --> PR artifacts for 37d1f26d67edfdb09c76359579199b94c4b0b27c: Docker image: git.johnwilger.com/jwilger/auto_review/ar-gateway-pr:pr-178-37d1f26d67edfdb09c76359579199b94c4b0b27c binary download: https://git.johnwilger.com/api/packages/jwilger/generic/auto-review-pr/178-37d1f26d67edfdb09c76359579199b94c4b0b27c/auto-review-pr-178-37d1f26d67edfdb09c76359579199b94c4b0b27c-linux-x86_64.tar.gz SHA256SUMS: https://git.johnwilger.com/api/packages/jwilger/generic/auto-review-pr/178-37d1f26d67edfdb09c76359579199b94c4b0b27c/SHA256SUMS <!-- auto_review:artifact-links:end -->
fix(review): include prior PR discussion in follow-up reviews
Some checks failed
CI / Verify PR with nix flake check (pull_request) Has been cancelled
CI / Publish PR artifact packages (pull_request) Has been cancelled
CI / Request auto_review semantic review (pull_request) Has been cancelled
CI / Build PR artifacts (no token) (pull_request) Has been cancelled
520c02ca4d
Merge branch 'main' into issue-176-pr-discussion-history
All checks were successful
CI / Verify PR with nix flake check (pull_request) Successful in 3m23s
CI / Build PR artifacts (no token) (pull_request) Successful in 1m38s
CI / Request auto_review semantic review (pull_request) Successful in 2s
CI / Publish PR artifact packages (pull_request) Successful in 1m9s
auto_review auto_review: no findings
Clean PR packages / Delete packages for merged PRs (pull_request) Successful in 15s
37d1f26d67
auto-review left a comment

This PR enhances the review prompt by incorporating prior PR discussions and adding guidance to avoid duplicate feedback. It introduces new methods for retrieving review comments and integrates them into the review pipeline. The changes appear well-tested and safe to merge.

Walkthrough

  • crates/ar-cli/src/bench.rs and crates/ar-cli/src/commands.rs:

    • Added prior_discussion field to ReviewPromptInputs initialization to include prior PR discussions in the review prompt.
  • crates/ar-forgejo/src/client.rs:

    • Added methods list_pull_reviews and list_pull_review_comments to retrieve review records and comments, respectively.
  • crates/ar-forgejo/src/types.rs:

    • Introduced PullReviewSummary struct to represent review summaries.
  • crates/ar-prompts/src/prompt.rs:

    • Updated ReviewPromptInputs to include prior_discussion.
    • Modified render_review_prompt to append prior PR discussions to the prompt.
  • crates/ar-review/src/pipeline.rs:

    • Added functions render_prior_pr_discussion and load_prior_pr_discussion to process and load prior PR discussions.
    • Integrated prior discussion loading into the review_pull_request function.
  • Tests:

    • Added tests to ensure prior PR discussions are included in the review prompt and that duplicate feedback is avoided.
This PR enhances the review prompt by incorporating prior PR discussions and adding guidance to avoid duplicate feedback. It introduces new methods for retrieving review comments and integrates them into the review pipeline. The changes appear well-tested and safe to merge. ## Walkthrough - **crates/ar-cli/src/bench.rs** and **crates/ar-cli/src/commands.rs**: - Added `prior_discussion` field to `ReviewPromptInputs` initialization to include prior PR discussions in the review prompt. - **crates/ar-forgejo/src/client.rs**: - Added methods `list_pull_reviews` and `list_pull_review_comments` to retrieve review records and comments, respectively. - **crates/ar-forgejo/src/types.rs**: - Introduced `PullReviewSummary` struct to represent review summaries. - **crates/ar-prompts/src/prompt.rs**: - Updated `ReviewPromptInputs` to include `prior_discussion`. - Modified `render_review_prompt` to append prior PR discussions to the prompt. - **crates/ar-review/src/pipeline.rs**: - Added functions `render_prior_pr_discussion` and `load_prior_pr_discussion` to process and load prior PR discussions. - Integrated prior discussion loading into the `review_pull_request` function. - **Tests**: - Added tests to ensure prior PR discussions are included in the review prompt and that duplicate feedback is avoided.
Sign in to join this conversation.
No reviewers
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
Slipstream/auto_review!178
No description provided.