Skip to content

support NuGet v3 feeds - #326

Merged
clairernovotny merged 26 commits into
NuGetPackageExplorer:masterfrom
campersau:new_v3
Feb 13, 2018
Merged

clairernovotny merged 26 commits into
NuGetPackageExplorer:masterfrom
campersau:new_v3

Conversation

@campersau

@campersau campersau commented Jan 27, 2018 •

Copy link
Copy Markdown
Collaborator

By using the official NuGet Client API for package searching / publishing.

  • Use https://api.nuget.org/v3/index.json feed by default
  • Credentials support for every operation (search / download / publishing)
  • Recent files updated to work with v3 feeds
  • Download progress enhancements. Before there were to many UI updates which blocked the progress bar from properly updating.
  • "Append V2 Api To Url" in publish dialog is no longer necessary

This has some drawbacks:

This is a WIP because I haven't checked if authentication actually works, also I would like to get some feedback on this.

fixes #50

@campersau

Copy link
Copy Markdown
Collaborator Author

Authentification now works with credential services.
This will also fix #331 and reverts #256

Whenever credentials are required and not already stored a credential dialog wil popup:
image

@campersau campersau changed the title [WIP] support NuGet v3 feeds support NuGet v3 feeds Jan 30, 2018
@clairernovotny clairernovotny added this to the 4.1 milestone Feb 12, 2018
@clairernovotny

Copy link
Copy Markdown
Member

@campersau Thank you for this PR, it was definitely on the "would love to have" list. I'm going to merge it, but I would still like to see if we can get the per-version download count. The NuGetGallery does manage to display it somehow, is that something we can do as well?

@clairernovotny
clairernovotny merged commit 9127d50 into NuGetPackageExplorer:master Feb 13, 2018
@campersau
campersau deleted the new_v3 branch February 13, 2018 08:01
@campersau

Copy link
Copy Markdown
Collaborator Author

@onovotny What do you mean with NuGetGallery?
You can compare this to the other clients here https://github.com/NuGet/NuGet.Client/tree/dev/src/NuGet.Clients which also do not should per version download count. e.g. the Visual Studio NuGet PackageExplorer

image

@clairernovotny

Copy link
Copy Markdown
Member

I meant the website itself:
image

@campersau

Copy link
Copy Markdown
Collaborator Author

Yes it might work. We can use the RawSearchResourceV3 directly which has the download count information. The problem is that it is not available for prerelease packages even if I set includePrerelease to true.

Raw search result with prereleases set to true:

