Answer stability round 1: 0 🔴, 3 🟡 (0 misread); restrict a repo name, split the multi-behaviour tests, and word the prose findings of the prose round
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""What every backend of an epic's plan reads and files: an EpicIssue, and the EpicStore protocol they all meet. do-epic reads an epic only through EpicStore, so another tracker can stand behind it; contract.py holds the tests every backend passes.
|
||||
"""What every backend of an epic's plan reads, files and labels: an EpicIssue, and the EpicStore protocol they all meet. do-epic reads an epic only through EpicStore, so another tracker can stand behind it; contract.py holds the tests every backend passes.
|
||||
|
||||
EpicStore is not plan_store's PlanStore. A PlanStore item names a release, but an epic item has none (`docs/decisions.md` → `do-epic: drives one Jira epic …`), and it may be a sub-task."""
|
||||
import dataclasses
|
||||
@@ -44,18 +44,18 @@ class EpicStore(typing.Protocol):
|
||||
"""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."""
|
||||
|
||||
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 changes nothing. A sub-task, or an issue outside the epic, is refused."""
|
||||
"""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."""
|
||||
|
||||
|
||||
def unfit(summary: str, labels: tuple[str, ...]) -> Failure | None:
|
||||
"""Why no tracker can file an issue with this summary and these labels; None where one can."""
|
||||
"""Why no tracker can file an issue with this summary and these labels; None where a tracker can file it."""
|
||||
if not summary.strip() or "\n" in summary:
|
||||
return Failure("the summary must be one line of text")
|
||||
return unfit_label(*labels)
|
||||
|
||||
|
||||
def unfit_label(*labels: str) -> Failure | None:
|
||||
"""Why no tracker can take one of these labels; None where one can."""
|
||||
"""Why no tracker can take one of these labels; None where a tracker can take every one."""
|
||||
if bad := next((label for label in labels if not LABEL.fullmatch(label)), None):
|
||||
return Failure(f"the label {bad!r} is empty or holds white space")
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user