feat: Add @codebot review-again command for manual PR re-review #10

Merged
Latte merged 1 commits from feature/review-again-command into dev 2025-12-28 19:15:32 +00:00
Owner
  • Add review-again command to trigger PR review without new commits
  • Implement review comparison logic to show resolved/new/changed issues
  • Update workflow to handle PR comments via dispatcher
  • Add comprehensive help documentation in README and CLAUDE.md
  • Show diff from previous review with resolved/new issues count
  • Update PR labels based on new severity assessment
  • Support re-evaluation after config changes or false positive clarification

Key features:

  • Shows diff from previous review (resolved/new/changed issues)
  • 🏷️ Updates labels based on new severity
  • No need for empty commits to trigger review
  • 🔧 Respects latest .ai-review.yml configuration

Closes feature request for manual PR re-review capability

- Add review-again command to trigger PR review without new commits - Implement review comparison logic to show resolved/new/changed issues - Update workflow to handle PR comments via dispatcher - Add comprehensive help documentation in README and CLAUDE.md - Show diff from previous review with resolved/new issues count - Update PR labels based on new severity assessment - Support re-evaluation after config changes or false positive clarification Key features: - ✅ Shows diff from previous review (resolved/new/changed issues) - 🏷️ Updates labels based on new severity - ⚡ No need for empty commits to trigger review - 🔧 Respects latest .ai-review.yml configuration Closes feature request for manual PR re-review capability
Latte added this to the Milestone 1: Core Features (Quick Wins) milestone 2025-12-28 19:14:52 +00:00
Latte self-assigned this 2025-12-28 19:14:52 +00:00
Latte added 1 commit 2025-12-28 19:14:52 +00:00
feat: Add @codebot review-again command for manual PR re-review
All checks were successful
Enterprise AI Code Review / ai-review (pull_request) Successful in 27s
b428d0a37e
- Add review-again command to trigger PR review without new commits
- Implement review comparison logic to show resolved/new/changed issues
- Update workflow to handle PR comments via dispatcher
- Add comprehensive help documentation in README and CLAUDE.md
- Show diff from previous review with resolved/new issues count
- Update PR labels based on new severity assessment
- Support re-evaluation after config changes or false positive clarification

Key features:
-  Shows diff from previous review (resolved/new/changed issues)
- 🏷️ Updates labels based on new severity
-  No need for empty commits to trigger review
- 🔧 Respects latest .ai-review.yml configuration

Closes feature request for manual PR re-review capability
Bartender reviewed 2025-12-28 19:15:17 +00:00
Bartender left a comment
Owner

AI Code Review - Inline Comments

AI Code Review - Inline Comments
Owner

[LOW] Maintainability

The workflow script duplicates the 'actions/checkout@v4' step twice in a row, which is unnecessary and could be simplified.

Recommendation: Remove the redundant 'actions/checkout@v4' step to streamline the workflow and avoid confusion.

**[LOW] Maintainability** The workflow script duplicates the 'actions/checkout@v4' step twice in a row, which is unnecessary and could be simplified. **Recommendation:** Remove the redundant 'actions/checkout@v4' step to streamline the workflow and avoid confusion.
Owner

[LOW] Readability

The shell script in the 'Run AI Comment Response' step uses a multi-line if-else block with embedded GitHub Actions expressions, which can be hard to read and maintain.

Recommendation: Consider extracting the dispatch logic into a separate script file or a dedicated action to improve readability and maintainability.

**[LOW] Readability** The shell script in the 'Run AI Comment Response' step uses a multi-line if-else block with embedded GitHub Actions expressions, which can be hard to read and maintain. **Recommendation:** Consider extracting the dispatch logic into a separate script file or a dedicated action to improve readability and maintainability.
Owner

[LOW] Readability

The logic to detect the 'review-again' command in PR comments uses a case-sensitive substring check on the comment body converted to lowercase, which may cause false negatives if the mention prefix case differs or if there is extra whitespace.

