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

Update NuGet to fetch packages using SemVer 2 #4255

Merged
merged 7 commits into from
Mar 1, 2022

Conversation

Nishnha
Copy link
Member

@Nishnha Nishnha commented Sep 23, 2021

Dependabot is currently failing to search/fetch NuGet packages using SemVer 2 versioning.
The API query we use for package versions seems to only fetch package versions using SemVer 1

For example, on https://www.nuget.org/packages/Xamarin.Forms/, the current version is 5.0.0.2125,
but Dependabot's current query for NuGet packages, https://api-v2v3search-0.nuget.org/query?q=xamarin.forms&prerelease=true, only shows 4.x.x and lower releases

To query for newer packages that use SemVer 2, we add &semVerLevel=2.0.0 to the query string:
https://api-v2v3search-0.nuget.org/query?q=xamarin.forms&prerelease=true&semVerLevel=2.0.0 correctly shows the 5.x.x releases.


This PR also changes the server we use for NuGet queries.

https://api.nuget.org/v3/index.json returns a list of SearchQueryService servers, and api-v2v3search-0.nuget.org is no longer on that list.
The query server has been changed to azuresearch-usnc.nuget.org, which should return the same results as the previous server.

@Nishnha Nishnha requested a review from a team as a code owner September 23, 2021 15:03
@@ -59,7 +59,7 @@ def build_url_for_details(repo_details)
end
if search_url
details[:search_url] =
search_url + "?q=#{dependency.name.downcase}&prerelease=true"
search_url + "?q=#{dependency.name.downcase}&prerelease=true&semVerLevel=2.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this still include semver level 1 releases?

Copy link
Member Author

@Nishnha Nishnha Sep 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does

4.0.0 uses semver 1 while the versions > 5.6.1-pre1 use semver 2

Screen Shot 2021-09-29 at 1 03 35 PM

@Nishnha Nishnha force-pushed the nishnha/update-nuget-semver-2 branch from 0d3dc6e to df0be23 Compare September 23, 2021 19:06
@Nishnha
Copy link
Member Author

Nishnha commented Sep 23, 2021

There's a VCR recording in the NuGet test suite causing the CI to fail on this PR. The recording is of fetching a package from a local Artifactory install.
Unfortunately, I don't seem to be able to re-record this fixture. Artifactory fails to install on my Mac via docker-compose and it apparently requires Linux to run.

The original VCR fixture was recorded on Dependabot 0.149.5 -- do we know how to re-record this?

@Nishnha Nishnha requested review from jurre and a team March 1, 2022 18:35
@Nishnha Nishnha merged commit 59deb18 into main Mar 1, 2022
@Nishnha Nishnha deleted the nishnha/update-nuget-semver-2 branch March 1, 2022 22:19
@jurre jurre mentioned this pull request Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants