livery.workshop._runs¶
livery.workshop._runs ¶
Which run replaced a cancelled one, so a watcher can say so and follow.
A forge cancels a run when a newer one supersedes it: a twin for the same head (the pull request opened and its branch pushed in the same breath), or the run for a head that moved under a watch. Read alone, the cancelled run says "cancelled" and sends its reader to the forge to learn nothing went wrong. livery.workshop._runs.successor names the run that took over, and the watchers speak it.
Classes:
| Name | Description |
|---|---|
Succession |
A cancelled run's successor and how it relates. |
Functions:
| Name | Description |
|---|---|
successor |
The run that superseded run, or |
supersession_note |
The words for a cancelled run: who took over, or that no one did. |
Succession
dataclass
¶
successor ¶
successor(repo: Repository, run: Run, *, branch: str = '') -> Succession | None
The run that superseded run, or None when none is known.
A twin is a newer run of the same workflow for the same head that
was not itself cancelled. Failing that, branch, when the caller
knows which branch it watched, names the pull request whose head
moved past run's and its newest run for the new head; a forge
files a pull request under its current head only, so the old
head cannot find it. A forge that cannot answer answers None:
the caller then reports the cancellation as it stands.
Source code in packages/workshop/src/livery/workshop/_runs.py
supersession_note ¶
supersession_note(repo: Repository, run: Run, *, branch: str = '') -> str
The words for a cancelled run: who took over, or that no one did.