PowerShell / PSResourceGet

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

Unable to update PSResourceGet via Artifactory remote repo #1656

Open sean-r-williams opened 1 month ago

sean-r-williams commented 1 month ago

Prerequisites

Steps to reproduce

Expected behavior

PS> Update-PSResource Microsoft.PowerShell.PSResourceGet
PS> # update completes without issues

Actual behavior

PS> update-psresource Microsoft.PowerShell.PSResourceGet -Repository Artifactory
update-psresource : Package does not exist on the server
At line:1 char:1
+ update-psresource Microsoft.PowerShell.PSResourceGet -Repository Arti ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power...lets.FindHelper:FindHelper) [Update-PSResource], ResourceNotFoundException
    + FullyQualifiedErrorId : FindNameConvertToPSResourceFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.UpdatePSResource

Error details

No response

Environment data

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     1.0.4.1               Microsoft.PowerShell.PSResourceGet  {Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository, Get-PSScriptFileInfo…}

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

This seems to be the combination of two separate issues:

sean-r-williams commented 1 month ago

I see three options here:

sean-r-williams commented 1 month ago

@alerickson @SydneyhSmith This bug isn't something I can directly contribute a fix for since we're running up against [unexpected] behavior in the Gallery.

Can someone from your team take a look here?

We originally engaged JFrog support for this and have some line of dialogue with their R&D. (JFrog folks, see ticket #296792) If we need to get adjustments made in JFrog to align its behavior with other servers (thus obviating the need for quirk flags in this space), now would be an excellent time to do so.

Alternatively, if your team is comfortable with munging the filter (i.e. convert from IsLatestVersion to IsLatestVersion eq true, add a space to the front of the string, etc.), I can cut a PR for that (with the understanding that it will decrease legibility of the codebase).

anamnavi commented 1 month ago

As mentioned in this issue, we're going to look into the Gallery codebase to see what is happening and if we can't safely make the change there then we'll open a fix client side.