Answer stability round 2: 0 🔴, 1 🟡 (0 misread); count an untagged branch as cut below 0.0.0 and test it
This commit is contained in:
+3
-3
@@ -7,8 +7,8 @@ from failure import Failure
|
||||
from todo_table import Item, items, next_item, release_of, renames
|
||||
from markdown_text import sections
|
||||
|
||||
# The version a branch with no v* tag counts as cut, so that every release todo.md names comes after it.
|
||||
BEFORE_FIRST_RELEASE = (0, 0, 0)
|
||||
# The version a branch with no v* tag counts as cut: below every release, 0.0.0 included, so that every release todo.md names comes after it.
|
||||
BEFORE_FIRST_RELEASE = (-1, 0, 0)
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
@@ -137,7 +137,7 @@ def next_release(found: list[Item], cut: LastCut) -> Upcoming | Cut | Unknown:
|
||||
cut_version = BEFORE_FIRST_RELEASE if untagged else version_of(cut.tag)
|
||||
if cut_version is None:
|
||||
return Upcoming(earliest, True, landed(cut))
|
||||
if earliest is not None and earliest <= cut_version and not untagged:
|
||||
if earliest is not None and earliest <= cut_version:
|
||||
return Cut(earliest)
|
||||
named = named_releases(cut.todos_since)
|
||||
if isinstance(named, Failure):
|
||||
|
||||
@@ -30,7 +30,7 @@ def planned(todo: str | Failure, cut: LastCut, default: str) -> Plan | NoItem:
|
||||
if isinstance(pick, ReadyToCut | ReviewDue | Unplanned):
|
||||
upcoming = f"release {version(pick.release)}, the next after {last_cut}" if pick.release else f"the next release after {last_cut}"
|
||||
if isinstance(pick, ReviewDue):
|
||||
return NoItem(f"{where} holds no item for {upcoming}, and changes are unreleased, so that release's release review is due: no commit titled `Release review of <release>` has landed since the cut. This chunk is that review, as `~/.claude/skills/larv-review/SKILL.md` → \"Release review\" says; once it merges and the release holds no item, the release is ready to cut.")
|
||||
return NoItem(f"{where} holds no item for {upcoming}, and changes are unreleased, so that release's release review is due: no commit titled `Release review of <release>` has landed {'since the cut' if cut.tag is not None else 'yet'}. This chunk is that review, as `~/.claude/skills/larv-review/SKILL.md` → \"Release review\" says; once it merges and the release holds no item, the release is ready to cut.")
|
||||
if isinstance(pick, ReadyToCut):
|
||||
return NoItem(f"{where} holds no item for {upcoming}, and changes are unreleased, and its release review has landed, so that release is finished and ready to cut. The working loop stops here. If todo.md renamed that release instead, add `- <old release> renamed to <new release>` to todo.md's `## Renamed` section.")
|
||||
return NoItem(f"{where} holds no item for {upcoming}, and no change is unreleased, so that release is to be planned first.")
|
||||
|
||||
@@ -98,6 +98,10 @@ class ChunkItem(unittest.TestCase):
|
||||
with self.subTest(release=release):
|
||||
self.assertEqual(chunk_pick.chunk_item(plan_under(release), chunk_pick.LastCut(None, "", 4, naming(set()))), chunk_pick.Next(release, one(release)))
|
||||
|
||||
def test_calls_a_release_0_0_0_finished_on_a_branch_with_no_tag(self):
|
||||
history = [HEADER + ROW.format(id=1, release="0.0.0"), HEADER]
|
||||
self.assertEqual(chunk_pick.chunk_item([], chunk_pick.LastCut(None, "", 4, history)), chunk_pick.ReviewDue((0, 0, 0)))
|
||||
|
||||
def test_calls_a_release_that_never_had_a_tag_finished_once_the_plan_files_no_item_under_it(self):
|
||||
history = [HEADER + ROW.format(id=1, release="0.1.0") + ROW.format(id=2, release="0.1.1"), HEADER + ROW.format(id=2, release="0.1.1")]
|
||||
cut = lambda reviewed: chunk_pick.LastCut(None, "", 4, history, reviewed)
|
||||
|
||||
Reference in New Issue
Block a user