Add root comments APIs

Review Request #12037 — Created Feb. 4, 2022 and discarded

Information

Review Board
master

Reviewers

  • Registered root diff comments, root file attachment comments and root general comments API
  • Support GET method for list resources with query parameter:
  • Shared query parameters : review-request-id=<review-request-id> , review-id=<review-id>, user=<user-username>, is-reply
  • file-diff-id, line and interdiff-revision for diff comments, and file-attachment-id file-name for file attachment comments
  • Unit tests suites for comments API
  • Added added webapi_request_fields decorator to get_list for request parameters documentation
  • Updated the WebAPI documentations
  • Added unit tests for diff-comment, general-comment and file-attachment-comment with list resource and GET method
Summary ID Author
register comments root APIs
7697a1e0439c7a09f66f69018512b1d9d62e586d charlie-xiang
fix a bug in base file attachment comment from last commit
b2be67042a927571a7bb4d876632c28c576a5a41 charlie-xiang
add user name filter and add diff comment test suites
c3357d44d9b108848863dcc1f3e25fab012453e9 charlie-xiang
add user tests to diff comment
26b7346d85eeb5e28094a56d7313e8d3ce575996 charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
31fbbc2ad10218658aab0518b2525c5ee27bf609 charlie-xiang
add last-updated-from, to and is_reply filters
c062506ea81a860c09d0b08baafcd5d88909e0fb charlie-xiang
address reviews feedback
7ab70cc20ad219423ec49ade08b55e33c0e49853 charlie-xiang
added tests for last-updated and is-reply
a35f5434b4190a51f9cae711695945d161113543 charlie-xiang
add webapi_request_fields documentations and resource class docstring
5033f62280090aff629e91710f280cd346d36f58 charlie-xiang
update to use parsed parameters and added doc tree
4870f7693329b6237d888408b38754a7b3077a52 charlie-xiang
fix review comments
bf58ea40bd2d105d87bca9bdab64d58759037b61 charlie-xiang
Description From Last Updated

E501 line too long (85 > 79 characters)

reviewbotreviewbot

F401 'django.core.exceptions.ObjectDoesNotExist' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.decorators.webapi_response_errors' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.decorators.webapi_login_required' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.decorators.webapi_request_fields' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.errors.PERMISSION_DENIED' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.errors.INVALID_FORM_DATA' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.errors.NOT_LOGGED_IN' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.errors.DOES_NOT_EXIST' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.fields.IntFieldType' imported but unused

reviewbotreviewbot

F401 'reviewboard.diffviewer.models.FileDiff' imported but unused

reviewbotreviewbot

F401 'reviewboard.webapi.resources.resources' imported but unused

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E265 block comment should start with '# '

reviewbotreviewbot

W293 blank line contains whitespace

reviewbotreviewbot

E122 continuation line missing indentation or outdented

reviewbotreviewbot

E122 continuation line missing indentation or outdented

reviewbotreviewbot

E122 continuation line missing indentation or outdented

reviewbotreviewbot

F401 'django.core.exceptions.ObjectDoesNotExist' imported but unused

reviewbotreviewbot

F401 'djblets.util.decorators.augment_method_from' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.decorators.webapi_response_errors' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.decorators.webapi_login_required' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.decorators.webapi_request_fields' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.errors.PERMISSION_DENIED' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.errors.INVALID_FORM_DATA' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.errors.NOT_LOGGED_IN' imported but unused

reviewbotreviewbot

F401 'djblets.webapi.errors.DOES_NOT_EXIST' imported but unused

reviewbotreviewbot

F401 'reviewboard.webapi.decorators.webapi_check_local_site' imported but unused

reviewbotreviewbot

F401 'reviewboard.webapi.resources.resources' imported but unused

reviewbotreviewbot

E225 missing whitespace around operator

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

W291 trailing whitespace

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

W291 trailing whitespace

reviewbotreviewbot

This is getting long enough that we should just wrap and list one argument per line.

daviddavid

While you're here, mind updating this docstring to follow our modern standards? "Returns" -> "Return", and add "Args" and "Returns" …

daviddavid

Instead of doing this, let's avoid listing review_request_id in the args list, and pull it out for our local use: …

daviddavid

Same comments here re: kwargs.

daviddavid

New files on master won't require the unicode_literals import, but we would like to include module docstrings at the top …

daviddavid

Same here re: unicode_literals, docstrings.

