Add top-level comments APIs

Review Request #12296 — Created May 23, 2022 and submitted — Latest diff uploaded

Information

Review Board
release-5.0.x

Reviewers

Comment resources are currently child resources of reviews. This limits the type
of queries we can do for comments, for example we can't query for all diff
comments created by a given user.

This change adds top-level API endpoints for comments. We register root list
resources for diff comments, file attachment comments and general comments and
support GET requests for the resources with the following query parameters:
- review-request-id=<review-request-id>, review-id=<review-id>,
user=<user-username>, is-reply for all
- file-diff-id, line and interdiff-revision for diff comments
- file-attachment-id and file-name for file attachment comments

This change also improves the docstrings and code readability for base diff
comments, base file attachment comments, and base general review comments.

Based on work by Chaoyu Xiang at /r/12037.

  • Created GET method unit tests for the new resources and ran them successfully
  • Manually tested the /api/general-comments/, /api/diff-comments/ and
    api/file-attachment-comments endpoints

Changes between revision 13 and 14

orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Commits

Summary ID Author
style fixes and removed item mimetypes and urls
4c14325694cbce016885fcebe07660152bbc3fcc Michelle
style fixes and removed item mimetypes and urls
a5f42292a09663b7e512c6a9d002282dee719333 Michelle
reviewboard/webapi/resources/base_comment.py
reviewboard/webapi/resources/base_diff_comment.py
reviewboard/webapi/resources/base_file_attachment_comment.py
reviewboard/webapi/resources/base_screenshot_comment.py
reviewboard/webapi/resources/root.py
reviewboard/webapi/tests/test_root_diff_comment.py
reviewboard/webapi/tests/test_root_file_attachment_comment.py
reviewboard/webapi/tests/test_root_general_comment.py
Loading...