Answer product-owner round 2: 0 🔴, 1 🟡 (0 misread); print a status without cloning a repo, and say in the contract that the comment goes first
CI / tests (pull_request) Successful in 4m30s

This commit is contained in:
Lilleman
2026-11-20 15:48:27 +01:00
parent 481e13253a
commit abe7226baa
3 changed files with 17 additions and 2 deletions
+1 -1
View File
@@ -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."""
+3 -1
View File
@@ -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 <EPIC-KEY> --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")
+13
View File
@@ -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])