From abe7226baa109b186665539cefba1794af65eab8 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 20 Nov 2026 15:48:27 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20product-owner=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1=20(0=20misread);=20print=20a?= =?UTF-8?q?=20status=20without=20cloning=20a=20repo,=20and=20say=20in=20th?= =?UTF-8?q?e=20contract=20that=20the=20comment=20goes=20first?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/do_epic/backend/protocol.py | 2 +- bin/do_epic/main.py | 4 +++- bin/do_epic/test_main.py | 13 +++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/bin/do_epic/backend/protocol.py b/bin/do_epic/backend/protocol.py index 6657aa09..5df26f7f 100644 --- a/bin/do_epic/backend/protocol.py +++ b/bin/do_epic/backend/protocol.py @@ -65,7 +65,7 @@ class EpicStore(typing.Protocol): """Posts text, markdown, as a comment on the epic's child issue named key, for the people who work the epic to read. A sub-task, an issue outside the epic, or an empty or blank text is refused.""" def set_scores(self, key: str, scores: dict[str, int], moves: str, comment: str) -> None | Failure: - """Sets the scores of the epic's child issue named key, or of a sub-task of one, then posts comment, markdown, on it, since a tracker's screens may not show the scores. scores holds each of L, E, I and S, and moves is the plan's Moves cell, which may be empty. An issue that holds a score keeps what it holds and is refused, as are an issue outside the epic and a blank comment. Where the comment fails after the scores are set, the Failure says so.""" + """Posts comment, markdown, on the epic's child issue named key, or on a sub-task of one, then sets its scores. The comment tells the team the scores, since a tracker's screens may not show them. scores holds each of L, E, I and S, and moves is the plan's Moves cell, which may be empty. An issue that holds a score keeps what it holds and is refused, as are an issue outside the epic and a blank comment. Where the scores cannot be set after the comment is posted, the Failure says so.""" def finish_issue(self, key: str) -> None | Failure: """Moves the epic's child issue named key, or a sub-task of one, to a done status, so that read answers it as done; one already done stays as it is. An issue outside the epic is refused. A Failure says why the move could not be made: the issue's workflow gives no way to a done status, gives several the backend cannot choose between, or refuses the move.""" diff --git a/bin/do_epic/main.py b/bin/do_epic/main.py index 9d982090..6616b64e 100644 --- a/bin/do_epic/main.py +++ b/bin/do_epic/main.py @@ -151,7 +151,9 @@ def run(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher: def status_printed(epic: EpicRun) -> Stop: """What `do-epic --status` does: prints a line per open issue, and doesn't start anything.""" issues = epic.store.read() - order = issues if isinstance(issues, Failure) else planning.start_order(planned_epic(epic), issues) + # Reading a repo's goals may clone it, which a status doesn't do. + reading = dataclasses.replace(epic, effects=dataclasses.replace(epic.effects, git=dry_run.without_clones(epic.effects.git))) + order = issues if isinstance(issues, Failure) else planning.start_order(planned_epic(reading), issues) # Where the issues cannot be put in order of score, they start in the backlog's order, as a run says. lines = issues if isinstance(issues, Failure) else status.lines(epic.key, epic.paths.home, issues, epic.config.label_repos, epic.config.unblocking, epic.effects.tmux, () if isinstance(order, Failure) else tuple(order)) return Stop(1, lines.reason) if isinstance(lines, Failure) else Stop(0, "\n".join(lines) or f"the epic {epic.key} has no open issue") diff --git a/bin/do_epic/test_main.py b/bin/do_epic/test_main.py index 667e7ebb..5995f96e 100644 --- a/bin/do_epic/test_main.py +++ b/bin/do_epic/test_main.py @@ -971,6 +971,19 @@ class TheStatus(DoEpicTest): out = self.run_main(["ABC-12", "--status"], FakeEffects())[1] self.assertEqual(out.replace("<1790000000> ", "").splitlines(), [f"ABC-21 waits: {room}, after each issue that holds every score, since it doesn't", f"ABC-24 waits: {room}"]) + def test_clones_no_missing_repo_to_print_the_status(self) -> None: + for repo in ("api", "web"): + configured(self, self.home / "code" / repo, home=self.home) + (self.home / "code" / repo / "README.md").write_text("## Goals\nServe the API.\n\n## Audience\nIts callers.\n", encoding="utf-8") + shutil.rmtree(self.home / "code/web") + self.description = DESCRIPTION + "\n## Scoring\n`Score = V`\n" + self.issues = [dataclasses.replace(issue(key, label), scores={"L": 1, "E": 1, "I": 1, "S": 1}) for key, label in (("ABC-20", "repo:api"), ("ABC-22", "repo:web"))] + fake = FakeEffects(git=["git@host.example:team/api.git"] * 3) + code, out, _ = self.run_main(["ABC-12", "--status"], fake) + self.assertEqual(code, 0) + self.assertIn("ABC-20 waits: it has not started", out) + self.assertEqual([what for seam, what in fake.calls if seam == "git" and "clone" in what], []) + def test_says_so_where_no_issue_is_open_or_the_epic_cannot_be_read(self) -> None: self.issues = [issue("ABC-20", "repo:api", done=True)] self.assertIn("the epic ABC-12 has no open issue\n", self.run_main(["ABC-12", "--status"], FakeEffects())[1])