Answer product-owner round 1: 1 🔴, 1 🟡 (0 misread); say when planning stops at a missing repo, mark what the dry run would do, and reword its text and docs (the stability and prose answers are in this commit too)

This commit is contained in:
Lilleman
2026-11-20 09:53:06 +01:00
parent 2c0673f5bf
commit 5630c3ba2e
5 changed files with 41 additions and 20 deletions
+23 -4
View File
@@ -970,6 +970,9 @@ class TheStatus(DoEpicTest):
self.assertIn("Jira answered 503\n", err)
BANNER = "dry run: nothing is written to Jira and no window starts, so a line below that says an issue is labelled or split shows what a real run would do"
class TheDryRun(DoEpicTest):
def setUp(self) -> None:
super().setUp()
@@ -1006,7 +1009,7 @@ class TheDryRun(DoEpicTest):
code, out, _ = self.run_main(["ABC-12", "--dry-run"], FakeEffects(on_terminal=True))
self.assertEqual(code, 0)
shown = out.replace("<1790000000> ", "")
self.assertIn("planning would write nothing to Jira\nwould start ABC-21\n", shown)
self.assertIn("planning wouldn't write anything to Jira\nwould start ABC-21\n", shown)
self.assertIn("ABC-22 waits: the epic runs as many chunks as its `**Max parallel chunks:**` line allows: 1\n", shown)
def test_prints_the_question_planning_would_ask_and_asks_none(self) -> None:
@@ -1017,7 +1020,7 @@ class TheDryRun(DoEpicTest):
self.assertEqual(code, 0)
self.assertIn("ABC-20 waits for your answer: Is the importer in api or in web?", out)
self.assertEqual([seam for seam, _ in fake.calls if seam == "input"], [])
self.assertIn("planning would write nothing to Jira\n", out)
self.assertIn("planning wouldn't write anything to Jira\n", out)
def test_works_without_tmux_and_a_chunk_in_a_missing_repo_waits(self) -> None:
self.issues = [issue("ABC-20", "repo:missing"), issue("ABC-21", "do-epic-claude")]
@@ -1025,7 +1028,6 @@ class TheDryRun(DoEpicTest):
code, out, _ = self.run_main(["ABC-12", "--dry-run"], fake)
self.assertEqual(code, 0)
self.assertIn("would start ABC-21\n", out)
self.assertIn("ABC-20 waits:", out)
self.assertIn("ABC-20 waits: missing is missing", out)
self.assertEqual([what for seam, what in fake.calls if seam == "git" and "clone" in what], [])
@@ -1035,9 +1037,26 @@ class TheDryRun(DoEpicTest):
fake = FakeEffects(on_terminal=False, git=["git@host.example:team/api.git", ""])
code, out, err = self.run_main(["ABC-12", "--dry-run"], fake)
self.assertEqual((code, err), (0, ""))
self.assertEqual(out.replace("<1790000000> ", ""), f"dry run: nothing is written to Jira and no window starts\nplanning would write nothing to Jira\nwould start ABC-20\nABC-22 waits: cannot clone git@host.example:team/web to {self.home / 'code/web'}: a dry run clones nothing. Where does web live?\n")
self.assertEqual(out.replace("<1790000000> ", ""), f"{BANNER}\nplanning wouldn't write anything to Jira\nwould start ABC-20\nABC-22 waits: cannot clone git@host.example:team/web to {self.home / 'code/web'}: a dry run doesn't clone a repo, but a real run would. Where does web live?\n")
self.assertEqual([what for seam, what in fake.calls if seam == "git" and "clone" in what], [])
def test_says_on_stdout_that_planning_stopped_at_a_missing_repo_and_what_the_writes_are(self) -> None:
shutil.rmtree(self.home / "code/web")
self.issues = [issue("ABC-20"), issue("ABC-22", "repo:api"), issue("ABC-23", "repo:web")]
fake = FakeEffects(on_terminal=False, git=["git@host.example:team/api.git", ""])
code, out, err = self.run_main(["ABC-12", "--dry-run"], fake)
self.assertEqual((code, err), (0, ""))
stopped = f"the epic ABC-12 is not planned in full: cannot clone git@host.example:team/web to {self.home / 'code/web'}: a dry run doesn't clone a repo, but a real run would. Where does web live?, so the writes below are those it made before it stopped\n"
self.assertIn(stopped, out.replace("<1790000000> ", ""))
self.assertIn("planning wouldn't write anything to Jira\n", out)
def test_indents_the_lines_after_the_first_of_a_comment_under_its_bullet(self) -> None:
self.issues = [issue("ABC-20")]
parts = structured({"parts": [{"repo": "api", "change": "Add it."}, {"repo": "web", "change": "Call it."}], "comment": "Split by repo.\nSecond line."})
code, out, _ = self.run_main(["ABC-12", "--dry-run"], FakeEffects(claude=[parts]))
self.assertEqual(code, 0)
self.assertIn("\n- comment on ABC-20: Split by repo.\n Second line.\n", out)
def test_stops_where_the_epic_cannot_be_read(self) -> None:
store = MemoryEpic("ABC-12", [], fails="Jira answered 503")
self.backend = lambda config, key: (store, EpicRecord(Description(self.description))) # type: ignore[method-assign,arg-type]