Give todo_table.items one way to say a plan has no items table

This commit is contained in:
2026-10-22 00:32:30 +02:00
parent f429e256de
commit f0ece378c0
7 changed files with 38 additions and 18 deletions
+3 -3
View File
@@ -5,7 +5,7 @@ import re
from chunk_pick import chunk_item, Cut, Finished, LastCut, Unknown, Unplanned
from failure import Failure
from chunk_preflight.gathered import Forge, NoItem, Plan
from todo_table import item_details, items, version
from todo_table import item_details, items, NoItemsTable, version
# The command each forge's CLI lists pull requests with; pulls_command adds the flags that pick their rows and fields.
PULLS_LIST: dict[Forge, tuple[str, ...]] = {"gh": ("gh", "pr", "list"), "tea": ("tea", "pulls", "list")}
@@ -17,10 +17,10 @@ def planned(todo: str | Failure, cut: LastCut, default: str) -> Plan | NoItem:
if isinstance(todo, Failure):
return NoItem(f"{where} cannot be read: {todo.reason}.")
found = items(todo)
if isinstance(found, NoItemsTable):
return NoItem(f"{where} holds no items table.")
if isinstance(found, Failure):
return NoItem(f"{where} cannot be read: {found.reason}.")
if found is None:
return NoItem(f"{where} holds no items table.")
pick = chunk_item(found, cut)
if isinstance(pick, Cut):
return NoItem(f"{where} files items under release {version(pick.release)}, which is not after the last cut, {cut.tag}; ask the human which release they belong to.")