Kill the surviving mutants of the finish moves: the fake's status and refusal, an unreadable epic, and one more split item per finish
This commit is contained in:
+15
-7
@@ -230,19 +230,27 @@ def handed_on(key: str, epic: EpicRun) -> Stop:
|
||||
return Stop(1, f"the chunk finished, but the next could not start: {issues.reason}")
|
||||
# A search may not show the move yet, so the issue counts as done here whatever the read says.
|
||||
issues = [dataclasses.replace(each, done=True) if each.key == key else each for each in issues]
|
||||
above = next((each.parent for each in issues if each.key == key), "")
|
||||
if not any(each.key == above and each.done for each in issues) and split.finished(issues, above):
|
||||
moved = epic.store.finish(above)
|
||||
if isinstance(moved, Failure):
|
||||
return Stop(1, f"the chunk finished, but its split item {above} could not move to done: {moved.reason}; once it is done in Jira, run `do-epic {epic.key}` to start the chunks it blocks")
|
||||
issues = [dataclasses.replace(each, done=True) if each.key == above else each for each in issues]
|
||||
started = chunks_started(epic, issues, key)
|
||||
closed = split_items_closed(epic, issues)
|
||||
if isinstance(closed, Stop):
|
||||
return closed
|
||||
started = chunks_started(epic, closed, key)
|
||||
if isinstance(started, Failure):
|
||||
return Stop(1, f"the chunk finished, but the next could not start: {started.reason}")
|
||||
say(f"the chunk finished; started {', '.join(started.started) or 'no other'}", epic.effects, stdout=True)
|
||||
return Stop(0, "")
|
||||
|
||||
|
||||
def split_items_closed(epic: EpicRun, issues: list[EpicIssue]) -> list[EpicIssue] | Stop:
|
||||
"""The issues, with each item split by repo whose sub-tasks are all done moved to done in the tracker and read as done; the stop where one cannot move. Its last sub-task to finish closes it, and one an earlier run left open closes with it."""
|
||||
for item in issues:
|
||||
if split.SPLIT_LABEL in item.labels and not item.done and split.finished(issues, item.key):
|
||||
moved = epic.store.finish(item.key)
|
||||
if isinstance(moved, Failure):
|
||||
return Stop(1, f"the chunk finished, but its split item {item.key} could not move to done: {moved.reason}; once it is done in Jira, run `do-epic {epic.key}` to start the chunks it blocks")
|
||||
issues = [dataclasses.replace(each, done=True) if each.key == item.key else each for each in issues]
|
||||
return issues
|
||||
|
||||
|
||||
def next_cycle(loop_run: LoopRun, loop: Loop, in_repo: bool, epic: EpicRun) -> Cycle | Stop:
|
||||
"""The cycle loop_run runs next, from the issue, the premises, the records, the models and the routing ladder read afresh; the stop where one of them cannot be read. A chunk in a repo routes on that repo's model and ladder, and one without a repo on the machine setting `repoless-model` and the shipped ladder."""
|
||||
issue = issue_read(loop.window.name, epic)
|
||||
|
||||
Reference in New Issue
Block a user