daviddavid

Same here re: unicode_literals, docstrings.

daviddavid

Same here re: unicode_literals, docstrings.

daviddavid

E999 SyntaxError: invalid syntax

reviewbotreviewbot

And here.

daviddavid

E999 SyntaxError: invalid syntax

reviewbotreviewbot

And here.

daviddavid

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

W291 trailing whitespace

reviewbotreviewbot

W291 trailing whitespace

reviewbotreviewbot

W291 trailing whitespace

reviewbotreviewbot

W291 trailing whitespace

reviewbotreviewbot

W291 trailing whitespace

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

I think there is a typo here. Should it be "list" resources?

sheenaNgsheenaNg

I know it was like this before, but can you add a docstring?

daviddavid

Add a blank line after this.

daviddavid

dict.get() returns None if the key doesn't exist, so we can simplify: if kwargs.get('review_request_id') is not None:

daviddavid

I know it was like this before, but can you add a docstring?

daviddavid

Add a blank line after this.

daviddavid

dict.get() returns None if the key doesn't exist, so we can simplify: if kwargs.get('review_request_id') is not None:

daviddavid

Instead of having multiple return paths, let's just reassign q. Please also add a blank line above the return: ```python …

daviddavid

It's not "different comments", it's "diff comments" :)

daviddavid

