Add a new batch operation view

Review Request #12695 — Created Oct. 20, 2022 and submitted — Latest diff uploaded

Information

Review Board
release-6.x

Reviewers

For upcoming feature work, we want the ability to make a single request
to publish a bunch of individual items (review requests and reviews) all
together.

To do this, we're introducing a new API-like endpoint for performing
batch operations. This doesn't exist in the official API because it
doesn't really mesh well with REST, and the actual endpoint may be in
flux for a bit.

We already have some batch-like operations in the dashboard UI that
currently just make a whole bunch of API requests for closing review
requests or changing visibility state. This new endpoint will also
enable these workflows, so we can handle it much more efficiently.

The new batch endpoint supports these operations:

  • close
  • discard
  • archive
  • mute
  • unarchive (effectively unmute too)
  • publish
  • Looked at e-mail previews for batch publishes with all combinations of
    review requests, review request updates, reviews, and review replies in
    both HTML and text mode.
  • Used all operations except for publish from real UI.
  • Ran unit tests.

Changes between revision 3 and 4

orig
1
2
3
4
5
6
7
8
9
10
11

Commits

Summary ID Author
[WIP] Add a new batch operation view
For upcoming feature work, we want the ability to make a single request to publish a bunch of individual items (review requests and reviews) all together. To do this, we're introducing a new API-like endpoint for performing batch operations. This doesn't exist in the official API because it doesn't really mesh well with REST, and the actual endpoint may be in flux for a bit. We already have some batch-like operations in the dashboard UI that currently just make a whole bunch of API requests for closing review requests or changing visibility state. This new endpoint will also enable these workflows, so we can handle it much more efficiently. This is work-in-progress change that does most of what I have planned. There are two major pieces left to do: 1. Handle the partial-publish case where we get some errors. I've not yet decided whether to proceed with what we can and return a "mixed" status with errors, or refactor the publish path inside ReviewRequestDraft to allow us to do all prep and validation before actually publishing anything. 2. Create the new bulk e-mail. Unit tests exist for most of the functionality but I'll be expanding those too. Testing Done: Ran new unit tests.
6345515bd6240f4cc80d30de2a3ab943eb5f6753 David Trowbridge
[WIP] Add a new batch operation view
For upcoming feature work, we want the ability to make a single request to publish a bunch of individual items (review requests and reviews) all together. To do this, we're introducing a new API-like endpoint for performing batch operations. This doesn't exist in the official API because it doesn't really mesh well with REST, and the actual endpoint may be in flux for a bit. We already have some batch-like operations in the dashboard UI that currently just make a whole bunch of API requests for closing review requests or changing visibility state. This new endpoint will also enable these workflows, so we can handle it much more efficiently. This is now mostly complete, and just needs a lot more testing. Testing Done: Ran new unit tests.
3bb11bb0631834e35be316e4a522af561bbeaab4 David Trowbridge
reviewboard/notifications/email/message.py
reviewboard/reviews/urls.py
reviewboard/reviews/models/review.py
reviewboard/reviews/models/review_request.py
reviewboard/reviews/tests/test_batch_view.py
reviewboard/reviews/views/__init__.py
reviewboard/reviews/views/batch.py
reviewboard/reviews/views/email.py
reviewboard/templates/notifications/batch_publish_email.html
reviewboard/templates/notifications/batch_publish_email.txt
Loading...