Skip to main content

add_dependencies

Function add_dependencies 

Source
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_item for the change; a dependency in a group the actor may not edit is skipped (it stays a blocker), every other refusal of add_item aborts all.
  • Locks: the change row (FOR UPDATE), then each dependency revision (revisions::lock).
  • Audit: change.add_item per added revision.
  • Notifications / webhooks: none.
  • Atomic: one transaction; all dependencies are added or none.