Answer stability round 1: 1 🔴, 5 🟡 (0 misread); hold a pull request's base on the forge to the recorded one, ask origin for the epic branch, and name where a chunk's work landed
CI / tests (pull_request) Successful in 3m46s

This commit is contained in:
Lilleman
2026-11-20 21:42:32 +01:00
parent 525f3f8836
commit d464f271bf
13 changed files with 352 additions and 74 deletions
+20 -1
View File
@@ -13,7 +13,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from project_config.templates import BRANCH
from release_plan.next_chunk import CarriedOver, NoItem
from project_config.settings import Epic, ProjectConfig
from chunk_preflight.main import epic_branch_of, item_worktree, line_count, ran, seconds, TIMEOUT
from chunk_preflight.main import epic_branch_of, item_facts as facts_made, item_worktree, line_count, ran, seconds, TIMEOUT
from failure import Failure
from chunk_preflight.gathered import Gathered, ItemFacts, LeftWorktree, NamedPath, Ran, Worktree
from git_cli import git_repo
@@ -637,6 +637,25 @@ class EpicBranchWorktree(unittest.TestCase):
self.assertIsNone(epic_branch_of(dataclasses.replace(config, epic_branch=None)))
self.assertEqual(epic_branch_of(dataclasses.replace(config, epic=None)), Failure("none made: the config sets `epic-branch`, but its `plan` names no Jira epic to name the branch by; chunk-preflight makes an epic's chunks only from a plan kept in Jira"))
def test_the_facts_of_an_item_put_its_worktree_on_the_epic_branch_they_are_given(self):
facts = facts_made(self.repo.root, "origin/main", planned(TODO, CUT, "origin/main", BRANCH), 30, True, "ABC-1")
self.assertEqual(facts.worktree.path, self.repo.temp / "proj-item-3")
self.assertTrue(facts.worktree.how.endswith("The chunk's pull request goes into ABC-1."), facts.worktree.how)
self.assertEqual(self.repo.git(self.repo.root, "config", "--get", "branch.item-3.chunk-base"), "ABC-1\n")
def test_the_facts_of_an_item_make_no_worktree_where_the_epic_branch_cannot_be_named(self):
unnamed = Failure("none made: the plan names no epic")
self.assertEqual(facts_made(self.repo.root, "origin/main", planned(TODO, CUT, "origin/main", BRANCH), 30, True, unnamed).worktree, unnamed)
self.assertFalse((self.repo.temp / "proj-item-3").exists())
def test_the_tool_makes_no_worktree_where_the_config_sets_an_epic_branch_and_keeps_its_plan_in_a_file(self):
config = self.repo.temp / "home" / ".claude-projects" / "proj" / "config.toml"
config.write_text(config.read_text() + 'epic-branch = "{epic}"\n')
done = self.repo.preflight("--worktree")
self.assertEqual(done.returncode, 0, done.stderr)
self.assertIn("none made: the config sets `epic-branch`, but its `plan` names no Jira epic to name the branch by", done.stdout)
self.assertFalse((self.repo.temp / "proj-item-3").exists())
class OpenPulls(unittest.TestCase):
def test_lists_gh_rows_as_they_come_and_only_teas_rows_from_the_branch(self):