From b89ac805d39a05bd0cfe7ad0d2040bd12f9d1285 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 16 Nov 2026 01:08:13 +0100 Subject: [PATCH] Route on a cut release's carried item --- bin/chunk_preflight/choices.py | 2 +- bin/chunk_preflight/gathered.py | 2 +- bin/chunk_preflight/test_chunk_preflight.py | 2 +- bin/loop_claude/test_loop_claude.py | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/chunk_preflight/choices.py b/bin/chunk_preflight/choices.py index 2bced0c0..b70d30ac 100644 --- a/bin/chunk_preflight/choices.py +++ b/bin/chunk_preflight/choices.py @@ -2,8 +2,8 @@ import pathlib from release_plan.release_standing import carried, chunk_item, Cut, dated_cut, LastCut, ReadyToCut, ReviewDue, Unknown, Unplanned -from failure import Failure from chunk_preflight.gathered import CarriedOver, Forge, NoItem, Plan +from failure import Failure from release_plan.todo_table import NoItemsTable from plan_store import stores as plan_stores from release_plan.release import version diff --git a/bin/chunk_preflight/gathered.py b/bin/chunk_preflight/gathered.py index 62c78475..0bc5305c 100644 --- a/bin/chunk_preflight/gathered.py +++ b/bin/chunk_preflight/gathered.py @@ -5,8 +5,8 @@ import typing from failure import Failure from release_plan.todo_table import Item -from release_plan.release import Release from release_plan.release_standing import LastCut +from release_plan.release import Release from project_config import templates # The CLI that lists a forge's pull requests: gh for a github.com origin, tea for any other. diff --git a/bin/chunk_preflight/test_chunk_preflight.py b/bin/chunk_preflight/test_chunk_preflight.py index 2204fd96..d27fd905 100644 --- a/bin/chunk_preflight/test_chunk_preflight.py +++ b/bin/chunk_preflight/test_chunk_preflight.py @@ -10,10 +10,10 @@ import unittest sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from project_config.templates import BRANCH +from chunk_preflight.gathered import CarriedOver, Gathered, ItemFacts, NamedPath, NoItem, Ran, Worktree from chunk_preflight import choices from failure import Failure from chunk_preflight.choices import forge_of, worktree_add -from chunk_preflight.gathered import CarriedOver, Gathered, ItemFacts, NamedPath, NoItem, Ran, Worktree from test_env import isolated_env from release_plan.release_standing import LastCut, UNSEEN_RELEASES from chunk_preflight.main import line_count, ran, seconds, TIMEOUT diff --git a/bin/loop_claude/test_loop_claude.py b/bin/loop_claude/test_loop_claude.py index 970149d3..46eae312 100644 --- a/bin/loop_claude/test_loop_claude.py +++ b/bin/loop_claude/test_loop_claude.py @@ -984,7 +984,9 @@ class Routing(unittest.TestCase): def test_routes_on_no_item_where_the_release_after_the_last_cut_has_none(self): self.assertEqual(routed_item(TODO, LastCut("v0.1.0", "", 3, [TODO])).id, 3) - self.assertIsNone(routed_item(TODO, LastCut("v0.2.0", "", 3, [TODO]))) + # Someone cut 0.2.0 while it held items: they count as 0.3.0's, the next the plan names, and where it names none, no item routes. + self.assertEqual(routed_item(TODO, LastCut("v0.2.0", "", 3, [TODO])).id, 3) + self.assertIsNone(routed_item(re.sub(r"(?m)^\| \d+ \| 0\.3\.0 \|.*\n", "", TODO), LastCut("v0.2.0", "", 3, [TODO]))) later_only = TODO[:TODO.index("| 7 |")] + TODO[TODO.index("| 1 | 0.3.0 |"):] self.assertIsNone(routed_item(later_only, LastCut("v0.1.0", "", 3, [TODO]))) self.assertIsNone(routed_item(later_only, LastCut("v0.1.0", "", 0, [TODO]))) @@ -1125,7 +1127,7 @@ class RouteSources(unittest.TestCase): def test_routes_on_the_plan_item_and_says_why_it_routes_on_the_projects_rung(self): self.assertIsNone(chunk_start.plan_item(DefaultPlan(plan_of(""), NO_CUT), FakeEffects().effects())) self.assertEqual(chunk_start.plan_item(DefaultPlan(plan_of(TODO), LastCut("v0.1.0", "", 3, [TODO])), FakeEffects().effects()).id, 3) - self.assertIsNone(chunk_start.plan_item(DefaultPlan(plan_of(TODO), LastCut("v0.2.0", "", 3, [TODO])), FakeEffects().effects())) + self.assertIsNone(chunk_start.plan_item(DefaultPlan(plan_of(TODO), LastCut("v0.3.0", "", 3, [TODO])), FakeEffects().effects())) unreadable = Failure("git show origin/main:todo.md printed text that is not UTF-8") for plan, said in ((DefaultPlan(plan_of(TODO.replace("| 4 | 2 | 3 |", "| x | 2 | 3 |")), NO_CUT), "routing on the project's rung: item 3's L 'x' is not a whole number from 1 to 4\n"), (DefaultPlan(unreadable, NO_CUT), f"routing on the project's rung: {unreadable.reason}\n"), (Failure("no origin remote"), "routing on the project's rung: no origin remote\n")): with self.subTest(said=said):