diff --git a/bin/do_epic/test_finish.py b/bin/do_epic/test_finish.py index 4f819cb9..1a49a4b9 100644 --- a/bin/do_epic/test_finish.py +++ b/bin/do_epic/test_finish.py @@ -66,7 +66,7 @@ class TheFinishingChunksTask(DoEpicTest): self.assertIn("`/b/do-epic ABC-12 --close-epic`", task) self.assertIn("in Swedish", task) self.assertIn(findings.instructions("ABC-12", LAUNCHER, "Swedish"), task) - self.assertIn("- ABC-20 (api): Do ABC-20\n- ABC-21: Do ABC-21\n- ABC-30 (api): Do ABC-30", task) + self.assertIn("The epic's issues, each done:\n\n- ABC-20 (api): Do ABC-20\n- ABC-21: Do ABC-21\n- ABC-30 (api): Do ABC-30", task) self.assertNotIn("do-epic-release-review`", task) diff --git a/bin/do_epic/test_planning.py b/bin/do_epic/test_planning.py index 2b4513a9..bab1228d 100644 --- a/bin/do_epic/test_planning.py +++ b/bin/do_epic/test_planning.py @@ -101,6 +101,17 @@ class Planning(DoEpicTest): self.assertIn("ABC-20 is split into a sub-task for each of api, web\n", out) self.assertIn("in English, that tells the team why it is split by repo", fake.made("claude")[0][1]) + def test_a_failed_runs_sub_task_under_the_teams_label_is_not_filed_again_and_another_label_is_no_pick(self) -> None: + with (self.home / ".claude-projects/do-epic/config.toml").open("a", encoding="utf-8") as config: + config.write('\n[label-repos]\nbackend = "api"\n') + configured(self, self.home / "code" / "api", home=self.home) + self.issues = [issue("ABC-20", "urgent"), dataclasses.replace(issue("ABC-23", "backend", parent="ABC-20"), by_loop=True), issue("ABC-21", "urgent")] + parts = says({"parts": [{"repo": "api", "change": "Add the endpoint."}, {"repo": "web", "change": "Call it."}], "comment": "Split by repo: api and web."}) + _, store, _ = self.plan(FakeEffects(claude=[parts, says({"parts": []}), says({"pick": "human"})])) + read = store.read() + assert not isinstance(read, Failure) + self.assertEqual(([task.labels for task in read if task.parent == "ABC-20"], self.labels(store)["ABC-21"]), ([("backend",), ("repo:web",)], ("do-epic-human", "urgent"))) + def test_plans_the_issue_after_one_that_is_split(self) -> None: self.issues = [issue("ABC-20"), issue("ABC-21")] parts = says({"parts": [{"repo": "api", "change": "Add the endpoint."}, {"repo": "web", "change": "Call it."}], "comment": "Split by repo: api and web."}) diff --git a/bin/do_epic/test_scheduler.py b/bin/do_epic/test_scheduler.py index f3d8f2cc..9b40100a 100644 --- a/bin/do_epic/test_scheduler.py +++ b/bin/do_epic/test_scheduler.py @@ -73,6 +73,11 @@ class WhichIssuesAreChunks(unittest.TestCase): task = dataclasses.replace(issue("ABC-23", "repo:api", parent="ABC-20"), by_loop=True) self.assertEqual(chunks([issue("ABC-20"), task], {}), ([Chunk("ABC-23", "api")], [Waits("ABC-20", "no label names its repo")])) + def test_names_each_blocker_outside_the_epic(self) -> None: + self.assertEqual(chunks([issue("ABC-20", "repo:api", blockers=("XYZ-1", "XYZ-2"))], {})[1], [ + Waits("ABC-20", "XYZ-1 and XYZ-2 block it; do-epic cannot see XYZ-1 and XYZ-2, outside the epic, finish: remove such a link in Jira once its issue is done"), + ]) + def test_an_issue_waits_for_its_pick_its_human_and_its_blockers(self) -> None: found = chunks([ issue("ABC-20"),