Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions e2e/backend/test_aqua
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ test aqua:biomejs/biome@2.0.0 "biome --version" "Version: 2.0.0"
test aqua:biomejs/biome@@biomejs/biome@2.0.0 "biome --version" "Version: 2.0.0"
test aqua:gruntwork-io/terragrunt@0.77.22 "terragrunt --version" "terragrunt version v0.77.22"

assert_contains "MISE_USE_VERSIONS_HOST=0 mise ls-remote aqua:sharkdp/hyperfine" "1.9.0
1.10.0"
assert_contains "MISE_USE_VERSIONS_HOST=0 mise ls-remote aqua:sharkdp/hyperfine" "1.8.0
1.9.0
1.10.0
1.11.0"
34 changes: 23 additions & 11 deletions src/backend/aqua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,22 @@ impl Backend for AquaBackend {
}

async fn _list_remote_versions(&self, _config: &Arc<Config>) -> Result<Vec<String>> {
let version_tags = self.get_version_tags().await?;
let version_tags = self.get_version_tags().await;
let mut versions = Vec::new();
for (v, tag) in version_tags.iter() {
let pkg = AQUA_REGISTRY
.package_with_version(&self.id, &[tag])
.await
.unwrap_or_default();
if !pkg.no_asset && pkg.error_message.is_none() {
versions.push(v.clone());
match version_tags {
Ok(tags) => {
for (v, tag) in tags.iter() {
let pkg = AQUA_REGISTRY
.package_with_version(&self.id, &[tag])
.await
.unwrap_or_default();
if !pkg.no_asset && pkg.error_message.is_none() {
versions.push(v.clone());
}
}
}
Err(e) => {
warn!("Remote versions cannot be fetched: {}", e);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Unfiltered Version Listing Causes Installation Issues

The _list_remote_versions function in src/backend/aqua.rs now returns both normalized versions and raw tags without filtering for asset availability. This introduces duplicate entries and lists versions that are not installable, leading to misleading ls-remote output and potential installation failures if a non-installable version is selected.

Fix in Cursor Fix in Web

}
}
Ok(versions)
Expand All @@ -79,8 +86,10 @@ impl Backend for AquaBackend {
) -> Result<ToolVersion> {
let tag = self
.get_version_tags()
.await?
.iter()
.await
.ok()
.into_iter()
.flatten()

Copilot AI Aug 13, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using .ok() to silently ignore errors here means that version resolution failures won't be logged or handled, making debugging difficult when version fetching fails.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a fallback so it's safe.

.find(|(version, _)| version == &tv.version)
.map(|(_, tag)| tag);
let mut v = tag.cloned().unwrap_or_else(|| tv.version.clone());
Expand Down Expand Up @@ -287,7 +296,10 @@ impl AquaBackend {
versions.push((version.to_string(), tag));
}
} else {
warn!("no aqua registry found for {}", self.ba());
bail!(
"aqua package {} does not have repo_owner and/or repo_name.",
self.id
);
}
Ok(versions)
})
Expand Down
Loading