Allow commenting on draft (unpublished) items.

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

Information

Review Board
release-6.x

Reviewers

For as long as Review Board has existed, we've disallowed commenting on
items before they're published. The reasoning here was that if you add a
diff comment, replacing the diff will delete the comment (and similar
for file attachments).

This change updates the comment dialog to remove the hasDraft checks.
This is replaced with a new mechanism whereby we add a public state to
diffs and file attachments, and use that to show a warning to the user
if they're commenting on something which has not yet been published. The
bulk of the code changes here are just plumbing that state all the way
down to the comment block models, which use it to decide what to display
to the user.

  • Ran unit tests.
  • Created review requests with published and unpublished diffs and file
    attachments. Checked that adding a comment to published items worked
    as normal, and that the draft warnings were correctly shown for draft
    diffs and file attachments, as well as for interdiffs and file
    attachment diffs involving an unpublished tip revision.

Changes between revision 1 and 2

orig
1
2
3

Commits

Summary ID Author
Allow commenting on draft (unpublished) items.
For as long as Review Board has existed, we've disallowed commenting on items before they're published. The reasoning here was that if you add a diff comment, replacing the diff will delete the comment (and similar for file attachments). This change updates the comment dialog to remove the `hasDraft` checks. This is replaced with a new mechanism whereby we add a `public` state to diffs and file attachments, and use that to show a warning to the user if they're commenting on something which has not yet been published. The bulk of the code changes here are just plumbing that state all the way down to the comment block models, which use it to decide what to display to the user. Testing Done: - Ran unit tests. - Created review requests with published and unpublished diffs and file attachments. Checked that adding a comment to published items worked as normal, and that the draft warnings were correctly shown for draft diffs and file attachments, as well as for interdiffs and file attachment diffs involving an unpublished tip revision.
26fa6a100ab2e62d3731c18c2642d729bdf3b79c David Trowbridge
Allow commenting on draft (unpublished) items.
For as long as Review Board has existed, we've disallowed commenting on items before they're published. The reasoning here was that if you add a diff comment, replacing the diff will delete the comment (and similar for file attachments). This change updates the comment dialog to remove the `hasDraft` checks. This is replaced with a new mechanism whereby we add a `public` state to diffs and file attachments, and use that to show a warning to the user if they're commenting on something which has not yet been published. The bulk of the code changes here are just plumbing that state all the way down to the comment block models, which use it to decide what to display to the user. Testing Done: - Ran unit tests. - Created review requests with published and unpublished diffs and file attachments. Checked that adding a comment to published items worked as normal, and that the draft warnings were correctly shown for draft diffs and file attachments, as well as for interdiffs and file attachment diffs involving an unpublished tip revision.
8ae716c43d8bb0a823b76c91936d6b228d6dcb81 David Trowbridge
reviewboard/diffviewer/tests/test_diffutils.py
Loading...