From e81ed7984f15031fe2f4abd981f80df667ad8099 Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Wed, 28 Oct 2026 14:34:12 -0700 Subject: [PATCH] fix(installers): accept GE-Proton versions in installer scripts Installer scripts could only reference Wine versions served by the Lutris API, so pinning a GE-Proton release such as "GE-Proton11-8" was rejected with "Wine version ... is not available from Lutris". The client gets GE-Proton from umu ('ge-proton') or downloads release tags from GitHub, so let both through the validator. Co-Authored-By: Claude Opus 5.5 --- games/tests/test_validator.py | 21 +++++++++++++++++++++ games/util/installer.py | 11 ++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/games/tests/test_validator.py b/games/tests/test_validator.py index bf6eb487..5c764d89 100644 --- a/games/tests/test_validator.py +++ b/games/tests/test_validator.py @@ -96,3 +96,24 @@ def test_game_should_be_a_dict(self): self.installer.content = json.dumps({"game": {"foo": "bar", "bar": "foo"}}) is_valid, _errors = validate_installer(self.installer) self.assertTrue(is_valid) + + +class TestWineVersionValidator(TestCase): + def get_installer(self, version): + return Installer( + runner=Runner(name="Wine", slug="wine"), + version="test", + content=json.dumps({"wine": {"version": version}}), + ) + + def test_ge_proton_versions_are_valid(self): + """GE-Proton builds come from GitHub, not from the Lutris API""" + for version in ("GE-Proton11-8", "GE-Proton9-26", "ge-proton"): + is_valid, errors = validate_installer(self.get_installer(version)) + self.assertTrue(is_valid, (version, errors)) + + def test_unknown_wine_version_is_invalid(self): + for version in ("wine-unknown-1.0-x86_64", "GE-Proton11-8-x86_64", "GE-Proton"): + is_valid, errors = validate_installer(self.get_installer(version)) + self.assertFalse(is_valid, version) + self.assertIn(f"Wine version {version} is not available from Lutris", errors) diff --git a/games/util/installer.py b/games/util/installer.py index 575b6e79..73cce3f8 100644 --- a/games/util/installer.py +++ b/games/util/installer.py @@ -1,6 +1,7 @@ """Installer related utilities""" import logging +import re from common.util import load_yaml from games.models import DEFAULT_INSTALLER @@ -9,6 +10,11 @@ LOGGER = logging.getLogger(__name__) SUCCESS = (True, "") +# The client resolves 'ge-proton' to the latest GE-Proton through umu, and downloads +# pinned GE-Proton release tags such as 'GE-Proton11-8' from GitHub, not from our API. +GE_PROTON_LATEST = "ge-proton" +GE_PROTON_TAG_RE = re.compile(r"^GE-Proton\d+-\d+$") + def get_installer_script(installer): """Return the installer script as a Python structure""" @@ -232,7 +238,8 @@ def all_files_are_used(installer): def uses_a_valid_wine_version(installer): - """Checks if a referenced wine version is available from the API""" + """Checks if a referenced wine version is available from the API, or is a + GE-Proton version that the client gets from GitHub""" script = get_installer_script(installer) wine_config = script.get("wine") or {} @@ -241,6 +248,8 @@ def uses_a_valid_wine_version(installer): script_version = wine_config.get("version") if not script_version: return SUCCESS + if script_version == GE_PROTON_LATEST or GE_PROTON_TAG_RE.match(str(script_version)): + return SUCCESS versions = [ f"{v.version}-{v.architecture}" for v in RunnerVersion.objects.filter(runner__slug="wine") ]