{
    "@context": {
        "@vocab": "http://schema.nuget.org/schema#",
        "@base": "https://api.nuget.org/v3/registration3-gz-semver2/"
    },
    "totalHits": 104634,
    "lastReopen": "2018-02-13T18:15:11.9185055Z",
    "index": "v3-lucene2-v2v3-20180208",
    "data": [{
        "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/index.json",
        "@type": "Package",
        "registration": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/index.json",
        "id": "Newtonsoft.Json",
        "version": "11.0.1-beta3",
        "description": "Json.NET is a popular high-performance JSON framework for .NET",
        "summary": "",
        "title": "Json.NET",
        "iconUrl": "https://www.newtonsoft.com/content/images/nugeticon.png",
        "licenseUrl": "https://raw.github.com/JamesNK/Newtonsoft.Json/master/LICENSE.md",
        "projectUrl": "https://www.newtonsoft.com/json",
        "tags": ["json"],
        "authors": ["James Newton-King"],
        "totalDownloads": 103324621,
        "verified": true,
        "versions": [{
            "version": "3.5.8",
            "downloads": 125894,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/3.5.8.json"
        }, {
            "version": "4.0.1",
            "downloads": 64504,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.0.1.json"
        }, {
            "version": "4.0.2",
            "downloads": 57120,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.0.2.json"
        }, {
            "version": "4.0.3",
            "downloads": 37791,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.0.3.json"
        }, {
            "version": "4.0.4",
            "downloads": 30504,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.0.4.json"
        }, {
            "version": "4.0.5",
            "downloads": 92412,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.0.5.json"
        }, {
            "version": "4.0.6",
            "downloads": 14143,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.0.6.json"
        }, {
            "version": "4.0.7",
            "downloads": 260617,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.0.7.json"
        }, {
            "version": "4.0.8",
            "downloads": 237936,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.0.8.json"
        }, {
            "version": "4.5.1",
            "downloads": 238726,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.5.1.json"
        }, {
            "version": "4.5.2",
            "downloads": 14418,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.5.2.json"
        }, {
            "version": "4.5.3",
            "downloads": 26396,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.5.3.json"
        }, {
            "version": "4.5.4",
            "downloads": 64053,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.5.4.json"
        }, {
            "version": "4.5.5",
            "downloads": 68440,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.5.5.json"
        }, {
            "version": "4.5.6",
            "downloads": 1230517,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.5.6.json"
        }, {
            "version": "4.5.7",
            "downloads": 247911,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.5.7.json"
        }, {
            "version": "4.5.8",
            "downloads": 230237,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.5.8.json"
        }, {
            "version": "4.5.9",
            "downloads": 189870,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.5.9.json"
        }, {
            "version": "4.5.10",
            "downloads": 304437,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.5.10.json"
        }, {
            "version": "4.5.11",
            "downloads": 6467214,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/4.5.11.json"
        }, {
            "version": "5.0.1",
            "downloads": 883039,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/5.0.1.json"
        }, {
            "version": "5.0.2",
            "downloads": 261260,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/5.0.2.json"
        }, {
            "version": "5.0.3",
            "downloads": 283803,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/5.0.3.json"
        }, {
            "version": "5.0.4",
            "downloads": 1097338,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/5.0.4.json"
        }, {
            "version": "5.0.5",
            "downloads": 485030,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/5.0.5.json"
        }, {
            "version": "5.0.6",
            "downloads": 2373601,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/5.0.6.json"
        }, {
            "version": "5.0.7",
            "downloads": 450455,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/5.0.7.json"
        }, {
            "version": "5.0.8",
            "downloads": 2424896,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/5.0.8.json"
        }, {
            "version": "6.0.1",
            "downloads": 1457377,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/6.0.1.json"
        }, {
            "version": "6.0.2",
            "downloads": 726973,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/6.0.2.json"
        }, {
            "version": "6.0.3",
            "downloads": 1793292,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/6.0.3.json"
        }, {
            "version": "6.0.4",
            "downloads": 8531695,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/6.0.4.json"
        }, {
            "version": "6.0.5",
            "downloads": 1854434,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/6.0.5.json"
        }, {
            "version": "6.0.6",
            "downloads": 3734362,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/6.0.6.json"
        }, {
            "version": "6.0.7",
            "downloads": 688995,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/6.0.7.json"
        }, {
            "version": "6.0.8",
            "downloads": 7598696,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/6.0.8.json"
        }, {
            "version": "7.0.1",
            "downloads": 7779850,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/7.0.1.json"
        }, {
            "version": "8.0.1",
            "downloads": 903780,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/8.0.1.json"
        }, {
            "version": "8.0.2",
            "downloads": 2981810,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/8.0.2.json"
        }, {
            "version": "8.0.3",
            "downloads": 5628402,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/8.0.3.json"
        }, {
            "version": "9.0.1",
            "downloads": 12843202,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/9.0.1.json"
        }, {
            "version": "10.0.1",
            "downloads": 12029384,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/10.0.1.json"
        }, {
            "version": "10.0.2",
            "downloads": 5641944,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/10.0.2.json"
        }, {
            "version": "10.0.3",
            "downloads": 9421806,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/10.0.3.json"
        }, {
            "version": "11.0.1-beta3",
            "downloads": 46318,
            "@id": "https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/11.0.1-beta3.json"
        }]
    }]
}

@clairernovotny

Copy link
Copy Markdown
Member

even without prerelease, it's better than nothing :)

Also, any idea why the ReservedPrefix field always seemed to be false?

At the end of the day, I'd love that search dialog to be redone and be much closer to what VS shows.

@campersau

Copy link
Copy Markdown
Collaborator Author

@joelverhagen Ah sorry I have mixed up prerelease with unlisted. So the download count is only missing for unlisted packages which is fine.
Sorry for being not clear enough, I was referring to the parameter name of the SearchFilter class. The actual url is https://api-v2v3search-0.nuget.org/query?q=&skip=0&take=15&prerelease=true&semVerLevel=2.0.0

@onovotny what is the ReservedPrefix field?

@clairernovotny

Copy link
Copy Markdown
Member

@campersau sorry, it is PrefixReserved.

That's what determines if packages get the "blue checkbox" on NuGet.org. Some packages where there can be confusion have their names/prefixes verified.

@campersau

Copy link
Copy Markdown
Collaborator Author

Ah okay so the PrefixReserved is verified in json. (See my example json.)
And if I debug it, it is true for Newtonsoft.Json.
Where is it always false?

@clairernovotny

Copy link
Copy Markdown
Member

@campersau I was mistaken, I think it's working correctly.

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.

Use NuGet v3 API package source

3 participants