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 10 and 11

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
7f33f30b50e4e541d57198833d1c21feed7a1a09 Michelle
style fixes and removed item mimetypes and urls
c9e9c7d0be9c7d3d26f0786d4a25fd678a577e36 Michelle
reviewboard/webapi/resources/root_diff_comment.py
reviewboard/webapi/resources/root_file_attachment_comment.py
reviewboard/webapi/resources/root_general_comment.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...