Recommendation: Normalize the mention prefix and command string to lowercase and trim whitespace before checking. Consider using regex to robustly detect the command in the comment body.

**[LOW] Readability** The logic to detect the 'review-again' command in PR comments uses a case-sensitive substring check on the comment body converted to lowercase, which may cause false negatives if the mention prefix case differs or if there is extra whitespace. **Recommendation:** Normalize the mention prefix and command string to lowercase and trim whitespace before checking. Consider using regex to robustly detect the command in the comment body.
Owner

[LOW] Maintainability

The method '_parse_review_comment' uses a regex pattern to extract findings from the previous review comment, but it assumes a very specific markdown format which may break if the comment formatting changes.

Recommendation: Add error handling or fallback parsing logic. Consider storing findings in a structured format (e.g., JSON block) in the comment to improve robustness.

**[LOW] Maintainability** The method '_parse_review_comment' uses a regex pattern to extract findings from the previous review comment, but it assumes a very specific markdown format which may break if the comment formatting changes. **Recommendation:** Add error handling or fallback parsing logic. Consider storing findings in a structured format (e.g., JSON block) in the comment to improve robustness.
Owner

[LOW] Performance

The '_compare_reviews' method creates dictionaries keyed by a truncated description substring (first 50 chars) which may cause collisions or mismatches for similar issues with longer descriptions.

Recommendation: Consider using a more robust unique key for findings, such as a hash of the full description or including additional context fields to reduce false matches.

**[LOW] Performance** The '_compare_reviews' method creates dictionaries keyed by a truncated description substring (first 50 chars) which may cause collisions or mismatches for similar issues with longer descriptions. **Recommendation:** Consider using a more robust unique key for findings, such as a hash of the full description or including additional context fields to reduce false matches.
Owner

[LOW] Readability

The '_format_review_update' method generates a large markdown string with many repeated patterns and manual string concatenations, which can be error-prone and hard to maintain.

Recommendation: Refactor to use a templating engine or helper functions to build sections of the comment for better readability and easier updates.

**[LOW] Readability** The '_format_review_update' method generates a large markdown string with many repeated patterns and manual string concatenations, which can be error-prone and hard to maintain. **Recommendation:** Refactor to use a templating engine or helper functions to build sections of the comment for better readability and easier updates.
Owner

[LOW] Testing

The new '_handle_review_again' method and its helper methods introduce complex logic for re-reviewing PRs, but there is no indication of added or updated unit or integration tests covering these new code paths.

Recommendation: Add comprehensive tests for the 'review-again' command handling, including cases with no previous review, with previous reviews, and with various diff and security scan results.

**[LOW] Testing** The new '_handle_review_again' method and its helper methods introduce complex logic for re-reviewing PRs, but there is no indication of added or updated unit or integration tests covering these new code paths. **Recommendation:** Add comprehensive tests for the 'review-again' command handling, including cases with no previous review, with previous reviews, and with various diff and security scan results.
Owner

Note: This review was generated by an AI assistant. While it aims to be accurate and helpful, it may contain mistakes or miss important issues. Please verify all findings before taking action.

AI Code Review

This PR introduces a new '@codebot review-again' command to manually re-run AI code reviews on pull requests without new commits. It includes workflow updates to dispatch PR comment events, extensive logic in the PR agent to handle re-review requests, comparison of new and previous review results, and updates to comments and labels accordingly. The implementation is comprehensive and well integrated with existing systems, improving usability and iteration speed for PR reviews.

Summary

Severity Count
HIGH 0
MEDIUM 0
LOW 7

