Read a plan from the child issues of a Jira Cloud epic
CI / tests (pull_request) Failing after 2m6s

This commit is contained in:
2026-11-14 19:12:25 +01:00
parent c19f097ecd
commit 59d972cc82
22 changed files with 570 additions and 30 deletions
+8
View File
@@ -1217,6 +1217,14 @@ class TodoRankCheck(unittest.TestCase):
(self.config.parent / "todo.md").write_text("# todo\n")
self.assertEqual(self.details(checkout), [f"own script checked {self.config.parent}/todo.md"])
def test_a_plan_in_jira_is_not_checked_in_the_checkout_or_the_configs_folder(self):
checkout = self.changed_plan(f"{self.folder}/clone", self.STUB)
self.config.write_text(self.config.read_text().replace('"checkout:todo.md"', '"jira:https://acme.atlassian.net/browse/ABC-12"') + 'env-file = "~/acme.env"\n')
folder = str(self.config.parent)
git(folder, "init", "-q")
(self.config.parent / "todo.md").write_text("# todo\n")
self.assertEqual((self.details(checkout), self.details(folder)), ([], []))
def test_a_commit_in_the_configs_folder_checks_the_plan_it_keeps_there_once_it_changes(self):
checkout = self.changed_plan(f"{self.folder}/clone", self.STUB)
folder = str(self.config.parent)
+5 -5
View File
@@ -32,9 +32,9 @@ def todo_breaches(directory: str, home: pathlib.Path, own: pathlib.Path = OWN) -
# A checkout whose todo.md changes with no config is one whose config is still to write. An unchanged todo.md may be a third party's, whose clone needs no config.
unconfigured = pathlib.Path(top) / "todo.md"
return [Breach("todo-rank-check", config.reason, top)] if unconfigured.is_file() and changed(top, unconfigured, "todo.md") else []
todo, tracked = config.paths["plan"], config.tracked("plan")
# A plan outside the checkout has no commit in the checkout to differ from, so it is checked on every call.
if not todo.is_file() or (tracked is not None and not changed(top, todo, tracked)):
todo, tracked = config.plan_file, config.tracked("plan")
# A plan outside the checkout has no commit in the checkout to differ from, so it is checked on every call. A plan in Jira is no file, and Jira's backlog ranks it.
if todo is None or not todo.is_file() or (tracked is not None and not changed(top, todo, tracked)):
return []
return [Breach("todo-rank-check", line, top) for line in check_failures(top, todo, config, own)]
@@ -43,9 +43,9 @@ def folder_breaches(top: str, config: ProjectConfig | Failure, own: pathlib.Path
"""Why the plan kept in top, a config's folder, is not ranked, where the plan has changed in that folder's repo; ranked as for a commit in the project's checkout.
A config that fails to load doesn't block anything here, so that the commit that fixes it goes through."""
if isinstance(config, Failure) or not config.paths["plan"].is_relative_to(config.folder):
todo = None if isinstance(config, Failure) else config.plan_file
if isinstance(config, Failure) or todo is None or not todo.is_relative_to(config.folder):
return []
todo = config.paths["plan"]
if not todo.is_file() or not changed(str(config.folder), todo, todo.relative_to(config.folder).as_posix()):
return []
return [Breach("todo-rank-check", line, top) for line in check_failures(str(config.top), todo, config, own)]