• 
      

    Fix parsing GitHub commit responses with files missing a patch.

    Review Request #15389 — Created Oct. 9, 2026 and updated

    Information

    Review Board
    release-9.x

    Reviewers

    GitHub leaves patch out of a commit's files entries for binary files
    and for diffs that are too large. Historically we silently skip these
    types of files and leave them out of the diff. With the move to Pydantic
    for parsing GitHub API responses, we didn't give FileEntry.patch a
    default, so Pydantic treated it as required. This caused get_change()
    to fail with an "Unexpected response from GitHub" for any commit that
    contained those files.

    Now we default the field to None so that we go back to the old silent
    skipping behvaiour. I have an upcoming change that will improve things
    to include these files in the diff.

    • Tested creating a review request from a GitHub commit through the
      UI that contained binary files. It failed before this fix.
    • Ran unit tests.
    Summary ID
    Fix parsing GitHub commit responses with files missing a patch.
    GitHub leaves `patch` out of a commit's `files` entries for binary files and for diffs that are too large. Historically we silently skip these types of files and leave them out of the diff. With the move to Pydantic for parsing GitHub API responses, we didn't give `FileEntry.patch` a default, so Pydantic treated it as required. This caused `get_change()` to fail with an "Unexpected response from GitHub" for any commit that contained those files. Now we default the field to `None` so that we go back to the old silent skipping behvaiour. I have an upcoming change that will improve things to include these files in the diff.
    b854fd139cb257d7041eec2371b0b13b83d4e646
    Checks run (2 succeeded)
    flake8 passed.
    JSHint passed.