Add typing and fixes for reviewboard.diffviewer.commit_utils.

Review Request #14596 — Created Sept. 6, 2025 and submitted

Information

Review Board
master

Reviewers

This fleshes out the remainder of reviewboard.diffviewer.commit_utils
with typing and documentation. The validation payloads are now fully
typed, which is only useful internally as this is considered opaque
outside this module.

There is one fix with equality checking for CommitHistoryDiffEntry. It
assumed the other type, and would crash if given a different type. We
now check for this.

This is mostly the same as Christian's change at /r/14416. The changes
I've made:

  • Moved SerializedCommitHistoryDiffEntryType so it's defined before
    it's used.
  • Fixed a typo in the DiffCommitsValidationInfo docs.
  • Fixed up some Args/Returns types to list the specific
    TypedDict/TypeAlias names instead of just str or dict.

Ran unit tests.

Summary ID
Add typing and fixes for reviewboard.diffviewer.commit_utils.
This fleshes out the remainder of reviewboard.diffviewer.commit_utils with typing and documentation. The validation payloads are now fully typed, which is only useful internally as this is considered opaque outside this module. There is one fix with equality checking for CommitHistoryDiffEntry. It assumed the other type, and would crash if given a different type. We now check for this. This is mostly the same as Christian's change at /r/14416. The changes I've made: - Moved `SerializedCommitHistoryDiffEntryType` so it's defined before it's used. - Fixed a typo in the `DiffCommitsValidationInfo` docs. - Fixed up some Args/Returns types to list the specific TypedDict/TypeAlias names instead of just `str` or `dict`. Testing Done: Ran unit tests.
wwzyusmmzuyvvuqrtkzrznuwnklmwtno
Description From Last Updated

Do we wanna say 8.0 instead of 7.1 here and below?

maubinmaubin

This probably meant to say "included" instead of "includes".

maubinmaubin
maubin
  1. 
      
  2. reviewboard/diffviewer/commit_utils.py (Diff revision 1)
     
     
    Show all issues

    Do we wanna say 8.0 instead of 7.1 here and below?

    1. Yeah, probably. Christian's original version of this change was for 7.1 but it should probably land with the rest of my diffviewer work.

  3. reviewboard/diffviewer/commit_utils.py (Diff revision 1)
     
     
    Show all issues

    This probably meant to say "included" instead of "includes".

  4. 
      
david
maubin
  1. Ship It!
  2. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (8722be9)