fixed: review findings - robustness, dead code, missing tests

several smaller fixes from the code review:
 - add os_version to RuleContext + OsCondition for mojang rules that
   constrain natives selection by host version (rare, but in the spec).
 - factor mojang_os_name/arch/version into a shared launch_profile::system
   module instead of duplicating between net/mojang.rs and launch/mod.rs.
 - get_json and get_bytes now retry transient failures (5xx, connect,
   body decode) via a shared get_with_retry envelope; previously only
   download_file had retry logic.
 - migrate_legacy_meta_if_needed falls back to the stale cached profile
   with a warn log on network failure instead of erroring out (offline
   launches now work).
 - tightened legacy-loader detection by requiring the unique-to-rmcl
   gameArguments field; clearer error when loader_version is absent.
 - forge legacy versionInfo write uses compact serialization (no
   pretty-print key reorder).
 - deleted dead fetch_version_meta and save_profile_json.
 - documented quick-play templates omission in templates::lookup.
 - added end-to-end test that loads a vanilla profile from disk, loads a
   loader profile with inheritsFrom, resolves, renders, and snapshots.
This commit is contained in:
objz committed 2026-05-25 18:24:06 +02:00
1 parent 19887643bc
commit 412e6ff91a
12 files changed
+395 -74

No files matched your search

+9
View File
@@ -62,6 +62,15 @@ pub fn substitute(input: &str, ctx: &TemplateContext) -> String {
out
}
// quick-play templates (`${quickPlayPath}`, `${quickPlaySingleplayer}`,
// `${quickPlayMultiplayer}`, `${quickPlayRealms}`) are intentionally not
// listed here. they only appear in `arguments.game` entries gated on
// `is_quick_play_*` feature flags; since rmcl never sets those flags
// (FeatureSet defaults to None across the board), the surrounding
// conditional argument is filtered out by the rule evaluator before
// template substitution even runs. if we ever expose quick-play to users,
// add the variables here AND set the corresponding feature flags in
// RuleContext at launch.
fn lookup(name: &str, ctx: &TemplateContext) -> Option<String> {
Some(match name {
"library_directory" => ctx.library_directory.display().to_string(),