Answer principles round 1: 2 🔴, 9 🟡 (0 misread); explicit record versions in place of the Confluence store's hidden state, the routing ruling filed as item 393 for 0.12.0, rule-hook catching heavy runs through uv, poetry, sudo and doas, one unreleased heading, one owner of the no-item message, typed Jira issues, a turn that gives its failure as a value, outcome tests for the Atlassian client, an Emptied reason type, an injected clock and git in touch-predictions, and paired record names

This commit is contained in:
2026-11-16 16:12:36 +01:00
parent a60bfdbc1c
commit ba21a1efcd
41 changed files with 406 additions and 280 deletions
+8 -4
View File
@@ -1,8 +1,9 @@
"""How the plan stands to the last release cut: the next release, whether work has landed towards it, and whether it is to be planned, reviewed or cut; and, from that standing, the item the next chunk takes first, with what the default branch holds for the pick."""
import dataclasses
import re
from git_cli.git_repo import commits_since, file_at, git, Git
from plan.release import dated, dated_heading_pattern, newest_tag, parsed, Release, tagged
from plan.release import dated, dated_heading_pattern, newest_tag, parsed, Release, tagged, UNRELEASED_HEADING
from failure import Failure
from plan.todo_table import Item, items, next_item, renames
from plan_store.plans import Plan
@@ -258,9 +259,12 @@ def unreleased_changes(cut: LastCut) -> int | Failure:
def unreleased_entries(changelog: str) -> int | None:
"""How many top-level `- ` entries CHANGELOG.md holds under ## Unreleased; None without that section."""
found = sections(changelog).get("Unreleased")
return None if found is None else sum(line.startswith("- ") for line in found[0].splitlines())
"""How many top-level `- ` entries CHANGELOG.md holds under its unreleased section, as UNRELEASED_HEADING heads it; None without that section."""
heading = UNRELEASED_HEADING.search(changelog)
if heading is None:
return None
body = re.split(r"^## ", changelog[heading.end():], maxsplit=1, flags=re.M)[0]
return sum(line.startswith("- ") for line in body.splitlines())
def named_releases(todos: list[str] | Failure) -> set[Release] | Failure:
@@ -352,6 +352,8 @@ class ChunkItem(unittest.TestCase):
self.assertEqual(release_standing.unreleased_entries("# Changelog\n\n## Unreleased\n\n- One.\n - A nested line.\n- Two.\n\n## 0.1.0\n\n- Old.\n"), 2)
self.assertEqual(release_standing.unreleased_entries("# Changelog\n\n## Unreleased\n\n## 0.1.0\n\n- Old.\n"), 0)
self.assertIsNone(release_standing.unreleased_entries("# Changelog\n\n## 0.1.0\n\n- Old.\n"))
# The section todo-item finish files a bullet under, as a project's own changelog may head it.
self.assertEqual(release_standing.unreleased_entries("# Changelog\n\n## 0.6.0 (unreleased)\n\n- One.\n\n## 0.5.0\n\n- Old.\n"), 1)
def test_names_each_release_a_todo_md_since_the_last_cut_filed_items_under(self):
texts = [HEADER + ROW.format(id=1, release="0.2.0"), "", "not a table | x |", HEADER + ROW.format(id=2, release="0.3.0")]