feat: watch the release page of off-forge profiles

About forty profiles describe projects published outside any forge (Altirra, ePSXe, DraStic, mednafen, xroar). profile_sync skipped them as an unsupported host and check_freshness reported the same UNKNOWN line every run, so a new release adding a firmware went unseen. A profile can now name the page announcing its releases and a pattern for the version: --check-version reads it, and check_freshness --profiles calls the profile stale when the page announces another version than core_version.
This commit is contained in:
Abdessamad Derraz committed 2026-10-20 04:28:27 +02:00
1 parent d43aa5354c
commit 282f8d5d0a
7 files changed
+102

No files matched your search

+15
View File
@@ -422,5 +422,20 @@ class RowsSayAllTheyStandFor(unittest.TestCase):
self.assertIn("--json lists all 50", row.detail)
class AReleasePageMakesAProfileStale(unittest.TestCase):
def test_a_newer_announced_version_is_stale(self):
import check_freshness
rows = [
{"name": "altirra", "skipped": "unsupported host: x",
"declared_version": "4.40", "page_version": "4.50"},
{"name": "mednafen", "skipped": "unsupported host: y",
"declared_version": "1.32.1", "page_version": "1.32.1"},
]
found = {f.subject: f.status for f in check_freshness.summarize_profile_sync(rows)}
self.assertEqual(found["altirra"], check_freshness.STALE)
self.assertEqual(found["mednafen"], check_freshness.OK)
if __name__ == "__main__":
unittest.main()
+15
View File
@@ -4253,5 +4253,20 @@ class StrictRefusesAnUncheckableProfile(unittest.TestCase):
self.assertFalse(report("no source_ref").uncheckable())
class AnOffForgeProfileWatchesItsReleasePage(unittest.TestCase):
"""Profiles of projects outside any forge were skipped as an unsupported
host, and a new release of Altirra or mednafen went unseen."""
def test_the_page_version_is_read(self):
from unittest import mock
profile = {"emulator": "Altirra", "core_version": "4.40", "version_source": {
"url": "https://example.test/altirra", "pattern": r"Altirra (\d+\.\d+) released",
}}
with mock.patch.object(profile_sync.upstream, "fetch_page",
return_value="<p>Altirra 4.50 released</p>"):
self.assertEqual(profile_sync.page_version(profile, "cache", False), "4.50")
if __name__ == "__main__":
unittest.main()