[PATCH b4 10/27] review-tui: say when a take didn't complete
Christian Brauner <[email protected]> Fri, 31 Jul 2026 11:21:09 +0200
| Newsgroups | org.kernel.linux.tools |
|---|---|
| Message-ID | <20260731-work-b4-editor-branch-guard-v1-10-de68a7c8e4cb@kernel.org> |
The thank-and-archive chain reports a series that comes back from the take as anything other than accepted or partial with "series not marked accepted". But _do_take_merge() and _do_take_am() return None for two quite different things. Either the maintainer unchecked "mark series accepted" in the dialog, or the take never got that far because the target branch wouldn't resolve, a conflict resolution was abandoned or a worktree couldn't be created. In the second case we describe a state the series never reached and point at a checkbox that had nothing to do with it, while the take that actually failed goes unmentioned. We can tell the two apart from the dialog, so do that and say which one happened. Signed-off-by: Christian Brauner (Amutable) <[email protected]> --- src/b4/review_tui/_tracking_app.py | 11 ++++++++++- src/tests/test_tui_tracking.py | 6 ++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/b4/review_tui/_tracking_app.py b/src/b4/review_tui/_tracking_app.py index 55de2a7..7572a95 100644 --- a/src/b4/review_tui/_tracking_app.py +++ b/src/b4/review_tui/_tracking_app.py @@ -2645,11 +2645,20 @@ class TrackingApp(LoreNodeShutdownMixin, CheckRunnerMixin, App[Optional[str]]): 'Thank & archive skipped: series only partially applied', severity='warning', ) - else: + elif not take_screen.accept_series: self.notify( 'Thank & archive skipped: series not marked accepted', severity='warning', ) + else: + # _do_take_* returns None both for "accept was unchecked" and + # for "the take never finished"; only the latter is left here, + # and claiming a status the series never reached would send the + # maintainer looking for a take that did not happen. + self.notify( + 'Thank & archive skipped: take did not complete', + severity='warning', + ) @staticmethod def _record_take_metadata( diff --git a/src/tests/test_tui_tracking.py b/src/tests/test_tui_tracking.py index 57cfdc0..e6a25a4 100644 --- a/src/tests/test_tui_tracking.py +++ b/src/tests/test_tui_tracking.py @@ -4484,10 +4484,12 @@ class TestTakeThankArchiveChain: assert not thanks assert any('partially applied' in n for n in notices) - def test_incomplete_take_does_not_chain(self) -> None: + def test_aborted_take_says_so(self) -> None: + """A take that never finished is reported as such, not as a series + the maintainer declined to accept.""" thanks, notices = self._run_take_final(None, True) assert not thanks - assert any('not marked accepted' in n for n in notices) + assert any('take did not complete' in n for n in notices) def test_unchecked_box_never_chains(self) -> None: thanks, notices = self._run_take_final('accepted', False) -- 2.53.0