Approve a set of drafts in one batch

Closes #33 (closed)

A set of related contributions can now be approved in one batch. This amends ADR-0005 on a maintainer ruling: each contribution is approved on its own, or a set is approved once. A batch approval may carry links to the other members of the set, filled in as the set posts. Everything else stays verbatim, so the approved text posts exactly as approved.

How it works

just contrib draft set --member NAME=DRAFT ... writes a set draft that shows every member's text, lists each destination project once and records each member's sha256. A later member may cite {{link:NAME}}, the web_url of an earlier mr-create, issue-create, work-item-note or commit member. publish checks the whole set before its first post, then posts the members in order and fills each placeholder from the link that member just returned.

sequenceDiagram
  participant A as Author
  participant H as Host approval
  participant P as publish
  participant F as Forge
  A->>A: draft members, then draft set
  A->>H: show the set, every text with its placeholders
  H->>P: approve the set draft once
  P->>P: check set text, member sha256, host, projects
  P->>F: post first
  F-->>P: web_url
  P->>P: fill link:first in second
  P->>F: post second
  F-->>P: web_url
  P->>F: post third with both links filled
  Note over P,F: a failed member stops the set and names what posted

What stays as it was

  • A member with no placeholder is an ordinary draft. Approving it posts it alone.
  • A member with a placeholder does not post alone, because its text would carry the placeholder.
  • Only the placeholder changes. A member edited after the set was drafted, a set whose text no longer matches its members, and a set whose project lines differ from its members' all refuse before anything posts.
  • A member that fails stops the set. publish names what posted and what did not.
  • A placeholder must name an earlier member that returns a link, and never sits in a title.

ADR

ADR-0005 has a new section, "A set is approved in one batch", and ends with a dated amendment note. The ADR index and docs/README.md now say that a ruling which amends an ADR leaves one dated note, the only date an ADR carries.

Checks

The behavioural suite has new cases for each rule above. Run against the previous publish and draft scripts, 11 of them fail:

  • a single approval posts alone
  • a batch approval posts the set in order
  • each placeholder fills with the earlier member's web_url, and the rest of the text is byte for byte
  • a placeholder draft does not post alone
  • nothing posts after an edit to a member, to the set's text or to its destinations
  • the set stops at a failed member, and at a cited member that returns no link
  • draft set refuses a forward, unknown, malformed or non-linking citation, a title placeholder, one member, a repeated name, a nested set and two hosts

The hosted pipeline on this head is green, including the skill-scan counts in scan-accept.yml (the behavioural suite's tool-parameter count goes from 76 to 86). The word budget is 40473 of 40489.

Edited by Andrew Dunn

Merge request reports

Loading
Loading