-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(aqua): improve warnings for packages without repo_owner and repo_name (#5644) (2nd attempt) #6009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(aqua): improve warnings for packages without repo_owner and repo_name (#5644) (2nd attempt) #6009
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
| } | ||
| } | ||
| Ok(versions) | ||
|
|
@@ -79,8 +86,10 @@ impl Backend for AquaBackend { | |
| ) -> Result<ToolVersion> { | ||
| let tag = self | ||
| .get_version_tags() | ||
| .await? | ||
| .iter() | ||
| .await | ||
| .ok() | ||
| .into_iter() | ||
| .flatten() | ||
|
||
| .find(|(version, _)| version == &tv.version) | ||
| .map(|(_, tag)| tag); | ||
| let mut v = tag.cloned().unwrap_or_else(|| tv.version.clone()); | ||
|
|
@@ -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) | ||
| }) | ||
|
|
||
There was a problem hiding this comment.
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_versionsfunction insrc/backend/aqua.rsnow 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 misleadingls-remoteoutput and potential installation failures if a non-installable version is selected.