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 1 and 2

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
a5b9010d4b02e1e6b67a87d07ff8487788e59ae1 Michelle
style fixes and removed item mimetypes and urls
5281065b69e86ae7d43aac81583424cbb614ca4b Michelle
reviewboard/cmdline/rbsite.py
Loading...