Move an epic's issue to done in Jira when its chunk finishes
CI / tests (pull_request) Successful in 4m20s

This commit is contained in:
2026-11-18 23:04:34 +01:00
parent ea3da03468
commit 42cff3a8a7
9 changed files with 182 additions and 9 deletions
+19
View File
@@ -283,6 +283,25 @@ class AChunksRun(DoEpicTest):
self.assertEqual(code, 2, out)
self.assertIn("the judge ruled it unfinished 6 cycles running; finish the chunk yourself, or rerun do-epic to give it 6 more cycles", err + out)
def test_a_finished_chunk_moves_its_issue_to_done_before_the_chunk_it_blocks_starts(self) -> None:
store = MemoryEpic("ABC-12", [self.issues[0], self.issues[1], issue("ABC-22", "do-epic-claude", blockers=("ABC-21",))])
self.backend = lambda config, key: (store, EpicRecord(Description(self.description))) # type: ignore[method-assign,arg-type]
fake = FakeEffects(streams=[self.worker()], claude=[judged("finished")], git=UNREAD, windows="ABC-21\t0\t@9\n")
code, out, err = self.run_main(["--chunk", "ABC-21", "ABC-12"], fake, MODELS)
self.assertEqual(code, 0, err)
self.assertEqual({each.key: each.done for each in store.issues}, {"ABC-20": False, "ABC-21": True, "ABC-22": False})
self.assertIn("the chunk finished; started ABC-22\n", out)
def test_a_chunk_whose_issue_jira_will_not_move_to_done_stops_with_the_reason_and_starts_no_other(self) -> None:
store = MemoryEpic("ABC-12", list(self.issues))
store.finish = lambda key: Failure("ABC-21's status has no transition to a done status") # type: ignore[method-assign]
self.backend = lambda config, key: (store, EpicRecord(Description(self.description))) # type: ignore[method-assign,arg-type]
fake = FakeEffects(streams=[self.worker()], claude=[judged("finished")], git=UNREAD)
code, out, err = self.run_main(["--chunk", "ABC-21", "ABC-12"], fake, MODELS)
self.assertEqual(code, 1)
self.assertIn("the chunk finished, but its issue could not move to done: ABC-21's status has no transition to a done status\n", err)
self.assertNotIn("started", out)
def test_a_finished_chunk_says_why_the_next_could_not_start(self) -> None:
store = MemoryEpic("ABC-12", list(self.issues))
reads = iter([self.issues, self.issues, Failure("Jira answered 503")])