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

$filter=IsLatestVersion and semVerLevel=2.0.0 yields no results #3905

Closed
joelverhagen opened this issue May 9, 2017 · 8 comments
Closed

Comments

@joelverhagen
Copy link
Member

joelverhagen commented May 9, 2017

The client does the following query when using the Browse tab is VS:

GET https://dev.nugettest.org/api/v2/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework='net46'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0 HTTP/1.1
Accept: application/atom+xml, application/xml
user-agent: NuGet Client V3/4.3.0 (Microsoft Windows NT 10.0.14393.0, VS Enterprise/15.0)
X-NuGet-Client-Version: 4.3.0
Accept-Language: en-US
Host: dev.nugettest.org
Accept-Encoding: gzip, deflate

This yields no results. I think perhaps its a bug with the introduction of IsLatestSemVer2 and IsLatestStableSemVer2.

This results in an empty "browse" tab when using SemVer 2.0.0:
image

@chenriksson
Copy link
Member

chenriksson commented May 9, 2017

Also affects nuget.exe list

> D:\tools\NuGetClients\v4.3-beta1\NuGet.exe list -Source http://api.dev.nugettest.org/v3-index/index.json semver -Verbosity detailed

NuGet Version: 4.3.0.0
  GET https://dev.nugettest.org/api/v2/$metadata
  OK https://dev.nugettest.org/api/v2/$metadata 84ms
  GET https://dev.nugettest.org/api/v2/Search()?$filter=IsLatestVersion&$orderby=Id&searchTerm='semver'&targetFramework=
''&includePrerelease=false&$skip=0&$top=30&semVerLevel=2.0.0
  OK https://dev.nugettest.org/api/v2/Search()?$filter=IsLatestVersion&$orderby=Id&searchTerm='semver'&targetFramework='
'&includePrerelease=false&$skip=0&$top=30&semVerLevel=2.0.0 118ms
No packages found.

@xavierdecoster
Copy link
Member

This may be a data related issue caused by #3908 yet to be deployed to DEV.

@xavierdecoster
Copy link
Member

There's something odd with this client query:

https://dev.nugettest.org/api/v2/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework='net46'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0

It's filtering on IsLatestVersion (not IsLatestVersionSemVer2), whilst simultaneously requesting semVerLevel=2.0.0, for a search term semver. That means, for it to return any results, there must be packages matching the term semver that are non-prerelease, and non-SemVer2.

Do you have an example package for which this is the case?

@xavierdecoster
Copy link
Member

The filter is applied on line 124 of the QueryResult class.

The OData filter is checking on IsLatestVersion=true, and filtering out any package versions not matching that filter.

IsLatestVersionSemVer2 and IsLatestStableVersionSemVer2 are not exposed on the OData feed, so we need to do some more OData query hijacking to make this work...

@chenriksson
Copy link
Member

@xavierdecoster I noticed packages with both semver1 and semver2 in the name, so was querying based on that to test filtering.

@xavierdecoster
Copy link
Member

yep, working on it, need to apply an additional hijack when applying the OData filter

@xavierdecoster
Copy link
Member

Looks resolved to me in latest DEV deployment. Can you please confirm? @joelverhagen @chenriksson

@chenriksson
Copy link
Member

@xavierdecoster nuget list scenario works now; 4.3 client shows semver2 packages

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

No branches or pull requests

4 participants