PowerShell / PSResourceGet

PSResourceGet is the package manager for PowerShell
https://www.powershellgallery.com/packages/Microsoft.PowerShell.PSResourceGet
MIT License
479 stars 90 forks source link

ACR: Ensure versions returned are sorted and can be correctly compared if number of trailing zeroes differ #1588

Closed anamnavi closed 4 months ago

anamnavi commented 4 months ago

Versions stored in ACR are not present in numerical order, instead they use chronological order of when the repository tag (i.e version in our context) is published. This PR sorts tags (i.e versions) returned in FindACRImageTags().

The tag is a string, but we use it for version and version can be a NuGetVersion that may have different number of trailing 0's but the normalized version would be the same. So if a version "1.0.0" is published, the user input of version "1.0" or "1.0.0.0" should also match it but previously did not. This PR fixes this by finding the exact tag (i.e version) from the server and using that when we call GetACRMetadata().

Also add support for prerelease versions.

PR Summary

PR Context

Resolves #1581 #1582 #1584

PR Checklist