Repository navigation
fix(dependencies): 🐛 Never pick a Modrinth/Smithed lib made for a newer MC version - #57
Merged
Merged
Conversation
…rsion When no Modrinth version is tagged with the project's exact MC version, the fallback fetched every version and took the latest one, silently picking a lib built for a newer MC (ex: Furnace NBT Recipes 1.11.0 for 26.3 on a 26.2 project). Now only versions whose release game_versions are all <= the project's MC version are kept, with a warning if none remain. Claude-Session: https://claude.ai/code/session_01QuzqbqTP5ARxz8b3MZyEy1
…sion - Ignore snapshot/pre-release MC versions when comparing: '26.3-snapshot-1' was parsed as (26,), which is lower than (26, 2), so a lib made for a 26.3 snapshot was considered compatible with 26.2. - Warn when no Smithed release supports the project's MC version (or older) instead of silently falling back to the latest one. - Share the release version parsing between the Smithed and Modrinth providers. Claude-Session: https://claude.ai/code/session_01QuzqbqTP5ARxz8b3MZyEy1
…on_to_float Replace the custom release-only regex by stouputils' version_to_float, which handles snapshots, release candidates and pre-releases (ex: '26.3-snapshot-1' is newer than 26.2, '26.2-rc1' is older). Lib version names are also sorted with it so that '1.0.0rc1' comes before '1.0.0'. Claude-Session: https://claude.ai/code/session_01QuzqbqTP5ARxz8b3MZyEy1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problème
Survisland (MC 26.2) a embarqué Furnace NBT Recipes 1.11.0 et Cinemalya 1.0.3, deux versions faites pour la 26.3.
Modrinth : dans
resolve_modrinth_lib, StewBeet commence par demander à Modrinth les versions taguéesgame_versions=["<mc>"]. Si la liste revient vide (aucune version n'est taguée exactement26.2: FNR 1.10.1 est taguée1.21.8–1.21.11, et 1.10.2/1.11.0 sont taguées26.3), il se rabat sur toutes les versions et prend la plus récente. Aucune vérification de la version MC n'est faite et rien n'est affiché.Smithed : il y a deux problèmes dans
mc_compatible/resolve_smithed_lib:parse_version("26.3-snapshot-1")renvoie(26,), qui est inférieur à(26, 2). Une version faite pour un snapshot 26.3 était donc jugée compatible avec 26.2.max(compat or versions, ...)se rabattait sans rien afficher sur la dernière version quand aucune n'était compatible.Correctif
stp.version_to_float(déjà utilisé dansplugins/finalyze/dependencies), viamc_floats, qui ignoreinfinite. Avec cette fonction,26.3-snapshot-1est plus récent que 26.2 et26.2-rc1plus ancien.modrinth_older_versionsne garde que les versions dont toutes lesgame_versionssont ≤ la version MC du projet. L'ordre de Modrinth est conservé.latest_smithed_compatible, qui est utilisée pour la version épinglée comme pour la version non épinglée. Les noms de version sont aussi triés avecversion_to_float, pour que1.0.0rc1passe avant1.0.0.stp.warning.Tests
Réponses d'API simulées, avec un projet en 26.2 (sauf mention contraire).
Modrinth :
Smithed (versions : 1.2.0→
26.3, 1.1.0→26.3-snapshot-1, 1.0.0→1.21.11, 26.2, 0.9.0→1.21.8) :(26,))Les 5 doctests du module et
ruff checkpassent.🤖 Generated with Claude Code
https://claude.ai/code/session_01QuzqbqTP5ARxz8b3MZyEy1