From 7a01e9487d5eb2f7e9b836fc94fdddc9bb1713f2 Mon Sep 17 00:00:00 2001 From: belgio99 <17623601+belgio99@users.noreply.github.com> Date: Mon, 12 Jan 2026 14:43:51 +0100 Subject: [PATCH] fix: add `-test` to VERSION_REGEX prerelease filter Versions with `-test` suffix (e.g., `0.48.7-test-signing-binaries`) were not being filtered out when resolving `latest`, causing mise to incorrectly select test/prerelease versions over stable releases. For example, `mise latest terragrunt` returned `0.48.7-test-signing-binaries` instead of `0.97.2` because `-test` was not in the prerelease filter regex. This adds `-test` alongside the existing `-alpha`, `-beta`, `-rc`, etc. patterns in both the main VERSION_REGEX and the Java-specific one. --- src/plugins/core/java.rs | 2 +- src/plugins/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/core/java.rs b/src/plugins/core/java.rs index 138d85c406..81935a356b 100644 --- a/src/plugins/core/java.rs +++ b/src/plugins/core/java.rs @@ -29,7 +29,7 @@ use xx::regex; static VERSION_REGEX: Lazy = Lazy::new(|| { Regex::new( - r"(?i)(^Available versions:|-src|-dev|-latest|-stm|[-\\.]rc|-milestone|-alpha|-beta|[-\\.]pre|-next|snapshot|SNAPSHOT|master)" + r"(?i)(^Available versions:|-src|-dev|-latest|-stm|[-\\.]rc|-milestone|-alpha|-beta|[-\\.]pre|-next|-test|snapshot|SNAPSHOT|master)" ) .unwrap() }); diff --git a/src/plugins/mod.rs b/src/plugins/mod.rs index 68877f41be..15a75b402e 100644 --- a/src/plugins/mod.rs +++ b/src/plugins/mod.rs @@ -194,7 +194,7 @@ impl PluginType { pub static VERSION_REGEX: Lazy = Lazy::new(|| { Regex::new( - r"(?i)(^Available versions:|-src|-dev|-latest|-stm|[-\\.]rc|-milestone|-alpha|-beta|[-\\.]pre|-next|([abc])[0-9]+|snapshot|SNAPSHOT|master)" + r"(?i)(^Available versions:|-src|-dev|-latest|-stm|[-\\.]rc|-milestone|-alpha|-beta|[-\\.]pre|-next|-test|([abc])[0-9]+|snapshot|SNAPSHOT|master)" ) .unwrap() });