Let do-epic --file take --blocked-by and --parent, so a change a repo ships as two pull requests gets an issue for each
CI / tests (pull_request) Failing after 3m45s

This commit is contained in:
Lilleman
2026-11-19 15:52:49 +01:00
parent 017cf33611
commit b2630b8148
10 changed files with 123 additions and 29 deletions
+18 -1
View File
@@ -90,6 +90,23 @@ class FilingAFinding(FindingsTest):
code, out, _, _ = self.run_with(["ABC-12", "--file", "Review api", "--label", "do-epic-release-review"])
self.assertEqual((code, out), (0, f"Filed {self.store.issues[-1].key} in the epic ABC-12. It has no label that says where it is worked, so the next `do-epic ABC-12` picks one: `repo:<name>` for the repo that works it, `do-epic-claude` for work of Claude's that changes no repo, or `do-epic-human` for a task of the human's.\n"))
def test_files_the_next_step_of_a_change_blocked_by_the_issue_before_it(self) -> None:
code, out, err, _ = self.run_with(["ABC-12", "--file", "Change it", "--label", "repo:api", "--blocked-by", "ABC-20"], "Detail.\n")
filed = self.store.issues[-1]
self.assertEqual((code, out, err), (0, f"Filed {filed.key} in the epic ABC-12. It is blocked by ABC-20.\n", ""))
self.assertEqual((filed.parent, filed.blockers, filed.labels), ("ABC-12", ("ABC-20",), ("repo:api",)))
def test_files_a_sub_task_under_a_child_issue_of_the_epic(self) -> None:
code, out, _, _ = self.run_with(["ABC-12", "--file", "--parent", "ABC-20", "Change it", "--label", "repo:api", "--blocked-by", "ABC-21"])
filed = self.store.issues[-1]
self.assertEqual((code, out, filed.parent, filed.blockers), (0, f"Filed {filed.key} under ABC-20 in the epic ABC-12. It is blocked by ABC-21.\n", "ABC-20", ("ABC-21",)))
def test_refuses_a_blocker_or_parent_outside_the_epic(self) -> None:
for argv, reason in ((["--blocked-by", "ZZZ-1"], "ZZZ-1 is neither a child issue of the epic ABC-12 nor a sub-task of one, so nothing can be filed blocked by it"), (["--parent", "ZZZ-1"], "ZZZ-1 is neither the epic ABC-12 nor one of its child issues, so nothing can be filed under it")):
with self.subTest(argv=argv):
code, out, err, _ = self.run_with(["ABC-12", "--file", "Retry", "--label", "repo:api", *argv])
self.assertEqual((code, out, err, len(self.store.issues)), (1, "", f"cannot file the finding in the epic ABC-12: {reason}\n", 2))
def test_refuses_a_label_the_scheduler_doesnt_read(self) -> None:
for label in ("api", "repo:", "repo:a b"):
with self.subTest(label=label):
@@ -114,7 +131,7 @@ class FilingAFinding(FindingsTest):
self.assertIn("config.toml", err)
def test_prints_the_help_for_a_filing_spelt_wrong(self) -> None:
for argv in (["ABC-12", "--file"], ["ABC-12", "--file", "a", "b"], ["ABC-12", "--file", "a", "--label"], ["ABC-12", "--file", "a", "--labels", "x"], ["--file", "ABC-12", "a"], ["ABC-12", "--file", "--label", "x"], ["ABC-12", "--file", "--lable"], ["ABC-12", "--file", "a", "--label", "--x"], ["--chunk", "ABC-20", "ABC-12", "--file", "a"]):
for argv in (["ABC-12", "--file"], ["ABC-12", "--file", "a", "b"], ["ABC-12", "--file", "a", "--label"], ["ABC-12", "--file", "a", "--labels", "x"], ["--file", "ABC-12", "a"], ["ABC-12", "--file", "--label", "x"], ["ABC-12", "--file", "--lable"], ["ABC-12", "--file", "a", "--blocked-by"], ["ABC-12", "--file", "a", "--blocked-by", "ABC-100", "--blocked-by", "ABC-101"], ["ABC-12", "--file", "a", "--parent", "ABC-100", "--parent", "ABC-101"], ["ABC-12", "--file", "a", "--parent", "--label", "x"], ["ABC-12", "--record-decision", "a", "--blocked-by", "ABC-100"], ["ABC-12", "--file", "a", "--label", "--x"], ["--chunk", "ABC-20", "ABC-12", "--file", "a"]):
with self.subTest(argv=argv):
code, out, err, _ = self.run_with(argv)
self.assertEqual((code, out, err, len(self.store.issues)), (1, "", main.HELP + "\n", 2))