Guides

Reviews of several entries

Ask for one review that publishes and unpublishes several entries together, read its diff, comment on lines, and approve it all or in part.

Reviews of several entries

A review holds one entry or more. Each entry of it is published or unpublished when the review is approved, and every one of them changes in the same step: all of them, or none. A post and its translation, a page and the pages that link to it, a section of the docs that moves: one person approves them together.

Ask for one

request_review takes the first entry to publish, with the version you read, and two lists:

{
  "id": "ent_01JAB3XQ8ZK4M6N2P5R7S9T0VW",
  "version": 4,
  "group": [{ "id": "ent_01JAB3XQ9C2D3E4F5G6H7J8K9M", "version": 2 }],
  "unpublish": [{ "id": "ent_01JAB3XQAB1C2D3E4F5G6H7J8K", "version": 7 }]
}
  • group lists more entries to publish, each with the version you read.
  • unpublish lists published entries to take off the site.

The answer is pending_review with the review. A review always has an entry to publish: id is that entry.

publish from someone without content:publish asks for a review instead of publishing, as before; with group, it asks for one review of all its entries.

An entry is in one pending review at most. Asking with an entry that another review holds answers conflict, with that review and the failedEntry. An entry that is blocked by its contracts, has a warning to acknowledge, is stale or is not published (for unpublish) is named in failedEntry too, and nothing is asked.

A new revision of any entry of the review cancels the whole review, and the author asks again: an approval is always of what the editor saw.

Read it

get_review (scope review:read) answers the review with each of its entries:

FieldWhat it is
actionpublish or unpublish
publishedthe Markdown the site shows now, or null
proposedthe Markdown the review publishes, or null when it unpublishes
diffthe unified diff from published to proposed, with three lines of context
excludedwhether the approval left this entry as it was

A review too large for one answer is read an entry at a time, with entryId. list_reviews answers how many entries each review holds, in items. unifiedDiff of @hollware/core makes the same diff.

Comment on it

comment_review (scope review:comment) comments on the whole review, on one of its entries with entryId, or on lines of the proposed Markdown of that entry with lines:

{ "id": "rvw_01JAB3XQ8ZK4M6N2P5R7S9T0VW", "entryId": "ent_01JAB3XQ8ZK4M6N2P5R7S9T0VW", "lines": { "from": 12, "to": 14 }, "body": "This paragraph says the same as the one above." }

Lines are numbered as get_review numbers them. Every comment answers with its entryId and its lines, or null for each.

Decide

approve_review (scope content:publish) runs the contracts again on each entry, then publishes and unpublishes every entry of the review in one step, in the approver's name.

  • exclude lists entries of the review to leave as they are. The rest is published or unpublished, and the review closes for all of them.
  • An entry that changed since the request answers conflict, with failedEntry, and nothing is published. So does an entry that is blocked or has a warning to acknowledge, with its own outcome.

request_changes and reject_review decide the whole review, as they decide a review of one entry.

In the admin

Reviews shows every entry of a review, each with its diff and what approving does to it, Publish or Unpublish.

  • Leave out of the approval keeps an entry as it is.
  • Approve all and publish approves the rest in one step.
  • Comment on this entry takes a comment on an entry, and From line and To line anchor it to lines of its proposal.

Each review is approved on its own: when you approve several, one can be published while another is not.

Events

review.requested and review.decided carry items: every entry the review changes, the entry of entry first, each with its action. See the events reference.

A Hollware upgraded to 1.1 makes each review it had a review of its one entry, with the migrations 0029_review_items.sql and 0030_review_items_backfill.sql.