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 6 and 7

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
007d73bdb4128b3b3c9fab81db7bc459ab2d691c Michelle
style fixes and removed item mimetypes and urls
3f94075dc5e48f174bfd999ddfc877e6d0c46baa Michelle
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...