Check the awaited-merges stop in one place and name the pull-request listing in the package notes
CI / tests (pull_request) Successful in 3m1s

This commit is contained in:
Lilleman
2026-11-20 00:25:37 +01:00
parent 500bd126a4
commit 2797e11080
6 changed files with 7 additions and 12 deletions
+2 -2
View File
@@ -83,9 +83,9 @@ class AwaitedMerges:
def may_start(plan: NextChunk | NoItem, running: list[str], held: set[int], room: int) -> list[str]:
"""The chunks to start now beside the running ones, whose chunks hold the items in held: the plan's next item and the items touch_predictions picks to run beside it, in the plan's order, up to room of them. Each leaves out an item in held, and one whose `Touches:` prediction overlaps a held item's, or where either has none. A plan without an item starts NO_ITEM, and only alone; none where its NoItem names pull requests that await a person's merge."""
"""The chunks to start now beside the running ones, whose chunks hold the items in held: the plan's next item and the items touch_predictions picks to run beside it, in the plan's order, up to room of them. Each leaves out an item in held, and one whose `Touches:` prediction overlaps a held item's, or where either has none. A plan without an item starts NO_ITEM, and only alone."""
if isinstance(plan, NoItem):
return [] if running or room < 1 or plan.awaits_merge else [NO_ITEM]
return [] if running or room < 1 else [NO_ITEM]
beside = chunks_beside(plan.items, plan.first)
picked = [plan.first.id, *(beside.picked if isinstance(beside, Beside) else [])]
details = {item.id: item.detail for item in plan.items}
@@ -61,11 +61,6 @@ class ChunkWindows(unittest.TestCase):
windows = [tmux.Listed(f"item-{n}", "", False) for n in (1, 2, 3)]
self.assertEqual(chunk_windows.room_of(windows, "item-1", False, 2).left, 0)
def test_starts_no_chunk_without_an_item_where_every_item_left_awaits_a_persons_merge(self):
awaited = next_chunk.NoItem("every item of release 1.0.0 waits. Pull request #7 awaits a person's merge.", True)
self.assertEqual(chunk_windows.may_start(awaited, [], set(), 1), [], "chunks_to_start stops the loop there")
self.assertEqual(chunk_windows.may_start(awaited, ["item-5"], set(), 1), [], "a running or restarted chunk goes on, and no chunk without an item joins it")
def test_starts_no_item_that_overlaps_a_running_chunks_items(self):
# Item 1 merged, so 2 is the plan's next item; it overlaps item 3, which still runs, at c.py.
items = touch_plan((2, "1.0.0", "", "- `a.py`\n- `c.py`"), (3, "1.0.0", "", "- `c.py`"), (4, "1.0.0", "", "- `d.py`"))