Answer product-owner round 1: 0 🔴, 2 🟡 (0 misread); count an untagged branch's unreleased commits from the commit that dated its heading, and drop the changelog's advice to restart loops

This commit is contained in:
2026-11-04 21:14:51 +01:00
parent 6f9155c1d0
commit 45007d54f2
6 changed files with 23 additions and 9 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
"""The lines the preflight prints, stated from what it gathered."""
from todo_table import bundle_candidates, BUNDLE_MAX_R, Item, ships_alone, version
from chunk_pick import cut_name, LastCut, unreleased_entries
from chunk_pick import cut_name, dated_headings, LastCut, unreleased_entries
from failure import Failure
from chunk_preflight.gathered import Forge, Gathered, ItemFacts, NamedPath, NoItem, Plan, Ran
from chunk_preflight.choices import PULLS_LIST
@@ -24,7 +24,8 @@ def last_release(default: str, release: LastCut) -> str:
entries = unreleased_entries(release.changelog) if isinstance(release.changelog, str) else None
if entries is not None:
return f"{cut} Unreleased: {counted(entries, 'entry', 'entries')} under CHANGELOG.md → ## Unreleased."
since = f"since {release.tag}" if release.tag else f"on {default}"
headed = max(dated_headings(release.changelog), default=None) if release.tag is None else None
since = f"since {release.tag}" if release.tag else f"since CHANGELOG.md dated {version(headed)}" if headed else f"on {default}"
commits = f"the commits {since} cannot be counted: {release.commits.reason}" if isinstance(release.commits, Failure) else f"{counted(release.commits, 'commit', 'commits')} {since}"
changelog = f"CHANGELOG.md cannot be read: {release.changelog.reason}" if isinstance(release.changelog, Failure) else "no ## Unreleased in CHANGELOG.md"
return f"{cut} Unreleased: {commits}; {changelog}."