Answer product-owner round 2: 1 🔴, 0 🟡 (0 misread); DM through the notifier of a repo of the epic, and say in the window where none names one

This commit is contained in:
2026-11-19 03:01:31 +01:00
parent d4acb4b039
commit 4fac73c890
3 changed files with 43 additions and 14 deletions
+9 -6
View File
@@ -27,12 +27,12 @@ def message(task: EpicIssue, epic: str, held: list[str]) -> str:
return f"do-epic {epic} awaits you: {task.key}, \"{task.summary}\", blocks {' and '.join(held)}. do-epic goes on once you close {task.key} in Jira."
def checkout_of(held: list[EpicIssue], home: pathlib.Path) -> str | None:
"""The checkout of the first issue of held whose repo a project config names: where the DM finds its notifier, since the window runs in no checkout. None where there is none, and the DM goes by the current directory."""
for issue in held:
def notifier_checkout(issues: list[EpicIssue], home: pathlib.Path) -> str | None:
"""The checkout of the first of issues whose repo has a git checkout and a project config that names a notifier: where the DM finds that notifier, since the window runs in no checkout. None where there is none."""
for issue in issues:
pick = recorded(issue)
found = by_name(pick.name, home) if isinstance(pick, Repo) else None
if isinstance(found, ProjectConfig):
if isinstance(found, ProjectConfig) and found.notifier and (found.top / ".git").exists():
return str(found.top)
return None
@@ -52,6 +52,9 @@ def awaited(task: EpicIssue, epic: str, store: EpicStore, window: tmux.Window, p
elif not told:
text = message(task, epic, held)
say(text, effects, stdout=True)
by_key = {issue.key: issue for issue in issues}
told = tell(text, effects, checkout_of([by_key[key] for key in held], home))
# The issues it holds up come first; any other open issue of the epic may do where they have no repo with a notifier.
where = notifier_checkout([*(issue for issue in issues if issue.key in held), *(issue for issue in issues if issue.key not in held and not issue.done)], home)
if where is None:
say("no DM went out: no open issue of the epic has a repo whose project config names a notifier and whose checkout exists", effects, stdout=True)
told = where is None or tell(text, effects, where)
effects.sleep(poll)