Add an error when attempting to publish a review of draft items.

Review Request #12952 — Created April 12, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-6.x
831

Reviewers

Now that reviews can exist with comments on draft, we want to prevent
those reviews from being published. This change adds a check before we
publish to verify that the review request itself is public, and checks
for diff comments and file attachment comments to verify that the items
being commented on are public.

Ironically, we had a number of existing unit tests that were publishing
reviews on draft items. These have been fixed up.

Ran unit tests.

Diff Revision 2

This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.

orig
1
2
3
4

Commits

First Last Summary ID Author
Add an error when attempting to publish a review of draft items.
Now that reviews can exist with comments on draft, we want to prevent those reviews from being published. This change adds a check before we publish to verify that the review request itself is public, and checks for diff comments and file attachment comments to verify that the items being commented on are public. Ironically, we had a number of existing unit tests that were publishing reviews on draft items. These have been fixed up. Testing Done: Ran unit tests. Bugs Fixed: 831
4a99f3ff6d6e180e5c1a969f6a77d368107ee9a2 David Trowbridge
reviewboard/notifications/tests/test_email_sending.py
reviewboard/notifications/tests/test_webhooks.py
reviewboard/reviews/models/diff_comment.py
reviewboard/reviews/models/file_attachment_comment.py
reviewboard/reviews/models/review.py
reviewboard/reviews/tests/test_comment_diff_fragments_view.py
reviewboard/reviews/tests/test_entries.py
reviewboard/reviews/tests/test_review.py
reviewboard/reviews/views/batch.py
Loading...