Skip to content
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

Artifactory+v2: Feed enumeration broken due to missing searchTerm='' parameter #1531

Closed
3 tasks done
sean-r-williams opened this issue Jan 23, 2024 · 0 comments · Fixed by #1533
Closed
3 tasks done

Comments

@sean-r-williams
Copy link
Contributor

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

(Related to #1485 and #1526 - spinning off a separate issue at the request of @alerickson in #1485 (comment))

  • Connect PSResourceGet to an Artifactory NuGet feed, with a feed URL like so: https://artifactory.f.q.d.n/artifactory/api/nuget/v2/<feed-name>/
  • Run Find-PSResource -Type Module -Repository Artifactory (or `Find-PSResource -Name '*' -Repository Artifactory, with fixes from Bug fix for non-PSGallery repos adding script endpoint #1526)

Expected behavior

All modules (or modules+scripts) are retrieved from the feed

Actual behavior

No content is retrieved from the feed

Error details

No error message

Environment data

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Binary     1.0.1      Microsoft.PowerShell.PSResourceGet  {Find-PSResource, Get-InstalledPSResource, Get-PSResourceR...

Key   : PSVersion
Value : 5.1.19041.3803
Name  : PSVersion


Key   : PSEdition
Value : Desktop
Name  : PSEdition


Key   : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0...}
Name  : PSCompatibleVersions


Key   : BuildVersion
Value : 10.0.19041.3803
Name  : BuildVersion


Key   : CLRVersion
Value : 4.0.30319.42000
Name  : CLRVersion


Key   : WSManStackVersion
Value : 3.0
Name  : WSManStackVersion


Key   : PSRemotingProtocolVersion
Value : 2.3
Name  : PSRemotingProtocolVersion


Key   : SerializationVersion
Value : 1.1.0.1
Name  : SerializationVersion

Visuals

From #1485 (comment):

When Find-Module enumerates a v2 feed, the underlying API call(s) (as identified by using -Debug) looks like this:
https://artifactory.f.q.d.n/artifactory/api/nuget/v2/psgallery-nuget-local/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework=''&includePrerelease=false&$skip=0&$top=40

When Find-PSResource enumerates a v2 feed, the API call looks like this:
'https://artifactory.f.q.d.n/artifactory/api/nuget/v2/psgallery-nuget-local/Search()?$filter=IsLatestVersion&$orderby=Id desc&$inlinecount=allpages&$skip=0&$top=6000'

I see three differences in the OData parameters:

  • Pagination parameters are different (window of 6000 with PSResourceGet instead of 40 on PSGet)
  • PSResourceGet requests sorting, PSGet did not
  • No search query is provided (PSGet passes an empty search term - searchTerm='')

When I try manually performing the REST calls from PSResourceGet myself, I see that Artifactory is indeed returning a response with no results:
image

Upon adding searchTerm='', I get the expected response:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants