fix(github): use committer date for incremental review commit range after rebase - #3417
Conversation
…fter rebase The author date is preserved across rebases, so after a force-push the incremental review range appears empty and the review silently skips changed code. Switch to the committer date which advances on rebase, with an author-date fallback for commits that lack a committer (matching the GitLab adapter). Add a guard for fully rebased branches where every commit post-dates the previous review and no baseline commit is available; fall back to a full review instead of diffing against a None reference. Fixes The-PR-Agent#3407.
PR Summary by QodoFix incremental GitHub reviews after branch rebases
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. New date lookup mixes quote styles
|
IsmaelMartinez
left a comment
There was a problem hiding this comment.
Thanks for picking up the help-wanted issue within the hour; this is the fix #3407 asked for.
Verified: the rebased-commit and fully-rebased cases go red against main and green here, the author-date fallback matches the GitLab adapter, and the full suite is clean on today's main.
Qodo's two notes are style only (quote style on line 244, comment voice) and do not need a change before this lands.
References to other Issues or PRs
Fixes #3407. Supersedes #2844.
Brief description of what is fixed or changed
/review -icompares commit dates against the previous review timestamp to decide what changed.get_commit_rangein the GitHub provider used the author date, which git preserves across a rebase. After a force-push the range therefore came back empty and the incremental review reported "no files changed" even though the code did change.This change:
_GitLabIncrementalCommitalready does on the GitLab side.Nonereference.Validation
Five regression tests in
test_github_provider_incremental.py:Full unit suite: 8565 passed, 33 skipped, 1 xfailed. Ruff and all applicable pre-commit hooks pass on the changed files.