Update and improve the comments hint computation for the diff viewer.

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

Information

Review Board
release-7.x

Reviewers

This change makes major updates to the comments hint structure that gets
included in the diff viewer page data. The major driver for this is that
the old implementation did not include correct information about
comments that were made against commit ranges. It was also doing a bunch
of extra queries, using the database to generate the comments
information when we already had most of what we needed fetched.

This new implementation simplifies things a little bit by compting more
information at the ReviewsDiffViewerView level, passing it down to the
DiffViewerView, instead of letting the superclass do things and then
pull the data back out of the context structure.

This makes a couple other small improvements:

  • The social page info definitions have been consolidated into the base
    ReviewRequestContext, and arguments added to
    make_review_request_context to set them there.
  • The way that diff commits and other objects are queried has been
    simplified so we don't fetch things more than once.

This does not yet add UI for commit-specific comments.

  • Ran unit tests.
  • Tested all the different diff viewer views, including single diffs,
    interdiffs, and commit diffs.
  • Tested that the commit list and commit history diffs worked correctly.
  • Tested that the comments hint (in a future change) correctly listed
    all diffs, interdiffs, and commit range comments included in the
    pending review.

Commits

Files