mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-24 20:59:03 -05:00
fix: ignore a release older than the tag
--check-version said pcsx2x6's v0.2.22 was older than its code because the pin holds release v0.2.20, the latest the project published. A release that is an ancestor of the declared tag is not a later one.
This commit is contained in:
1 parent
19f22da75f
commit
01465ecf6b
2 files changed
+22
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user