Read each epic issue's scores, blockers and whether the loop filed it, from both backends
CI / tests (pull_request) Successful in 2m41s

This commit is contained in:
2026-11-18 17:16:37 +01:00
parent 5e75655771
commit 2c1a84518f
8 changed files with 136 additions and 18 deletions
+8 -1
View File
@@ -6,6 +6,7 @@ import re
import typing
from failure import Failure
from plan.todo_table import ItemFields
# What a tracker accepts as a label: Jira refuses a label holding white space.
LABEL = re.compile(r"\S+")
@@ -28,6 +29,12 @@ class EpicIssue:
done: bool
# The epic's key for a child issue, the child's key for a sub-task.
parent: str
# The scores, Moves and Exempt a plan-item issue property holds, as `plan_store` reads them; its release and blocked_by stay unset, since an epic's items have no release and `blockers` holds theirs. Empty where the issue holds none, as a person's issue does.
scores: ItemFields = dataclasses.field(default_factory=ItemFields)
# The key of each issue this one is blocked by, in the tracker's order.
blockers: tuple[str, ...] = ()
# Whether the loop filed the issue, through EpicStore.file, rather than a person.
by_loop: bool = False
class EpicStore(typing.Protocol):
@@ -41,7 +48,7 @@ class EpicStore(typing.Protocol):
"""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 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."""
"""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 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."""