Collapsing Old Reviews on Review Requests
Review Request #8489 — Created Oct. 25, 2016 and discarded
We want to promote discussion and foster ease of use for the site.
On active or old review requests it can be hard to track whats happening.
This can be helped by collapsing inactive reviews.
This makes it easier to browse and see whats new.This is done by implementing logic such that:
1. If the review hasn't been seen (by this user), show it
2. If the review is new, show it
3. If there is a new reply, show the review
3. If the user has a draft for that review, show it
4. If there are open issues for the review, show it
5. Otherwise, hide it (via collapsing)
Tested by hand to make sure everything works
Unit tests written:
1. Test old review
2. Test new review
3. Test review with old reply
4. Test review with new reply
5. Test review with draft for user
6. Test review with draft for another user
7. Test review with open issue
8. Test all of the above when logged out
9. Test all of the above with user who hasn't visited before
10. Repeat test with same user now that they've visited
Description | From | Last Updated |
---|---|---|
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 80 E501 line too long (96 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (86 > 79 characters) |
reviewbot | |
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 23 E261 at least two spaces before inline comment |
reviewbot | |
Col: 24 E262 inline comment should start with '# ' |
reviewbot | |
Col: 22 E261 at least two spaces before inline comment |
reviewbot | |
Col: 23 E262 inline comment should start with '# ' |
reviewbot | |
Col: 5 E265 block comment should start with '# ' |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 26 E261 at least two spaces before inline comment |
reviewbot | |
Col: 27 E262 inline comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (93 > 79 characters) |
reviewbot | |
Col: 21 W503 line break before binary operator |
reviewbot | |
Col: 17 W503 line break before binary operator |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (105 > 79 characters) |
reviewbot | |
undefined name 'timestamp' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 80 E501 line too long (96 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (86 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (95 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (137 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (86 > 79 characters) |
reviewbot | |
undefined name 'datetime' |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 82 W291 trailing whitespace |
reviewbot | |
Col: 22 W503 line break before binary operator |
reviewbot | |
Col: 80 E501 line too long (91 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (97 > 79 characters) |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (86 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 W291 trailing whitespace |
reviewbot | |
Col: 22 W503 line break before binary operator |
reviewbot | |
Col: 80 E501 line too long (85 > 79 characters) |
reviewbot | |
Col: 22 W503 line break before binary operator |
reviewbot | |
'datetime' imported but unused |
reviewbot | |
'ReviewRequest' imported but unused |
reviewbot | |
Col: 80 E501 line too long (85 > 79 characters) |
reviewbot | |
local variable 'comment_text_1' is assigned to but never used |
reviewbot | |
local variable 'comment_text_2' is assigned to but never used |
reviewbot | |
local variable 'comment_text_3' is assigned to but never used |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
local variable 'filediff' is assigned to but never used |
reviewbot | |
local variable 'user2' is assigned to but never used |
reviewbot | |
local variable 'review_one' is assigned to but never used |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
local variable 'review_two' is assigned to but never used |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
local variable 'reply_for_three' is assigned to but never used |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
local variable 'reply_for_four' is assigned to but never used |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 80 E501 line too long (86 > 79 characters) |
reviewbot | |
timestamps. |
brennie | |
Instead of keeping track of i manually, you can do: for i, review in enumerate(review_request.reviews.all()): Review.objects.filter(pk=review.pk).update(timestamp=timestamp[i]) |
brennie | |
Col: 79 W291 trailing whitespace |
reviewbot | |
Col: 9 E303 too many blank lines (2) |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 9 E303 too many blank lines (2) |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
No print() in unit tests. YOu can add a message to self.assertEqual as the third argument. |
brennie | |
Col: 80 E501 line too long (91 > 79 characters) |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
These should be together. |
brennie | |
undo this. |
brennie | |
Missing a period. |
brennie | |
No blank line here. |
brennie | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
isinstance(entry, ReviewEntry) |
brennie | |
These are only used in one place, so just put them inline. |
brennie | |
Col: 80 E501 line too long (86 > 79 characters) |
reviewbot | |
This should be if isinstance(latest_reply, basestring)) |
brennie | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
This should be if last_visited != 0 and isinstance(last_visited, basestring)) |
brennie | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 W291 trailing whitespace |
reviewbot | |
This should be formatted as: collapsed = ( review.timestmap < oldest_allowed_time and (latest_reply is None or (latest_reply < oldest_allowed_time and … |
brennie | |
Col: 25 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 25 W503 line break before binary operator |
reviewbot | |
Col: 50 W291 trailing whitespace |
reviewbot | |
Col: 30 W503 line break before binary operator |
reviewbot | |
Col: 68 W291 trailing whitespace |
reviewbot | |
Col: 34 W503 line break before binary operator |
reviewbot | |
Undo this. |
brennie | |
from datetime import datetime, timedelta |
brennie | |
'datetime' imported but unused |
reviewbot | |
Col: 80 E501 line too long (85 > 79 characters) |
reviewbot | |
'ReviewRequest' imported but unused |
reviewbot | |
Undo this. |
brennie | |
Col: 19 E222 multiple spaces after operator |
reviewbot | |
local variable 'diffset' is assigned to but never used |
reviewbot | |
local variable 'user2' is assigned to but never used |
reviewbot | |
Col: 22 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (91 > 79 characters) |
reviewbot | |
Col: 9 E265 block comment should start with '# ' |
reviewbot | |
These should all be in one group. Imports go as follows: from __future import unicode_literals python stdlib imports 3rdpart imports … |
brennie | |
isinstance(i, cls) returns a bool. |
brennie | |
latest_reply_timestamp |
brennie | |
If it is not a string, what is it? If it is string or None, then you can just do … |
brennie | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
latest_reply_time |
brennie | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
W\hy would it be 0 or a string? |
brennie | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
last_visited_time |
brennie | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 9 E303 too many blank lines (2) |
reviewbot | |
Col: 69 E261 at least two spaces before inline comment |
reviewbot | |
Col: 70 E262 inline comment should start with '# ' |
reviewbot | |
Col: 69 E261 at least two spaces before inline comment |
reviewbot | |
Col: 70 E262 inline comment should start with '# ' |
reviewbot | |
Col: 78 E261 at least two spaces before inline comment |
reviewbot | |
Col: 79 E262 inline comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (88 > 79 characters) |
reviewbot | |
Col: 78 E261 at least two spaces before inline comment |
reviewbot | |
Col: 79 E262 inline comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (88 > 79 characters) |
reviewbot | |
Col: 78 E261 at least two spaces before inline comment |
reviewbot | |
Col: 79 E262 inline comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (90 > 79 characters) |
reviewbot | |
Col: 78 E261 at least two spaces before inline comment |
reviewbot | |
Col: 79 E262 inline comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (89 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (98 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
local variable 'last_visited' is assigned to but never used |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 29 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 29 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 26 E127 continuation line over-indented for visual indent |
reviewbot | |
Rename latest_reply_timestamp variable name |
MB mbalogh | |
I will say use review_timestamp since you declared it. |
LA larmiej | |
This comment doesn't make sense to me. Can you flesh it out? |
david | |
Comments should include periods at the end. Several other instances in this same method. |
david | |
This can use zip. You're also not saving any queries by using .update() in this way. How about: for review, … |
david | |
This could be: self.assertEqual( [entry.collapsed for entry in entries], expected_values) |
david | |
It doesn't make sense to use indices here. for entry in entries: self.assertEqual(entry.collapsed, False) |
david | |
Same comment as above re: direct iteration. |
david | |
Same comment as above re: the expected_values check. |
david | |
This is adding a new query for something which we already are fetching below. Instead of adding this, how about … |
david | |
One major problem that this introduces is that a ChangeEntry or InitialStatusUpdatesEntry which contains multiple reviews (those attached to a … |
david | |
What is "allowed" time? |
david | |
In this case, it's probably cleaner to format this as: latest_reply_timestamp = \ data.latest_timestamps_by_review_id.get(review.pk) |
david | |
This should all not be necessary anymore, right? |
david | |
Draft reviews aren't shown in the review list. This can go away. |
david | |
Indentation is a little off here. Should be: if (last_visited_time <= review_timestamp or (latest_reply_timestamp is not None and last_visited_time <= … |
david | |
Too many blank lines here. |
david | |
Why this change? |
david | |
Something's weird with your change and what its parent commit is. This shouldn't be showing up in your diff. |
david | |
'ReviewRequestDraft' imported but unused |
reviewbot | |
local variable 'filediff' is assigned to but never used |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 19 E222 multiple spaces after operator |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
This shouldn't be possible. Only top-level reviews get their own entry. |
david | |
This will do the wrong thing for entries that are not ReviewEntry. We should just move this assignment into the … |
david | |
You shouldn't need any special cases for these--they show up in reviews_entry_map. |
david | |
Col: 13 E303 too many blank lines (2) |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 12 E114 indentation is not a multiple of four (comment) |
reviewbot | |
Col: 80 E501 line too long (91 > 79 characters) |
reviewbot | |
Col: 17 E116 unexpected indentation (comment) |
reviewbot | |
Col: 17 E265 block comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (85 > 79 characters) |
reviewbot | |
Col: 17 E116 unexpected indentation (comment) |
reviewbot | |
Col: 17 E265 block comment should start with '# ' |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 13 E303 too many blank lines (2) |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 13 E265 block comment should start with '# ' |
reviewbot | |
Col: 13 E303 too many blank lines (3) |
reviewbot | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 1 W293 blank line contains whitespace |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 50 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 50 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 40 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 50 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 40 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 41 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 51 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 41 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 50 E127 continuation line over-indented for visual indent |
reviewbot | |
'StatusUpdate' imported but unused |
reviewbot | |
Col: 21 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 21 E127 continuation line over-indented for visual indent |
reviewbot | |
You might want to split this up into multiple tests since it does a lot. |
brennie | |
No period for test docstrings (the test runner adds periods). |
brennie | |
No blank line here. |
brennie | |
Comments should almost always be complete sentences and they should begin with a capital. |
brennie | |
Why are there more than six entries here? |
brennie | |
Blank line between these. |
brennie | |
You should be building the URL using reverse(). Same elsewhere. |
brennie | |
Missing docstring. This test is gigantic and should be split up into multiple tests. |
brennie | |
datetime is a python stdlib import. |
brennie | |
Move the comment into the docstring. |
brennie | |
Blank line between these. |
brennie | |
Blank line between these. |
brennie | |
Col: 80 E501 line too long (89 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (89 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (89 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (92 > 79 characters) |
reviewbot | |
Col: 89 E226 missing whitespace around arithmetic operator |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 5 E303 too many blank lines (3) |
reviewbot |
- Change Summary:
-
Collapsing all reviews except:
Ones with open issues
Drafts
Recently posted - Not working for replies yet - Commit:
-
fe5ec91bbdbddc35d0852df14b02d873b495449d96ba9c286c77c89aa9ff1c78136c4a58b460e42d
- Diff:
-
Revision 2 (+90 -11)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Collapsing old review functionality is mostly implemented.
- Commit:
-
96ba9c286c77c89aa9ff1c78136c4a58b460e42d2a22adbd330459f2dc15b2ef7699e92ccb8e853c
- Diff:
-
Revision 3 (+52 -20)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Basic tests implemented
- Branch:
-
release-3.0.xmaster
- Commit:
-
2a22adbd330459f2dc15b2ef7699e92ccb8e853cc21ef08d2d70d79014fc1fdd7834fa89d5093c7e
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/tests/test_views.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/tests/test_views.py WARNING: Number of comments exceeded maximum, showing 30 of 44.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Instead of keeping track of
i
manually, you can do:for i, review in enumerate(review_request.reviews.all()): Review.objects.filter(pk=review.pk).update(timestamp=timestamp[i])
-
-
-
-
-
-
-
-
-
-
This should be formatted as:
collapsed = ( review.timestmap < oldest_allowed_time and (latest_reply is None or (latest_reply < oldest_allowed_time and last_visited != 0 and latest_reply < last_visited)) )
-
- Change Summary:
-
Style Fixes
- Commit:
-
c21ef08d2d70d79014fc1fdd7834fa89d5093c7e838d49a2c898e6919e476baaae7baa32dfbce1f0
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Tests written and working.
- Commit:
-
838d49a2c898e6919e476baaae7baa32dfbce1f02b8c039719a1aa6efb8cc9b70c34382658d20b7a
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Updated summary, description and testing fields.
- Summary:
-
Collapsing Old Reviews on Review Requests [WIP]Collapsing Old Reviews on Review Requests
- Description:
-
~ On very active review requests, it can be hard to track what discussions (reviews, replies) are new.
~ The goal is to collapse old reviews so that it is easier to see what is new. ~ We want to promote discussion and foster ease of use for the site.
~ On active or old review requests it can be hard to track whats happening. + This can be helped by collapsing inactive reviews. + This makes it easier to browse and see whats new. + + This is done by implementing logic such that:
+ 1. If the review hasn't been seen (by this user), show it + 2. If the review is new, show it + 3. If there is a new reply, show the review + 3. If the user has a draft for that review, show it + 4. If there are open issues for the review, show it + 5. Otherwise, hide it (via collapsing) - Testing Done:
-
+ Tested by hand to make sure everything works
+ Unit tests written: + 1. Test old review + 2. Test new review + 3. Test review with old reply + 4. Test review with new reply + 5. Test review with draft for user + 6. Test review with draft for another user + 7. Test review with open issue + 8. Test all of the above when logged out + 9. Test all of the above with user who hasn't visited before + 10. Repeat test with same user now that they've visited
- Change Summary:
-
Style fixes.
- Commit:
-
2b8c039719a1aa6efb8cc9b70c34382658d20b7a685746adf54d6f2b2e6896139a0371731bdd3b9d
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py
- Change Summary:
-
Removed uneeded isInstance call.
- Commit:
-
685746adf54d6f2b2e6896139a0371731bdd3b9d12da016b8c7d609e0850f03c3d0f409c546adaf4
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py
- Change Summary:
-
Made to work with fix for lastest timestamp.
- Depends On:
-
- Commit:
12da016b8c7d609e0850f03c3d0f409c546adaf468132cfe3420e10a28c1003f5be6b4b7a7b50686
- Change Summary:
-
Rebased onto master
- Commit:
-
68132cfe3420e10a28c1003f5be6b4b7a7b50686c80188d130fcc2ed776cac77de5a55813f7947e4
-
-
-
-
This can use
zip
. You're also not saving any queries by using.update()
in this way. How about:for review, timestamp in zip(review_request.reviews.all(), timestamps): review.timestamp = timestamp review.save(update_fields=['timestamp'])
-
-
It doesn't make sense to use indices here.
for entry in entries: self.assertEqual(entry.collapsed, False)
-
-
-
This is adding a new query for something which we already are fetching below.
Instead of adding this, how about changing it so the default value of
last_visited
isdatetime.min
, and then conditionalize the new assignment oflast_visited
on line 358 to only happen ifvisited_is_new
isFalse
? -
One major problem that this introduces is that a ChangeEntry or InitialStatusUpdatesEntry which contains multiple reviews (those attached to a StatusUpdate) will no longer get expanded in cases where there are new replies or draft replies. Instead of looping over
entries
and only making changes toReviewEntry
subclasses, perhaps we can loop overdata.reviews
, bailing early ifreview.base_reply_to_id
is notNone
.We'd then potentially have the situation there where one review in an entry would want it expanded but another would want it collapsed. Perhaps the right solution is to start with review entries collapsed, and then conditionally expand them if there's something interesting.
-
-
In this case, it's probably cleaner to format this as:
latest_reply_timestamp = \ data.latest_timestamps_by_review_id.get(review.pk)
-
-
-
Indentation is a little off here. Should be:
if (last_visited_time <= review_timestamp or (latest_reply_timestamp is not None and last_visited_time <= latest_reply_timestamp)): collapsed = False
It also seems like this could be combined with the "oldest allowed time" check above in some way--the code is very similar.
-
-
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py reviewboard/reviews/detail.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py reviewboard/reviews/detail.py
- Change Summary:
-
Added code to support StatusUpdates
- Commit:
-
c80188d130fcc2ed776cac77de5a55813f7947e428c0495e49e5232c84f36c933ebd2a758d42a6d1
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py reviewboard/reviews/detail.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py reviewboard/reviews/detail.py
-
-
-
-
-
-
-
Looking at your logic, I think it's a bit overcomplicated and fragile, the way that you're special casing each type of entry.
Instead, how about:
- Default every entry which contains one or more reviews to collapsed.
- Iterate over every review in
reviews_entry_map
. If the review has a reason to not be collapsed, expand the relevant entry.
-
Something's weird with your change and what its parent commit is. This shouldn't be showing up in your diff.
-
-
This will do the wrong thing for entries that are not
ReviewEntry
. We should just move this assignment into theif
statement. -
- Change Summary:
-
Cleaned up code logic and wrote basic tests for StatusUpdates. Still WIP
- Commit:
-
28c0495e49e5232c84f36c933ebd2a758d42a6d15d455898a5d1a25f10d7ef25506603ca45f61de6
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py reviewboard/reviews/detail.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py reviewboard/reviews/detail.py WARNING: Number of comments exceeded maximum, showing 30 of 35.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Removed special cases and finished tests.
- Commit:
-
5d455898a5d1a25f10d7ef25506603ca45f61de67318ba96813fe30d4ac66bae840a8a78a4c850f4
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py reviewboard/reviews/detail.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py reviewboard/reviews/detail.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Rebased to master.
- Commit:
-
7318ba96813fe30d4ac66bae840a8a78a4c850f425a0dc6fa3aadddb9d1af850f11faed59ba513cc
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py
- Change Summary:
-
Split the large tests into many smaller ones and added docstrings.
- Commit:
-
25a0dc6fa3aadddb9d1af850f11faed59ba513cc2c69aa0fca445ce66a027a530f58a22c722585d0
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py
-
-
-
-
-
- Change Summary:
-
Style Fixes.
- Commit:
-
2c69aa0fca445ce66a027a530f58a22c722585d0785a208caee0f97da9a1bf0ea2926c5d3190f5e0
- Change Summary:
-
Minor fixes.
- Commit:
-
785a208caee0f97da9a1bf0ea2926c5d3190f5e0aeccaba6c42ac4fb5b237af0ab8ca7aad00bb818
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/tests/test_views.py
-
-
-
-
- Change Summary:
-
Style Fixes
- Commit:
-
aeccaba6c42ac4fb5b237af0ab8ca7aad00bb81899fff3222713a2a3ad4c8496d3a28951ace72f27