Build GeneralComment Model
Review Request #6375 — Created Sept. 26, 2014 and submitted
Reviewboard currently support 3 types of comments: Diff commment, File attachment comments, Screenshot comments.
This is a new type of comments: General comments.A general comment on a review request is used when a comment is not tied to specific lines of code or a special file attachment, and an issue is opened. Examples include suggestions for testing or pointing out errors in the change description.
This review request is for GeneralComment backend model.
Five test added in reviews/tests.py:
1. test_review_detail_general_comment_ordering
2. test_init_with_general_comments
3. test_init_with_mix
4. test_init_general_comment_with_replies
5. test_save_reply_comment_to_general_commentAll test passed.
Previously test 1 failed due to use diff viewer 'get' method on general comments.
Figured out general comments behave the same as screenshot/file attachment comments.
Description | From | Last Updated |
---|---|---|
'models' imported but unused |
reviewbot | |
'six' imported but unused |
reviewbot | |
'_' imported but unused |
reviewbot | |
'BaseComment' imported but unused |
reviewbot | |
Col: 1 E265 block comment should start with '# ' |
reviewbot | |
Col: 11 W292 no newline at end of file |
reviewbot | |
Col: 1 E265 block comment should start with '# ' |
reviewbot | |
Is this supposed to match raw_id_fields? If so, it's missing an 'e' in "general" |
AD adrw.hong | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
'models' imported but unused |
reviewbot | |
'_' imported but unused |
reviewbot | |
Something you might want to consider is encapsulating this notion of a comment's context within each type of comment. For … |
ML mloyzer | |
list comprehension redefines 'file_attachment' from line 585 |
reviewbot | |
undefined name 'issue_opened' |
reviewbot | |
undefined name 'issue_opened' |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
'models' imported but unused |
reviewbot | |
'_' imported but unused |
reviewbot | |
list comprehension redefines 'file_attachment' from line 585 |
reviewbot | |
undefined name 'issue_opened' |
reviewbot | |
undefined name 'issue_opened' |
reviewbot | |
list comprehension redefines 'file_attachment' from line 585 |
reviewbot | |
Shouldn't this be in the API change? (/r/6431) |
david | |
Col: 57 W292 no newline at end of file |
reviewbot | |
Col: 29 W292 no newline at end of file |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Should this be "gcomment"? |
brennie | |
Generally, we like to keep these in alphabetical order. FileAttachmentComment clearly isn't, but can you reorder these so they'll be … |
chipx86 | |
Should be text. (We fixed the above cases recently.) |
chipx86 | |
Same comment about order. |
chipx86 | |
This should be fleshed out more to describe the purpose of these comments. Also, you should always use complete sentences … |
chipx86 | |
Should use single quotes. |
chipx86 | |
Single quotes. |
chipx86 | |
Alphabetical order. |
chipx86 | |
These should be single quotes as well. |
ML mloyzer | |
Alphabetical order. |
chipx86 | |
This is unrelated to your change. Can you revert it? |
chipx86 | |
Why is there an apostrophe(,) at the end of this function call? |
justy777 | |
and here. |
justy777 | |
This should probably be more specific, like: "A comment on a review request not tied to code or a file." |
chipx86 | |
"Examples" and "testing". |
chipx86 | |
Why not use a list instead of 3 variables? |
justy777 | |
There should be a blank line between these lines. |
justy777 | |
Should use a loop instead of repeating a function call. for _ in range(3): <function here> |
justy777 | |
There should be a trailing apostrophe(,) after 'general_comments': [] |
justy777 | |
Minor grammar fix, it should read: "...review request that is not tied..." |
AD adrw.hong |
- Groups:
- Description:
-
Building the general comment model.
Create a new class called GeneralComment using base class BaseComment. get_absolute_url() to be determined. ~ Need to integrated with review.py(review model) and view.py(entire page view model). ~ Need to integrated with review.py(review model) and view.py(entire page view model). + + Modified lines are commennted since I still want to test with the server.
Work in Progress.
- Summary:
-
[WIP]Build GeneralComment ModelBuild GeneralComment Model
- Testing Done:
-
+ Server can be launched without error.
+ No additional test is written. - Diff:
-
Revision 2 (+99 -24)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/admin.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/admin.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py
-
-
-
-
-
-
- Description:
-
~ Building the general comment model.
~ Create a new class called GeneralComment using base class BaseComment. ~ The general comment model is built.
~ Created a new class called GeneralComment using base class BaseComment. - get_absolute_url() to be determined. - Need to integrated with review.py(review model) and view.py(entire page view model). ~ Modified lines are commennted since I still want to test with the server.
~ Work in Progress. ~ TODO:
~ 1. integration with web-api + 2. javascript front-end
-
-
Something you might want to consider is encapsulating this notion of a comment's context within each type of comment. For example you can then just to:
context_id = comment.get_context_id() if bool(comment)
or use the original condition comment != "" instead of converting it to a boolean value.
It reduces to having this context logic outside the class it represents. This is just my opinion though, it would be interesting for one of the mentors to give their input but both ways are valid.
- Commit:
-
3e6f373c76a55bb9b8045a59f93a16c9ce8c209a63c3fdfc449557cd3b1ead33adcd97596871f953
- Diff:
-
Revision 3 (+99 -24)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/admin.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/admin.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py
-
-
-
-
-
-
- Commit:
-
63c3fdfc449557cd3b1ead33adcd97596871f953b43614d00d300338a9f66809b3622170de127edd
- Diff:
-
Revision 4 (+97 -24)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/admin.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/webapi/resources/__init__.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/admin.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py
-
- Summary:
-
Build GeneralComment Model[WIP]Build GeneralComment Model
- Description:
-
The general comment model is built.
Created a new class called GeneralComment using base class BaseComment. ~ TODO:
~ 1. integration with web-api ~ Todo:
~ Debuging till all tests passed. - 2. javascript front-end - Testing Done:
-
~ Server can be launched without error.
~ No additional test is written. ~ Five test added in reviews/tests.py:
~ 1. test_review_detail_general_comment_ordering + 2. test_init_with_general_comments + 3. test_init_with_mix + 4. test_init_general_comment_with_replies + 5. test_save_reply_comment_to_general_comment + + Testing Result:
+ Failing Test 1 & 3 + Test 1 fails at: self.assertEqual(len(comments), 3) + Test 3 fails at: self.assertEqual(self.review_request.issue_open_count, 10) - Commit:
-
b43614d00d300338a9f66809b3622170de127edd646687a21aacdf5a341dff99f60d2e719e882038
- Diff:
-
Revision 5 (+224 -23)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/notifications/tests.py reviewboard/reviews/tests.py reviewboard/reviews/admin.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/templatetags/reviewtags.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/notifications/tests.py reviewboard/reviews/tests.py reviewboard/reviews/admin.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/templatetags/reviewtags.py
-
-
-
- Commit:
-
646687a21aacdf5a341dff99f60d2e719e8820381916ed9cc4a89d79044bf95880ed70c9abcd6dd2
- Diff:
-
Revision 6 (+226 -23)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/notifications/tests.py reviewboard/reviews/tests.py reviewboard/reviews/admin.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/templatetags/reviewtags.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/notifications/tests.py reviewboard/reviews/tests.py reviewboard/reviews/admin.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/templatetags/reviewtags.py
- Description:
-
The general comment model is built.
Created a new class called GeneralComment using base class BaseComment. Todo:
~ Debuging till all tests passed. ~ Debuging till test 1 passed. - Testing Done:
-
Five test added in reviews/tests.py:
1. test_review_detail_general_comment_ordering 2. test_init_with_general_comments 3. test_init_with_mix 4. test_init_general_comment_with_replies 5. test_save_reply_comment_to_general_comment Testing Result:
~ Failing Test 1 & 3 ~ Test 1 fails at: self.assertEqual(len(comments), 3) ~ Test 3 fails at: self.assertEqual(self.review_request.issue_open_count, 10) ~ Failing Test 1: at line 874, 875 ~ The ordering on the page is wrong. ~ should be 3->2, given 2->3 + + checked timestamp: timestamp(2) > timestamp(3)
+ haven't figure out why the ordering is wrong - Commit:
-
1916ed9cc4a89d79044bf95880ed70c9abcd6dd2cf7e34ba63330d877d8f7f1979d38388851eb005
- Diff:
-
Revision 7 (+228 -24)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/notifications/tests.py reviewboard/reviews/tests.py reviewboard/reviews/admin.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/templatetags/reviewtags.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/notifications/tests.py reviewboard/reviews/tests.py reviewboard/reviews/admin.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/templatetags/reviewtags.py
- Summary:
-
[WIP]Build GeneralComment ModelBuild GeneralComment Model
- Description:
-
The general comment model is built.
Created a new class called GeneralComment using base class BaseComment. - - Todo:
- Debuging till test 1 passed. - Testing Done:
-
Five test added in reviews/tests.py:
1. test_review_detail_general_comment_ordering 2. test_init_with_general_comments 3. test_init_with_mix 4. test_init_general_comment_with_replies 5. test_save_reply_comment_to_general_comment ~ Testing Result:
~ All test passed.
- Failing Test 1: at line 874, 875 - The ordering on the page is wrong. - should be 3->2, given 2->3 ~ checked timestamp: timestamp(2) > timestamp(3)
~ haven't figure out why the ordering is wrong ~ Previously test 1 failed due to use diff viewer 'get' method on general comments.
~ Figured out general comments behave the same as screenshot/file attachment comments. - Diff:
-
Revision 8 (+228 -24)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/notifications/tests.py reviewboard/reviews/tests.py reviewboard/reviews/admin.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/templatetags/reviewtags.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/notifications/tests.py reviewboard/reviews/tests.py reviewboard/reviews/admin.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/templatetags/reviewtags.py
- Commit:
-
cf7e34ba63330d877d8f7f1979d38388851eb00515323ae10ef71324d8effd5e64c39f6a3f2a8816
- Diff:
-
Revision 9 (+210 -24)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/tests.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/tests.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py
- Commit:
-
15323ae10ef71324d8effd5e64c39f6a3f2a8816db01216b35eecd70fa68885dc9582cc5c79936f4
- Diff:
-
Revision 10 (+213 -24)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/tests.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/tests.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py
- Commit:
-
db01216b35eecd70fa68885dc9582cc5c79936f42bc2e2f320aa9e98088cdaf9fc3299798a24aa55
- Diff:
-
Revision 11 (+213 -24)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/tests.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/tests.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py
-
Looking great! A few small comments.
-
Generally, we like to keep these in alphabetical order.
FileAttachmentComment
clearly isn't, but can you reorder these so they'll be in the right order? -
-
-
This should be fleshed out more to describe the purpose of these comments.
Also, you should always use complete sentences with trailing periods.
For reference, multi-line docstrings are in the form of:
"""Single-line summary. Multi-line docstring. """
-
-
-
-
-
- Commit:
-
2bc2e2f320aa9e98088cdaf9fc3299798a24aa5513ac8eb929eae303aba325e15f6464441235f9c2
- Diff:
-
Revision 12 (+223 -27)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/tests.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/tests.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py
- Commit:
-
13ac8eb929eae303aba325e15f6464441235f9c20c9a220772d3669ec86418acbae4dea4aea26972
- Diff:
-
Revision 13 (+225 -28)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/tests.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/managers.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/tests.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/managers.py
- Commit:
-
0c9a220772d3669ec86418acbae4dea4aea2697209664a6c4070138942079007b173052b3ce09e2f
- Diff:
-
Revision 14 (+225 -28)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/tests.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/managers.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/tests.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/managers.py
- Description:
-
~ The general comment model is built.
~ Created a new class called GeneralComment using base class BaseComment. ~ Reviewboard currently support 3 types of comments: Diff commment, File attachment comments, Screenshot comments.
~ This is a new type of comments: General comments. + + A general comment on a review request is used when a comment is not tied to specific lines of code or a special file attachment, and an issue is opened. Examples include suggestions for testing or pointing out errors in the change description.
+ + This review request is for GeneralComment backend model.
- Commit:
-
09664a6c4070138942079007b173052b3ce09e2fcd5ccbf9a9e5e07d1f6cae8e41671e43b8f8baa9
- Diff:
-
Revision 15 (+225 -28)
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/tests.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/managers.py Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/testing/testcase.py reviewboard/reviews/admin.py reviewboard/reviews/templatetags/reviewtags.py reviewboard/reviews/tests.py reviewboard/reviews/models/__init__.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/review.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/managers.py