-
-
-
-
-
-
-
reviewboard/reviews/views.py (Diff revision 1) Col: 23 E261 at least two spaces before inline comment
-
-
reviewboard/reviews/views.py (Diff revision 1) Col: 22 E261 at least two spaces before inline comment
-
-
-
-
-
reviewboard/reviews/views.py (Diff revision 1) Col: 26 E261 at least two spaces before inline comment
-
-
-
-
-
-
-
-
-
-
-
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: |
|
||||
---|---|---|---|---|---|
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: |
|
||||
---|---|---|---|---|---|
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: |
|
||||
---|---|---|---|---|---|
Commit: |
|
||||
Diff: |
Revision 4 (+133 -17) |
-
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.
-
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 80 E501 line too long (85 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) local variable 'comment_text_1' is assigned to but never used
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) local variable 'comment_text_2' is assigned to but never used
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) local variable 'comment_text_3' is assigned to but never used
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 1 W293 blank line contains whitespace
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) local variable 'filediff' is assigned to but never used
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) local variable 'user2' is assigned to but never used
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) local variable 'review_one' is assigned to but never used
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 80 E501 line too long (81 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) local variable 'review_two' is assigned to but never used
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 80 E501 line too long (81 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 80 E501 line too long (83 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) local variable 'reply_for_three' is assigned to but never used
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 80 E501 line too long (82 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) local variable 'reply_for_four' is assigned to but never used
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 1 W293 blank line contains whitespace
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 80 E501 line too long (86 > 79 characters)
-
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 80 E501 line too long (83 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 1 W293 blank line contains whitespace
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 1 W293 blank line contains whitespace
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 80 E501 line too long (91 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 9 E265 block comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) Col: 1 W293 blank line contains whitespace
-
-
-
-
-
-
-
-
reviewboard/reviews/views.py (Diff revision 4) Col: 25 E127 continuation line over-indented for visual indent
-
-
-
-
-
-
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) 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])
-
reviewboard/reviews/tests/test_views.py (Diff revision 4) No
print()
in unit tests. YOu can add a message toself.assertEqual
as the third argument. -
-
-
-
-
-
reviewboard/reviews/views.py (Diff revision 4) These are only used in one place, so just put them inline.
-
reviewboard/reviews/views.py (Diff revision 4) This should be
if isinstance(latest_reply, basestring))
-
reviewboard/reviews/views.py (Diff revision 4) This should be
if last_visited != 0 and isinstance(last_visited, basestring))
-
reviewboard/reviews/views.py (Diff revision 4) 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: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+122 -15) |
-
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
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 5) Col: 80 E501 line too long (85 > 79 characters)
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 5) Col: 19 E222 multiple spaces after operator
-
reviewboard/reviews/tests/test_views.py (Diff revision 5) local variable 'diffset' is assigned to but never used
-
reviewboard/reviews/tests/test_views.py (Diff revision 5) local variable 'user2' is assigned to but never used
-
reviewboard/reviews/tests/test_views.py (Diff revision 5) Col: 22 E128 continuation line under-indented for visual indent
-
reviewboard/reviews/tests/test_views.py (Diff revision 5) Col: 80 E501 line too long (91 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 5) Col: 9 E265 block comment should start with '# '
-
-
-
-
-
-
-
-
-
reviewboard/reviews/views.py (Diff revision 5) These should all be in one group.
Imports go as follows:
from __future import unicode_literals python stdlib imports 3rdpart imports project imports
Imports of the form
from foo import bar
come afterimport foo
. Both should be in alphabetical order. -
-
-
reviewboard/reviews/views.py (Diff revision 5) If it is not a string, what is it?
If it is string or
None
, then you can just doif latest_reply:
-
-
-
Change Summary:
Tests written and working.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 6 (+148 -14) |
-
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
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 69 E261 at least two spaces before inline comment
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 70 E262 inline comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 69 E261 at least two spaces before inline comment
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 70 E262 inline comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 78 E261 at least two spaces before inline comment
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 79 E262 inline comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 80 E501 line too long (88 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 78 E261 at least two spaces before inline comment
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 79 E262 inline comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 80 E501 line too long (88 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 78 E261 at least two spaces before inline comment
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 79 E262 inline comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 80 E501 line too long (90 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 78 E261 at least two spaces before inline comment
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 79 E262 inline comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 80 E501 line too long (89 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 6) Col: 80 E501 line too long (98 > 79 characters)
-
-
reviewboard/reviews/views.py (Diff revision 6) local variable 'last_visited' is assigned to but never used
-
-
reviewboard/reviews/views.py (Diff revision 6) Col: 29 E128 continuation line under-indented for visual indent
-
reviewboard/reviews/views.py (Diff revision 6) Col: 29 E128 continuation line under-indented for visual indent
-
reviewboard/reviews/views.py (Diff revision 6) Col: 26 E127 continuation line over-indented for visual indent
Change Summary:
Updated summary, description and testing fields.
Summary: |
|
||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||||||||||||||||||||||||||
Testing Done: |
|
Change Summary:
Style fixes.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 7 (+152 -17) |
-
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: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 8 (+152 -17) |
-
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
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 8) Might be missing something here, but doesn't this need to have a name like
test_review_detail_collapse
?
-
-
reviewboard/reviews/views.py (Diff revision 8) I will say use
review_timestamp
since you declared it.
Change Summary:
Made to work with fix for lastest timestamp.
Depends On: |
|
||||
---|---|---|---|---|---|
Commit: |
|
||||
Diff: |
Revision 9 (+158 -21) |
Change Summary:
Rebased onto master
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 10 (+152 -16) |
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 10) This comment doesn't make sense to me. Can you flesh it out?
-
reviewboard/reviews/tests/test_views.py (Diff revision 10) Comments should include periods at the end. Several other instances in this same method.
-
reviewboard/reviews/tests/test_views.py (Diff revision 10) 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'])
-
reviewboard/reviews/tests/test_views.py (Diff revision 10) This could be:
self.assertEqual( [entry.collapsed for entry in entries], expected_values)
-
reviewboard/reviews/tests/test_views.py (Diff revision 10) It doesn't make sense to use indices here.
for entry in entries: self.assertEqual(entry.collapsed, False)
-
reviewboard/reviews/tests/test_views.py (Diff revision 10) Same comment as above re: direct iteration.
-
reviewboard/reviews/tests/test_views.py (Diff revision 10) Same comment as above re: the expected_values check.
-
reviewboard/reviews/views.py (Diff revision 10) 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
? -
reviewboard/reviews/views.py (Diff revision 10) 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.
-
-
reviewboard/reviews/views.py (Diff revision 10) In this case, it's probably cleaner to format this as:
latest_reply_timestamp = \ data.latest_timestamps_by_review_id.get(review.pk)
-
-
reviewboard/reviews/views.py (Diff revision 10) Draft reviews aren't shown in the review list. This can go away.
-
reviewboard/reviews/views.py (Diff revision 10) 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: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 11 (+294 -23) |
-
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
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 11) local variable 'filediff' is assigned to but never used
-
reviewboard/reviews/tests/test_views.py (Diff revision 11) Col: 80 E501 line too long (81 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 11) Col: 80 E501 line too long (83 > 79 characters)
-
-
-
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.
-
reviewboard/reviews/detail.py (Diff revision 11) Something's weird with your change and what its parent commit is. This shouldn't be showing up in your diff.
-
reviewboard/reviews/views.py (Diff revision 11) This shouldn't be possible. Only top-level reviews get their own entry.
-
reviewboard/reviews/views.py (Diff revision 11) This will do the wrong thing for entries that are not
ReviewEntry
. We should just move this assignment into theif
statement. -
reviewboard/reviews/views.py (Diff revision 11) You shouldn't need any special cases for these--they show up in
reviews_entry_map
.
Change Summary:
Cleaned up code logic and wrote basic tests for StatusUpdates. Still WIP
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 12 (+411 -30) |
-
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.
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 13 E265 block comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 13 E265 block comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 13 E265 block comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 12 E114 indentation is not a multiple of four (comment)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 80 E501 line too long (91 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 17 E116 unexpected indentation (comment)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 17 E265 block comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 80 E501 line too long (85 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 17 E116 unexpected indentation (comment)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 17 E265 block comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 13 E265 block comment should start with '# '
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 80 E501 line too long (83 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 80 E501 line too long (84 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 80 E501 line too long (82 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 13 E265 block comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 80 E501 line too long (83 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 13 E265 block comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 13 E265 block comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 80 E501 line too long (83 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 13 E265 block comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 13 E265 block comment should start with '# '
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 80 E501 line too long (83 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 13 E265 block comment should start with '# '
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 80 E501 line too long (84 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 80 E501 line too long (84 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 80 E501 line too long (83 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 12) Col: 1 W293 blank line contains whitespace
Change Summary:
Removed special cases and finished tests.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 13 (+528 -24) |
-
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
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 80 E501 line too long (81 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 80 E501 line too long (83 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 80 E501 line too long (84 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 50 E127 continuation line over-indented for visual indent
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 80 E501 line too long (83 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 80 E501 line too long (82 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 50 E127 continuation line over-indented for visual indent
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 40 E128 continuation line under-indented for visual indent
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 50 E127 continuation line over-indented for visual indent
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 40 E128 continuation line under-indented for visual indent
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 41 E127 continuation line over-indented for visual indent
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 51 E127 continuation line over-indented for visual indent
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 41 E127 continuation line over-indented for visual indent
-
reviewboard/reviews/tests/test_views.py (Diff revision 13) Col: 50 E127 continuation line over-indented for visual indent
-
-
reviewboard/reviews/views.py (Diff revision 13) Col: 21 E127 continuation line over-indented for visual indent
-
reviewboard/reviews/views.py (Diff revision 13) Col: 21 E127 continuation line over-indented for visual indent
Change Summary:
Rebased to master.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 14 (+517 -19) |
-
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
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 14) You might want to split this up into multiple tests since it does a lot.
-
reviewboard/reviews/tests/test_views.py (Diff revision 14) No period for test docstrings (the test runner adds periods).
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 14) Comments should almost always be complete sentences and they should begin with a capital.
-
reviewboard/reviews/tests/test_views.py (Diff revision 14) Why are there more than six entries here?
-
-
reviewboard/reviews/tests/test_views.py (Diff revision 14) You should be building the URL using
reverse()
. Same elsewhere. -
reviewboard/reviews/tests/test_views.py (Diff revision 14) Missing docstring.
This test is gigantic and should be split up into multiple tests.
-
-
-
-
Change Summary:
Split the large tests into many smaller ones and added docstrings.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 15 (+525 -20) |
-
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
-
reviewboard/reviews/tests/test_views.py (Diff revision 15) Col: 80 E501 line too long (89 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 15) Col: 80 E501 line too long (89 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 15) Col: 80 E501 line too long (89 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 15) Col: 80 E501 line too long (92 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 15) Col: 89 E226 missing whitespace around arithmetic operator
Change Summary:
Style Fixes.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 16 (+530 -20) |
-
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
-
reviewboard/reviews/tests/test_views.py (Diff revision 16) Col: 80 E501 line too long (80 > 79 characters)
Change Summary:
Minor fixes.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 17 (+542 -22) |
-
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
-
reviewboard/reviews/tests/test_views.py (Diff revision 17) Col: 80 E501 line too long (80 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 17) Col: 80 E501 line too long (80 > 79 characters)
-
reviewboard/reviews/tests/test_views.py (Diff revision 17) Col: 80 E501 line too long (80 > 79 characters)
-
Change Summary:
Style Fixes
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 18 (+540 -22) |