• 
      

    Search all pages of diff files in `rbt review add-diff-comment`

    Review Request #15290 — Created Sept. 11, 2026 and updated

    Information

    RBTools
    master

    Reviewers

    AddDiffComment.add_comment iterated diffset.get_files(), which only yields
    the first page of results (25 files by default). Any file beyond the first page
    could not be matched, so rbt review add-diff-comment -f failed with
    "Could not find a file ..." on diffs containing more than 25 files.

    This changes the loop to iterate diffset.get_files().all_items, which follows
    the next link and walks every page of the file list.

    Regression tests are added in rbtools/commands/tests/test_review.py that build
    a real two-page FileDiffListResource via URLMapTransport: one test posts to
    a file on the second page (this fails without the fix, raising the
    "Could not find a file" CommandError), and one covers a file on the first page
    to guard the normal behavior.

    Co-authored with Claude Code.

    pytest rbtools/commands/tests/test_review.py — 2 passed.

    Verified the second-page regression test fails without the fix (raising
    CommandError: Could not find a file ...) and passes with it.

    Summary ID
    Search all pages of diff files in `rbt review add-diff-comment`
    `AddDiffComment.add_comment` iterated `diffset.get_files()`, which only yields the first page of results (25 files by default). Any file beyond the first page could not be matched, so `rbt review add-diff-comment -f` failed with "Could not find a file ..." on diffs with more than 25 files. Iterate `diffset.get_files().all_items` instead, which follows the `next` link and walks every page of the file list. Add regression tests that build a real two-page FileDiffListResource: one posts to a file on the second page (this fails without the fix, raising the "Could not find a file" CommandError), and one covers a file on the first page to guard normal behavior. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
    8d1586b4b3d3f2e9e1d7e87a767a1385bd35ed54
    Checks run (2 succeeded)
    flake8 passed.
    JSHint passed.