From b448ccb2d230752529f89137f9c6ce8f71681b23 Mon Sep 17 00:00:00 2001 From: Andre Brait Date: Fri, 2 Oct 2026 05:53:40 +0000 Subject: [PATCH 1/2] tests: prove a stable publish prunes a stale version from a newer-family edge When edge already serves a newer family (4.0.0.a1) and still carries a leftover older version (3.3.10), a stable 3.3.11 publish skips edge as stale but must still prune the leftover, rewrite the catalogue, and keep the dependency the 4.0.0.a1 build declares. The existing prune coverage used a testing-primary release only. Refs pfBlockerNG/pfBlockerNG#3390 --- tests/test_publish_release.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/test_publish_release.py b/tests/test_publish_release.py index a890fda..90c7937 100644 --- a/tests/test_publish_release.py +++ b/tests/test_publish_release.py @@ -3890,6 +3890,32 @@ def test_stale_catalogue_holding_an_older_version_is_pruned_and_rewritten( self._assert_lists_only("edge", "3.4.0.a1") self._assert_lists_only("testing", "3.3.11.a1") + def test_stable_build_prunes_a_stale_version_from_a_newer_family_edge( + self, + ) -> None: + """Given stable and testing list 3.3.10, and edge lists 4.0.0.a1 (with its + dependency) next to a leftover 3.3.10, + When stable 3.3.11 is published to stable+testing+edge, + Then edge is rewritten to list 4.0.0.a1 only and keeps the dependency, + and stable and testing list 3.3.11.""" + self._publish("v3.3.10", "stable", self._ALL) + self._publish( + "v4.0.0.a1", "edge", '["edge"]', rows=(ROW_CE,), include_dependency=True + ) + self._seed("edge", "v3.3.10", "stable") + ca.regenerate_catalogue(self.pkg_repo / "docs", "edge", "ce-2.8") + self.assertEqual(self._listed("edge")["packagesite"], ["3.3.10", "4.0.0.a1"]) + + report = self._publish("v3.3.11", "stable", self._ALL) + + self.assertEqual( + set(report.touched), {(channel, "ce-2.8") for channel in self._CHANNELS} + ) + self._assert_lists_only("edge", "4.0.0.a1") + self._assert_carries_dependency("edge") + self._assert_lists_only("stable", "3.3.11") + self._assert_lists_only("testing", "3.3.11") + # --------------------------------------------------------------------------- # # publish() must actually WIRE catalogue_assembly.verify_multi_destination_ From 90b9b96a070b806193f10360c4c99365b8b0e76c Mon Sep 17 00:00:00 2001 From: Andre Brait Date: Fri, 2 Oct 2026 06:01:49 +0000 Subject: [PATCH 2/2] tests: assert edge is reported as a skipped stale destination Both stable-over-newer-edge tests now pin report.skipped, so a publish that stops recording the skipped edge destination fails them directly. Refs pfBlockerNG/pfBlockerNG#3390 --- tests/test_publish_release.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_publish_release.py b/tests/test_publish_release.py index 90c7937..bce784b 100644 --- a/tests/test_publish_release.py +++ b/tests/test_publish_release.py @@ -3712,6 +3712,7 @@ def test_stable_build_older_than_edge_updates_stable_and_testing_only(self) -> N self.assertEqual( set(report.touched), {("stable", "ce-2.8"), ("testing", "ce-2.8")} ) + self.assertEqual(report.skipped, (("edge", "ce-2.8", "3.3.11", "4.0.0.a1"),)) self.assertEqual(_tree_snapshot(self._catalogue("edge")), edge_before) self._assert_lists_only("edge", "4.0.0.a1") self._assert_lists_only("stable", "3.3.11") @@ -3911,6 +3912,7 @@ def test_stable_build_prunes_a_stale_version_from_a_newer_family_edge( self.assertEqual( set(report.touched), {(channel, "ce-2.8") for channel in self._CHANNELS} ) + self.assertEqual(report.skipped, (("edge", "ce-2.8", "3.3.11", "4.0.0.a1"),)) self._assert_lists_only("edge", "4.0.0.a1") self._assert_carries_dependency("edge") self._assert_lists_only("stable", "3.3.11")