pub async fn add_dependencies(
pool: &PgPool,
actor: &Actor,
change_id: Uuid,
) -> AppResult<Vec<String>>Expand description
Adds the in-work revisions of all unreleased dependencies – and, level by level, their own unreleased dependencies – to a draft change, in one transaction. Returns the labels of the added revisions.
§Invariants
- Permission: as
add_itemfor the change; a dependency in a group the actor may not edit is skipped (it stays a blocker), every other refusal ofadd_itemaborts all. - Locks: the change row (
FOR UPDATE), then each dependency revision (revisions::lock). - Audit:
change.add_itemper added revision. - Notifications / webhooks: none.
- Atomic: one transaction; all dependencies are added or none.