Repository navigation
How to configure to review individual commits? #4465
|
Hi, I'm looking for a project to conduct codereview via AI on Gitlab MRs. Figured somebody might have created a code for this, so I found this project. But, having looked through review documentation, there's a thing I am confused by: the project seem to lack ability to review commits, as opposed to whole PR/MR diff. A whole diff sometimes is interesting, sure, but codereviewing that would be strange. You want to be sure every commit has separate logical change with description matching the functionality… Also, commit descriptions always contain important for proper review information — you can't give good quality review to a diff with a bunch of stuff changed, where it's unclear what and why was moved. So, it's odd to see in documentation quotes like:
…and nothing about separate commit diff. Am I missing something here, is perhaps per-commit codereview just not documented? |
Replies: 1 comment 4 replies
|
You are not missing anything: What exists today: 1. Incremental review:
So if you push one logical commit at a time and run 2. Commit messages are mostly not in the review prompt The reviewer fetches [pr_reviewer]
require_estimate_contribution_time_cost = true
extra_instructions = """
Check that each commit is one logical change and that its message matches the code it touches.
"""That still reviews the combined diff, though, so the model cannot reliably tell which hunk came from which commit. 3. Real per commit review That would need a new mode (iterate the MR commits, fetch each commit's diff, review it with its message). Worth opening a feature request issue for, since none of the providers implement it now. |
You are not missing anything:
/reviewhas no per commit mode. It always reviews a diff of the MR, either the whole thing or, with-i, the commits added since the last review. There is no option that walks the commits one by one and reviews each diff against its own message.What exists today:
1. Incremental review:
/review -i-iis parsed inPRReviewer.parse_incremental. On GitLab,get_incremental_commitsfinds the previous review note and limits the diff to commits pushed after it (gitlab_provider.py#L820-L860). If no earlier review exists, it falls back to a full review. Tuning knobs are under[pr_reviewer](minimal_commits_for_incremental_review,minimal_minutes_for_incremental_review,r…