PowerShell / PSResourceGet

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

Fix 'name' bug with v2 JFrog Artifactory #1535

Closed alerickson closed 7 months ago

alerickson commented 7 months ago

PR Summary

Fixes bug where Find-PSResource using v2 Jfrog Artifactory is not returning the 'name' property of a module.

Previously, all package properties were pulled from the xml node m:properties, however title, listed as a child node under m:properties, can sometimes be empty. There is another title node that is a child of entry and as far as I can tell this node seems to always contain the name of the package.

Instead of pulling m:properties from the xml response, entry (which is the parent of m:properties) is now being used as the parent node from which all package metadata is parsed. This allows us to pull all of the information that was previously being retrieved from m:properties, but also get the extra title node mentioned above.

PR Context

Resolves #1534

PR Checklist

alerickson commented 7 months ago

@sean-r-williams please feel free to review if you like!

sean-r-williams commented 7 months ago

I just tested against my local Artifactory instance and this fix appears to be working as expected. Thanks a bunch for the fast turnaround @alerickson!

As an aside, would it be worthwhile to add steps to CI for testing PSResourceGet against additional feed providers? I don't know if this specific bug repro'd on cloud-hosted JFrog/Artifactory, but I imagine adding test suites running against other NuGet providers would help catch compat edge-cases between providers.

alerickson commented 7 months ago

@sean-r-williams completely agree, opened this issue up here #1536 so we can get some better CI testing for these scenarios. I'll work on that this week