Imports should be in three groups, separated by blank lines and alphabetized within: Standard library Third-party "Current" module (anything in …

daviddavid

This is "new" right now but won't be new forever. Just call it "This top level ..."

daviddavid

Add a blank line between these two.

daviddavid

This should be in the imperative mood ("Return" instead of "Returns"). This docstring also needs an "Args" section.

daviddavid

Add a blank line between these two.

daviddavid

Can you add a line between these two lines?

sheenaNgsheenaNg

This is something minor, you missed the period at the end of the description.

sheenaNgsheenaNg

You missed the period at the end of the description.

sheenaNgsheenaNg

This should be in the imperative mood.

daviddavid

Same comments in this file as in the diff comments file.

daviddavid

There should be a blank line after the class docstring. Can you add a blank line here?

sheenaNgsheenaNg

Can you also add a blank line between these two lines?

sheenaNgsheenaNg

Can you add a blank line after q = Q() and also after each if statement?

sheenaNgsheenaNg

You missed the period at the end of the description.

sheenaNgsheenaNg

You missed the period at the end of the description.

sheenaNgsheenaNg

Same comments in this file as in the diff comments file.

daviddavid

There should be a blank line after the class docstring. Can you add a blank line here?

sheenaNgsheenaNg

Can you add a blank line between these two lines?

sheenaNgsheenaNg

Can you add a blank line after q = Q() and also after each if statement?

sheenaNgsheenaNg

You missed the period at the end of the description.

sheenaNgsheenaNg

You missed the period at the end of the description.

sheenaNgsheenaNg

I don't know that it makes sense to have new mimetypes for these endpoints, since the content is effectively the …

daviddavid

There's an extra space before "Unit"

daviddavid

No blank line here. Please also alphabetize the import list.

daviddavid

E999 SyntaxError: invalid syntax

reviewbotreviewbot

Instead of writing "diff_comments/" in each of these docstrings, let's just put "<URL>/..." and then use the @webapi_test_template decorator.

daviddavid

I think it is great overall. One suggestion: Would it be easier to read if you add some blank lines …

sheenaNgsheenaNg

A few things here: Alphabetize the list No blank line within the section For the tests.urls import, put the import …

daviddavid

E999 SyntaxError: invalid syntax

reviewbotreviewbot

Let's use @webapi_test_template for all these.

daviddavid

I do not think there should be a blank line after function docstring.

sheenaNgsheenaNg

Same comments here as in the other files.

daviddavid

E999 SyntaxError: invalid syntax

reviewbotreviewbot

Let's use @webapi_test_template for all the docstrings here.

daviddavid

I do not think there should be a blank line after function docstring.

sheenaNgsheenaNg

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

Chaoyu
Review request changed

Commits:

Summary ID Author
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang

Diff:

Revision 2 (+798 -88)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

Chaoyu
Review request changed

Commits:

Summary ID Author
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
add user tests to diff comment
4ad0f51bbad5d023a3e14929e493b409aafa9e2b charlie-xiang

Diff:

Revision 3 (+864 -110)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

Chaoyu
Chaoyu
Review request changed

Change Summary:

add more query parameters and added tests for general-comment and file-attachment-comment

Description:

   
  • Registered root diff comments, root file attachment comments and root general comments API
~  
  • Support GET method for list resources with query parameter: review-request-id=<review-request-id> , review-id=<review-id>, user=<user-username>
  ~
  • Support GET method for list resources with query parameter: review-request-id=<review-request-id> , review-id=<review-id>, user=<user-username>, file-diff-id for diff comments, and file-attachment-id file-name for file attachment comments
   
  • Unit tests suites for comments API

Testing Done:

~  
  • Added unit tests for diff-comment
  ~
  • Added unit tests for diff-comment, general-comment and file-attachment-comment with list resource and GET method
-  
  • Still need to add tests for general-comment and file-attachment-comment

Commits:

Summary ID Author
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
add user tests to diff comment
4ad0f51bbad5d023a3e14929e493b409aafa9e2b charlie-xiang
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
add user tests to diff comment
4ad0f51bbad5d023a3e14929e493b409aafa9e2b charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
85dac98dfa7185f4d2d8846de1e1415627c21908 charlie-xiang

Diff:

Revision 4 (+1720 -122)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

Chaoyu
Review request changed

Change Summary:

add last-updated-from, to and is_reply filters

Commits:

Summary ID Author
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
add user tests to diff comment
4ad0f51bbad5d023a3e14929e493b409aafa9e2b charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
85dac98dfa7185f4d2d8846de1e1415627c21908 charlie-xiang
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
add user tests to diff comment
4ad0f51bbad5d023a3e14929e493b409aafa9e2b charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
85dac98dfa7185f4d2d8846de1e1415627c21908 charlie-xiang
add last-updated-from, to and is_reply filters
3b28c1cc1faf70a2790152a385c54cf8219a0683 charlie-xiang

Diff:

Revision 5 (+1827 -141)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

david
  1. Great start!

  2. This is getting long enough that we should just wrap and list one argument per line.

  3. reviewboard/webapi/resources/base_diff_comment.py (Diff revision 5)
     
     
     
     
     
     
     
     
     
     
     

    While you're here, mind updating this docstring to follow our modern standards? "Returns" -> "Return", and add "Args" and "Returns" sections to the bottom.

  4. Instead of doing this, let's avoid listing review_request_id in the args list, and pull it out for our local use:

    def get_queryset(self, request, *args, **kwargs):
        review_request_id = kwargs.get('review_request_id', None)
    

    Since we're not actually using the ID, we might even be able to just do:

    if 'review_request_id' in kwargs:
        review_request = ...
        q = q.filter(...)
    
  5. Same comments here re: kwargs.

  6. New files on master won't require the unicode_literals import, but we would like to include module docstrings at the top of the file.

  7. Same here re: unicode_literals, docstrings.

  8. Same here re: unicode_literals, docstrings.

  9. Same here re: unicode_literals, docstrings.

  10. 
      
Chaoyu
Review request changed

Change Summary:

Added tests for last-updated-to, last-updated-from, is-reply, fixed the review issues

Commits:

Summary ID Author
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
add user tests to diff comment
4ad0f51bbad5d023a3e14929e493b409aafa9e2b charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
85dac98dfa7185f4d2d8846de1e1415627c21908 charlie-xiang
add last-updated-from, to and is_reply filters
3b28c1cc1faf70a2790152a385c54cf8219a0683 charlie-xiang
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
add user tests to diff comment
4ad0f51bbad5d023a3e14929e493b409aafa9e2b charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
85dac98dfa7185f4d2d8846de1e1415627c21908 charlie-xiang
add last-updated-from, to and is_reply filters
3b28c1cc1faf70a2790152a385c54cf8219a0683 charlie-xiang
address reviews feedback
1ca9fbaccae7ca5cabecb4083f604b0cee834683 charlie-xiang
added tests for last-updated and is-reply
b075e5d5dbc4104ea376b3a8e521aabfb2109fb9 charlie-xiang

Diff:

Revision 6 (+2255 -161)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

Chaoyu
Review request changed

Change Summary:

Added webapi_request_fields decorator to get_list method for API GET parameters documentation

Commits:

Summary ID Author
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
add user tests to diff comment
4ad0f51bbad5d023a3e14929e493b409aafa9e2b charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
85dac98dfa7185f4d2d8846de1e1415627c21908 charlie-xiang
add last-updated-from, to and is_reply filters
3b28c1cc1faf70a2790152a385c54cf8219a0683 charlie-xiang
address reviews feedback
1ca9fbaccae7ca5cabecb4083f604b0cee834683 charlie-xiang
added tests for last-updated and is-reply
b075e5d5dbc4104ea376b3a8e521aabfb2109fb9 charlie-xiang
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
add user tests to diff comment
4ad0f51bbad5d023a3e14929e493b409aafa9e2b charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
85dac98dfa7185f4d2d8846de1e1415627c21908 charlie-xiang
add last-updated-from, to and is_reply filters
3b28c1cc1faf70a2790152a385c54cf8219a0683 charlie-xiang
address reviews feedback
1ca9fbaccae7ca5cabecb4083f604b0cee834683 charlie-xiang
added tests for last-updated and is-reply
b075e5d5dbc4104ea376b3a8e521aabfb2109fb9 charlie-xiang
add webapi_request_fields documentations
302413cd2a943024693810e552cce733825de038 charlie-xiang

Diff:

Revision 7 (+2664 -182)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

Chaoyu
Review request changed

Change Summary:

added webapi_request_fields decorator to get_list and resource class docstring

Description:

   
  • Registered root diff comments, root file attachment comments and root general comments API
~  
  • Support GET method for list resources with query parameter: review-request-id=<review-request-id> , review-id=<review-id>, user=<user-username>, file-diff-id for diff comments, and file-attachment-id file-name for file attachment comments
~  
  • Unit tests suites for comments API
  ~
  • Support GET method for list resources with query parameter:
  ~
  • Shared query parameters : review-request-id=<review-request-id> , review-id=<review-id>, user=<user-username>, is-reply
  +
  • file-diff-id, line and interdiff-revision for diff comments, and file-attachment-id file-name for file attachment comments
  +
  • Unit tests suites for comments API
  +
  • Added added webapi_request_fields decorator to get_list for request parameters documentation
  +
  • Added resource class docstrings.

Commits:

Summary ID Author
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
add user tests to diff comment
4ad0f51bbad5d023a3e14929e493b409aafa9e2b charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
85dac98dfa7185f4d2d8846de1e1415627c21908 charlie-xiang
add last-updated-from, to and is_reply filters
3b28c1cc1faf70a2790152a385c54cf8219a0683 charlie-xiang
address reviews feedback
1ca9fbaccae7ca5cabecb4083f604b0cee834683 charlie-xiang
added tests for last-updated and is-reply
b075e5d5dbc4104ea376b3a8e521aabfb2109fb9 charlie-xiang
add webapi_request_fields documentations
302413cd2a943024693810e552cce733825de038 charlie-xiang
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
add user tests to diff comment
4ad0f51bbad5d023a3e14929e493b409aafa9e2b charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
85dac98dfa7185f4d2d8846de1e1415627c21908 charlie-xiang
add last-updated-from, to and is_reply filters
3b28c1cc1faf70a2790152a385c54cf8219a0683 charlie-xiang
address reviews feedback
1ca9fbaccae7ca5cabecb4083f604b0cee834683 charlie-xiang
added tests for last-updated and is-reply
b075e5d5dbc4104ea376b3a8e521aabfb2109fb9 charlie-xiang
add webapi_request_fields documentations and resource class docstring
b84f8c26fa21f60439c6fa54cc4f0d1a7c3289bf charlie-xiang

Diff:

Revision 8 (+2700 -182)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

TaylorChristie
  1. 
      
  2. The documentation stuff looks cool - I'm going to implement it the same way on my project!

  3. 
      
Chaoyu
Review request changed

Change Summary:

update to use parsed parameters and added doc tree

Commits:

Summary ID Author
register comments root APIs
6ead118a5c814c3e85d03f98aa1349bb195c0ee7 charlie-xiang
fix a bug in base file attachment comment from last commit
319cd6df612ef18096dc563ebfb8ec26ae48e340 charlie-xiang
add user name filter and add diff comment test suites
be7279791b2dd90f0c9dbd6fe5675589a30944e3 charlie-xiang
add user tests to diff comment
4ad0f51bbad5d023a3e14929e493b409aafa9e2b charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
85dac98dfa7185f4d2d8846de1e1415627c21908 charlie-xiang
add last-updated-from, to and is_reply filters
3b28c1cc1faf70a2790152a385c54cf8219a0683 charlie-xiang
address reviews feedback
1ca9fbaccae7ca5cabecb4083f604b0cee834683 charlie-xiang
added tests for last-updated and is-reply
b075e5d5dbc4104ea376b3a8e521aabfb2109fb9 charlie-xiang
add webapi_request_fields documentations and resource class docstring
b84f8c26fa21f60439c6fa54cc4f0d1a7c3289bf charlie-xiang
register comments root APIs
44288f2e38715f36d3fe785d1a37cf431c58dd9e charlie-xiang
fix a bug in base file attachment comment from last commit
e95ff3fa71a355454f66cd5ab76b4f600a2bd479 charlie-xiang
add user name filter and add diff comment test suites
f99ddf9ce372cf9d8152cf0be0eb536f9c4d5375 charlie-xiang
add user tests to diff comment
6384876fee680c473c4174cfce2e74417e5876f1 charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
03f77eb15a8086d59b88a1d68e1f337a6188172f charlie-xiang
add last-updated-from, to and is_reply filters
b9c04bb7e6e2f9849c9918c50d8c3b2023e28909 charlie-xiang
address reviews feedback
4c07e01cd4943277a946e130a414b888c02d74a9 charlie-xiang
added tests for last-updated and is-reply
f886553f0031fce678d428573cde46d82165e975 charlie-xiang
add webapi_request_fields documentations and resource class docstring
a09404b357879088b64add7b870a4c37b56c34b7 charlie-xiang
update to use parsed parameters and added doc tree
c11bf2d737548101f44ea7a92e9469b20cde8a3d charlie-xiang

Diff:

Revision 9 (+2770 -248)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

Chaoyu
david
  1. 
      
  2. I know it was like this before, but can you add a docstring?

  3. Add a blank line after this.

  4. dict.get() returns None if the key doesn't exist, so we can simplify:

    if kwargs.get('review_request_id') is not None:
    
  5. I know it was like this before, but can you add a docstring?

  6. Add a blank line after this.

  7. dict.get() returns None if the key doesn't exist, so we can simplify:

    if kwargs.get('review_request_id') is not None:
    
  8. Instead of having multiple return paths, let's just reassign q. Please also add a blank line above the return:

    ```python
    q = q.filter(
    Q(review__review_request=review_request))

    return q

  9. It's not "different comments", it's "diff comments" :)

  10. reviewboard/webapi/resources/root_diff_comment.py (Diff revision 9)
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    Imports should be in three groups, separated by blank lines and alphabetized within:

    1. Standard library
    2. Third-party
    3. "Current" module (anything in reviewboard).

    There aren't any for group 1, so in this case, we should have two:

    1. All django and djblets imports
    2. All review board imports
  11. This is "new" right now but won't be new forever. Just call it "This top level ..."

  12. Add a blank line between these two.

  13. This should be in the imperative mood ("Return" instead of "Returns"). This docstring also needs an "Args" section.

  14. Add a blank line between these two.

  15. This should be in the imperative mood.

  16. Same comments in this file as in the diff comments file.

  17. Same comments in this file as in the diff comments file.

  18. reviewboard/webapi/tests/mimetypes.py (Diff revision 9)
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    I don't know that it makes sense to have new mimetypes for these endpoints, since the content is effectively the same as the other endpoints for the same objects.

    1. I removed the new mimetypes for file_attachment_comment and general_comment but kept the one for diff_comment as there's no existing mimetype for diff_comment

  19. There's an extra space before "Unit"

  20. No blank line here. Please also alphabetize the import list.

  21. Instead of writing "diff_comments/" in each of these docstrings, let's just put "<URL>/..." and then use the @webapi_test_template decorator.

  22. reviewboard/webapi/tests/test_root_file_attachment_comment.py (Diff revision 9)
     
     
     
     
     
     
     
     
     

    A few things here:

    1. Alphabetize the list
    2. No blank line within the section
    3. For the tests.urls import, put the import on the first line rather than the second.
  23. Let's use @webapi_test_template for all these.

  24. reviewboard/webapi/tests/test_root_general_comment.py (Diff revision 9)
     
     
     
     
     
     
     
     

    Same comments here as in the other files.

  25. Let's use @webapi_test_template for all the docstrings here.

  26. 
      
sheenaNg
  1. 
      
    1. I think you did a great job overall! I added some comments but they are mostly minor styling issues such as missing blank lines and minor typo.

    2. Good catch! Thanks

  2. I think there is a typo here. Should it be "list" resources?

  3. Can you add a line between these two lines?

  4. This is something minor, you missed the period at the end of the description.

  5. You missed the period at the end of the description.

  6. There should be a blank line after the class docstring. Can you add a blank line here?

  7. Can you also add a blank line between these two lines?

  8. reviewboard/webapi/resources/root_file_attachment_comment.py (Diff revision 9)
     
     
     
     
     
     
     
     
     
     
     
     

    Can you add a blank line after q = Q() and also after each if statement?

  9. You missed the period at the end of the description.

  10. You missed the period at the end of the description.

  11. There should be a blank line after the class docstring. Can you add a blank line here?

  12. Can you add a blank line between these two lines?

  13. reviewboard/webapi/resources/root_general_comment.py (Diff revision 9)
     
     
     
     
     
     

    Can you add a blank line after q = Q() and also after each if statement?

  14. You missed the period at the end of the description.

  15. You missed the period at the end of the description.

  16. reviewboard/webapi/tests/test_root_diff_comment.py (Diff revision 9)
     
     
     
     
     
     
     

    I think it is great overall.
    One suggestion: Would it be easier to read if you add some blank lines to separate different groups of codes?

    For example, add blank line after the codes to create diff_review, reviews/ comments and before calling the API endpoint. Then, add another blank line after calling the API endpoint and before the assertions.

    This could be applied to the rest of the unit tests in multiple files.

  17. I do not think there should be a blank line after function docstring.

  18. I do not think there should be a blank line after function docstring.

  19. 
      
Chaoyu
Review request changed

Change Summary:

worked on review comments

Commits:

Summary ID Author
register comments root APIs
44288f2e38715f36d3fe785d1a37cf431c58dd9e charlie-xiang
fix a bug in base file attachment comment from last commit
e95ff3fa71a355454f66cd5ab76b4f600a2bd479 charlie-xiang
add user name filter and add diff comment test suites
f99ddf9ce372cf9d8152cf0be0eb536f9c4d5375 charlie-xiang
add user tests to diff comment
6384876fee680c473c4174cfce2e74417e5876f1 charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
03f77eb15a8086d59b88a1d68e1f337a6188172f charlie-xiang
add last-updated-from, to and is_reply filters
b9c04bb7e6e2f9849c9918c50d8c3b2023e28909 charlie-xiang
address reviews feedback
4c07e01cd4943277a946e130a414b888c02d74a9 charlie-xiang
added tests for last-updated and is-reply
f886553f0031fce678d428573cde46d82165e975 charlie-xiang
add webapi_request_fields documentations and resource class docstring
a09404b357879088b64add7b870a4c37b56c34b7 charlie-xiang
update to use parsed parameters and added doc tree
c11bf2d737548101f44ea7a92e9469b20cde8a3d charlie-xiang
register comments root APIs
7697a1e0439c7a09f66f69018512b1d9d62e586d charlie-xiang
fix a bug in base file attachment comment from last commit
b2be67042a927571a7bb4d876632c28c576a5a41 charlie-xiang
add user name filter and add diff comment test suites
c3357d44d9b108848863dcc1f3e25fab012453e9 charlie-xiang
add user tests to diff comment
26b7346d85eeb5e28094a56d7313e8d3ce575996 charlie-xiang
add filediff id query parameter for diff comment, file attachment parameters for file attachment, add tests
31fbbc2ad10218658aab0518b2525c5ee27bf609 charlie-xiang
add last-updated-from, to and is_reply filters
c062506ea81a860c09d0b08baafcd5d88909e0fb charlie-xiang
address reviews feedback
7ab70cc20ad219423ec49ade08b55e33c0e49853 charlie-xiang
added tests for last-updated and is-reply
a35f5434b4190a51f9cae711695945d161113543 charlie-xiang
add webapi_request_fields documentations and resource class docstring
5033f62280090aff629e91710f280cd346d36f58 charlie-xiang
update to use parsed parameters and added doc tree
4870f7693329b6237d888408b38754a7b3077a52 charlie-xiang
fix review comments
bf58ea40bd2d105d87bca9bdab64d58759037b61 charlie-xiang

Diff:

Revision 10 (+3190 -370)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

maubin
Review request changed

Status: Discarded

Change Summary:

This work has moved to /r/12296

Loading...