Add typing structures for the diff viewer context.

Review Request #13666 — Created March 25, 2024 and submitted — Latest diff uploaded

Information

Review Board
release-7.x

Reviewers

The context that's assembled and used to render the diff viewer page
(both the HTML-based UI and the diff context API endpoint) has grown
organically since the very earliest days of Review Board, and is a
pretty big hairy mess. In order to bring at least a little bit of sanity
to it, this change adds typing structures so that type checkers can
verify that we're always assigning things correctly.

The only actual change to the content of the context is that we can no
longer end up with non-bool types for the is_draft_diff and
is_draft_interdiff fields.

Ran unit tests.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Add typing structures for the diff viewer context.
The context that's assembled and used to render the diff viewer page (both the HTML-based UI and the diff context API endpoint) has grown organically since the very earliest days of Review Board, and is a pretty big hairy mess. In order to bring at least a little bit of sanity to it, this change adds typing structures so that type checkers can verify that we're always assigning things correctly. The only actual change to the content of the context is that we can no longer end up with non-`bool` types for the `is_draft_diff` and `is_draft_interdiff` fields. Testing Done: - Ran unit tests.
eaf2f91109549ee9bfe835fbac9bc42b86f397aa David Trowbridge
reviewboard/diffviewer/commit_utils.py
reviewboard/diffviewer/diffutils.py
reviewboard/diffviewer/views.py
reviewboard/diffviewer/models/diffcommit.py
reviewboard/reviews/context.py
reviewboard/reviews/models/base_review_request_details.py
reviewboard/reviews/models/review_request.py
reviewboard/reviews/ui/base.py
reviewboard/reviews/views/diffviewer.py
reviewboard/reviews/views/review_request_detail.py
reviewboard/reviews/views/review_request_updates.py
reviewboard/webapi/tests/test_diff_context.py
Loading...