• 
      

    Keep ReviewRequest timestamps in sync with Reviews and DiffSets

    Review Request #8800 — Created March 7, 2017 and submitted — Latest diff uploaded

    Information

    Review Board
    release-3.0.x
    fa23ae9...

    Reviewers

    When publishing a Review, we let the ReviewRequest compute its own
    last updated time, which ends up being mere milliseconds after
    Review.timestamp, which makes it always appear that the review request
    is always the last updated object returned by
    ReviewRequest.get_last_activity(). The same is true for DiffSets
    during publishing of review requests -- their timestamp is always
    behind.

    We now force the timestamp of ReviewRequest to be in sync with
    Review.timestamp when publishing a review and DiffSet.timestamp when
    publishing a review request that contains a new diff. With in-sync
    timestamps, ReviewRequest.get_last_activity() now returns the correct
    models.

    Co-authored-by: Anni Cao anni@sfu.ca.

    Ran unit tests.

    Built the docs and went through them.

    Manually verified the following before applying the patch
    (via ./reviewboard/manage.py shell):

    • ReviewRequest.get_last_activity() returns the review request
      after a review is published.
    • ReviewRequest.get_last_activity() returns the review request
      after a revision with a diffset is published.

    After applying the patch this is no longer the case.