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
CI / tests (pull_request) Successful in 3m1s
This commit is contained in:
@@ -155,7 +155,7 @@ def preflight(root: pathlib.Path, timeout: float, make: bool, item_id: int | Non
|
||||
item = plan if isinstance(plan, NoItem) else item_facts(root, ref, plan, timeout, make)
|
||||
# A `checkout:` path lands in the worktree the chunk works in.
|
||||
made = located(str(item.worktree.path), pathlib.Path.home()) if isinstance(item, ItemFacts) and isinstance(item.worktree, Worktree) else config
|
||||
return render(Gathered(ref, note, held.cut, item, plan_name(ref, outside), (config if isinstance(made, Failure) else made).places, outside is not None, config.texts, held.merges_unread, left_worktrees(root, forge_run) if config.merge == "human" else ()))
|
||||
return render(Gathered(ref, note, held.cut, item, plan_name(ref, outside), (config if isinstance(made, Failure) else made).places, outside is not None, config.texts, merges_unread=held.merges_unread, left=left_worktrees(root, forge_run) if config.merge == "human" else ()))
|
||||
|
||||
|
||||
def item_facts(root: pathlib.Path, default: str, plan: NextChunk, timeout: float, make: bool) -> ItemFacts:
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
"""Finding a pull request from origin's own branch, reading whether it merges into its base, and waiting for the checks on its head commit."""
|
||||
"""Finding a pull request from origin's own branch, listing the ready ones, reading whether one merges into its base, and waiting for the checks on its head commit."""
|
||||
import dataclasses
|
||||
import fnmatch
|
||||
import json
|
||||
|
||||
@@ -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`"))
|
||||
|
||||
@@ -85,7 +85,7 @@ def planned(read: Plan | Failure, cut: LastCut, default: str, branch: str, outsi
|
||||
first = pick.item
|
||||
if first is None and pick.release is not None:
|
||||
merges = awaited_merges(weighed.carried, pick.release)
|
||||
return NoItem(f"every item of release {version(pick.release)} in {where} waits.{merges}", bool(merges))
|
||||
return NoItem(f"every item of release {version(pick.release)} in {where} waits.{merges}", awaits_merge=bool(merges))
|
||||
if first is None:
|
||||
return NoItem(f"{where}'s items table holds no item.")
|
||||
held = weighed.carried
|
||||
|
||||
Reference in New Issue
Block a user