Review Findings

  • [LOW] .gitea/workflows/ai-comment-reply.yml:38 - The workflow script duplicates the 'actions/checkout@v4' step twice in a row, which is unnecessary and could be simplified.
  • [LOW] .gitea/workflows/ai-comment-reply.yml:44 - The shell script in the 'Run AI Comment Response' step uses a multi-line if-else block with embedded GitHub Actions expressions, which can be hard to read and maintain.
  • [LOW] tools/ai-review/agents/pr_agent.py:90 - The logic to detect the 'review-again' command in PR comments uses a case-sensitive substring check on the comment body converted to lowercase, which may cause false negatives if the mention prefix case differs or if there is extra whitespace.
  • [LOW] tools/ai-review/agents/pr_agent.py:150 - The method '_parse_review_comment' uses a regex pattern to extract findings from the previous review comment, but it assumes a very specific markdown format which may break if the comment formatting changes.
  • [LOW] tools/ai-review/agents/pr_agent.py:230 - The '_compare_reviews' method creates dictionaries keyed by a truncated description substring (first 50 chars) which may cause collisions or mismatches for similar issues with longer descriptions.
  • [LOW] tools/ai-review/agents/pr_agent.py:270 - The '_format_review_update' method generates a large markdown string with many repeated patterns and manual string concatenations, which can be error-prone and hard to maintain.
  • [LOW] tools/ai-review/agents/pr_agent.py:100 - The new '_handle_review_again' method and its helper methods introduce complex logic for re-reviewing PRs, but there is no indication of added or updated unit or integration tests covering these new code paths.

Overall Severity: LOW
AI Recommendation: Approve

<!-- AI_PR_REVIEW --> **Note:** This review was generated by an AI assistant. While it aims to be accurate and helpful, it may contain mistakes or miss important issues. Please verify all findings before taking action. ## AI Code Review This PR introduces a new '@codebot review-again' command to manually re-run AI code reviews on pull requests without new commits. It includes workflow updates to dispatch PR comment events, extensive logic in the PR agent to handle re-review requests, comparison of new and previous review results, and updates to comments and labels accordingly. The implementation is comprehensive and well integrated with existing systems, improving usability and iteration speed for PR reviews. ### Summary | Severity | Count | |----------|-------| | HIGH | 0 | | MEDIUM | 0 | | LOW | 7 | ### Review Findings - **[LOW]** `.gitea/workflows/ai-comment-reply.yml:38` - The workflow script duplicates the 'actions/checkout@v4' step twice in a row, which is unnecessary and could be simplified. - **[LOW]** `.gitea/workflows/ai-comment-reply.yml:44` - The shell script in the 'Run AI Comment Response' step uses a multi-line if-else block with embedded GitHub Actions expressions, which can be hard to read and maintain. - **[LOW]** `tools/ai-review/agents/pr_agent.py:90` - The logic to detect the 'review-again' command in PR comments uses a case-sensitive substring check on the comment body converted to lowercase, which may cause false negatives if the mention prefix case differs or if there is extra whitespace. - **[LOW]** `tools/ai-review/agents/pr_agent.py:150` - The method '_parse_review_comment' uses a regex pattern to extract findings from the previous review comment, but it assumes a very specific markdown format which may break if the comment formatting changes. - **[LOW]** `tools/ai-review/agents/pr_agent.py:230` - The '_compare_reviews' method creates dictionaries keyed by a truncated description substring (first 50 chars) which may cause collisions or mismatches for similar issues with longer descriptions. - **[LOW]** `tools/ai-review/agents/pr_agent.py:270` - The '_format_review_update' method generates a large markdown string with many repeated patterns and manual string concatenations, which can be error-prone and hard to maintain. - **[LOW]** `tools/ai-review/agents/pr_agent.py:100` - The new '_handle_review_again' method and its helper methods introduce complex logic for re-reviewing PRs, but there is no indication of added or updated unit or integration tests covering these new code paths. --- **Overall Severity:** `LOW` **AI Recommendation:** Approve
Latte merged commit efb4b27a70 into dev 2025-12-28 19:15:32 +00:00
Latte deleted branch feature/review-again-command 2025-12-28 19:15:32 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Hiddenden/openrabbit#10