diff --git a/scripts/profile_sync.py b/scripts/profile_sync.py index a7c9ba2a..4868bca7 100644 --- a/scripts/profile_sync.py +++ b/scripts/profile_sync.py @@ -4382,6 +4382,12 @@ def _passed_release( commit = upstream.tag_commit(repo, version.latest_release, args.cache_dir, args.offline) if not commit: return None + if version.tag_commit and version.tag_commit != commit: + # A project can publish a release older than its newest tag: + # pcsx2x6's latest release is v0.2.20, its declared tag v0.2.22. + older = upstream.ancestry(repo, commit, version.tag_commit, args.cache_dir, args.offline) + if older and older[1] == 0: + return None if commit == pin: return version.latest_release relation = upstream.ancestry(repo, commit, pin, args.cache_dir, args.offline) diff --git a/tests/test_profile_sync.py b/tests/test_profile_sync.py index 030b4761..202e75e0 100644 --- a/tests/test_profile_sync.py +++ b/tests/test_profile_sync.py @@ -3287,6 +3287,22 @@ class TestCheckVersion(unittest.TestCase): self.assertIn("already contains release v3.1.0", warning) +class APassedReleaseIsNewerThanTheTag(unittest.TestCase): + """pcsx2x6 declares tag v0.2.22 while its latest published release is + v0.2.20: the pin holds v0.2.20 without core_version being older.""" + + def test_a_release_older_than_the_declared_tag_is_not_passed(self): + from unittest import mock # noqa: PLC0415 + + version = profile_sync.VersionReport( + "v0.2.22", "v0.2.22", "v0.2.20", "2026-07-25", True, "tag22" + ) + args = argparse.Namespace(cache_dir="c", offline=True) + with mock.patch.object(profile_sync.upstream, "tag_commit", return_value="rel20"), \ + mock.patch.object(profile_sync.upstream, "ancestry", return_value=(5, 0)): + self.assertIsNone(profile_sync._passed_release(args, "repo", version, "pin")) + + class TestAncestry(unittest.TestCase): def setUp(self): self.tmp = tempfile.TemporaryDirectory()