Keep ReviewRequest timestamps in sync with Reviews and DiffSets
Review Request #8800 — Created March 7, 2017 and submitted — Latest diff uploaded
When publishing a
Review
, we let theReviewRequest
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 forDiffSet
s
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 andDiffSet.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.
Diff Revision 10
This is not the most recent revision of the diff. The latest diff is revision 11. See what's changed.
reviewboard/reviews/models/review.py |
---|
reviewboard/reviews/models/review_request.py |
---|
reviewboard/reviews/models/review_request_draft.py |
---|
reviewboard/reviews/tests/test_review_request.py |
---|