Give each ReviewRequestPageEntry direct access to the page data.

Review Request #9279 — Created Oct. 17, 2017 and submitted

Information

Review Board
release-3.0.x
aa1e454...

Reviewers

ReviewRequestPageEntry used to be pretty independent from
ReviewRequestPageData, with each entry either taking specific objects
(like a HTTP request, review request, and other state) in the
constructor or in utility methods, and the build_entries function
bridging the data and entries. This was a nice separation, but over time
as the entry needed to do more it ended up resulting in a lot of state
having to be passed around and inconsistency in what data was available
on what entry. With some upcoming work, this only got worse. In the end,
this maybe wasn't a necessary separation to keep, since they're always
used together.

Entries are now passed the ReviewRequestPageData directly, giving them
direct access to the review request, HTTP request, and calculated state.
This simplifies function signatures, entry building, code paths, and
will allow upcoming changes to give entries more control over their own
state.

Unit tests pass.

Tested manually with a review request I have that tests all entry states.

Description From Last Updated

Need to add docs for the new data parameter.

daviddavid
david
  1. 
      
  2. reviewboard/reviews/detail.py (Diff revision 1)
     
     

    Need to add docs for the new data parameter.

    1. Oops, looks like thi sgot rolled up into the follow-up change.

  3. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (8399cee)
Loading...