Answer product-owner round 2: 0 🔴, 0 🟡 (0 misread); read the epic again where a read fails during the wait, and reword two lines
CI / tests (pull_request) Successful in 3m56s

This commit is contained in:
Lilleman
2026-11-19 22:35:03 +01:00
parent 9caac90a62
commit b940f902b8
5 changed files with 17 additions and 11 deletions
+9 -5
View File
@@ -428,7 +428,7 @@ def handed_on(key: str, epic: EpicRun, by_others: bool = False) -> Stop:
"""The stop of a do-epic whose chunk finished. It first moves the chunk's issue to done (the epic's finishing has none), and its split item too where that was the last of the item's sub-tasks, so that no finished chunk starts again and what they block may start, then starts each chunk that may start now. by_others says someone else moves the issue where the team's automation moves issues: the automation from a chunk's pull request, or the human whose task it is. There it waits for that move (`moved_by_automation`) and moves only a split item, once Jira counts each of its sub-tasks done; a chunk without a repo has no pull request, so its issue moves to done as ever. Its window closes as it exits."""
# The epic's finishing has no issue to move: the epic is closed by `--close-epic`.
if key == epic.key:
issues = epic.store.read()
issues: list[EpicIssue] | Failure = epic.store.read()
elif by_others and epic.config.automation_moves:
issues = moved_by_automation(key, epic)
else:
@@ -450,13 +450,17 @@ def handed_on(key: str, epic: EpicRun, by_others: bool = False) -> Stop:
return Stop(0, "")
def moved_by_automation(key: str, epic: EpicRun) -> list[EpicIssue] | Failure:
"""The epic's issues once the issue called key no longer holds up another: read every POLL_SECONDS until the team's automation, or a person, has moved it. Until then a read would show it open, and its chunk would start again."""
told = False
def moved_by_automation(key: str, epic: EpicRun) -> list[EpicIssue]:
"""The epic's issues once the issue called key no longer holds up another: read every POLL_SECONDS until the team's automation, or a person, has moved it. Until then a read would show it open, and its chunk would start again. A read that fails is made again."""
told, unread = False, ""
while True:
issues = epic.store.read()
if isinstance(issues, Failure):
return issues
if issues.reason != unread:
say(f"cannot read the epic, so cannot tell whether {key} has moved; trying again every {POLL_SECONDS} seconds: {issues.reason}", epic.effects, stdout=True)
unread = issues.reason
epic.effects.sleep(POLL_SECONDS)
continue
by_key = {each.key: each for each in issues}
if key not in by_key or scheduler.settled(by_key[key], by_key, epic.config.unblocking):
return issues