Let do-epic --file take --blocked-by and --parent, so a change a repo ships as two pull requests gets an issue for each
CI / tests (pull_request) Failing after 3m45s

This commit is contained in:
Lilleman
2026-11-19 15:52:49 +01:00
parent 017cf33611
commit b2630b8148
10 changed files with 123 additions and 29 deletions
+7 -2
View File
@@ -51,8 +51,8 @@ class EpicStore(typing.Protocol):
def read(self) -> list[EpicIssue] | Failure:
"""Each child issue, open or done, in the tracker's rank order, each followed by its sub-tasks in theirs."""
def file(self, parent: str, summary: str, detail: str, labels: tuple[str, ...]) -> str | Failure:
"""Files an open issue under parent, marked as filed by the loop, and answers its key: a child issue where parent is the epic, a sub-task where parent is one of its child issues. detail is markdown, and may be empty."""
def file(self, parent: str, summary: str, detail: str, labels: tuple[str, ...], blocked_by: str | None = None) -> str | Failure:
"""Files an open issue under parent, marked as filed by the loop, and answers its key: a child issue where parent is the epic, a sub-task where parent is one of its child issues. detail is markdown, and may be empty. Where blocked_by names an issue, a child issue of the epic or a sub-task of one, the new issue is blocked by it; any other issue is refused before anything is filed. Where the issue is filed and cannot be linked, the Failure names its key."""
def add_label(self, key: str, label: str) -> None | Failure:
"""Adds label to the epic's child issue named key, leaving its other labels as they are; adding one it already has leaves the labels as they are. A sub-task, or an issue outside the epic, is refused."""
@@ -93,6 +93,11 @@ def no_parent(epic_key: str, parent: str) -> Failure:
return Failure(f"{parent} is neither the epic {epic_key} nor one of its child issues, so nothing can be filed under it")
def no_blocker(epic_key: str, blocker: str) -> Failure:
"""What every backend says when asked to file an issue blocked by blocker, which is neither a child issue of the epic nor a sub-task of one."""
return Failure(f"{blocker} is neither a child issue of the epic {epic_key} nor a sub-task of one, so nothing can be filed blocked by it")
def no_child(epic_key: str, key: str, done_to_it: str) -> Failure:
"""What every backend says when asked to change key, which is not one of the epic's child issues; done_to_it is the past participle of what was asked, such as "labelled"."""
return Failure(f"{key} is not one of the child issues of the epic {epic_key}, so it cannot be {done_to_it}")