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

Nuget badges inaccessible #655

Closed
304NotModified opened this Issue Feb 18, 2016 · 39 comments

Comments

Projects
None yet
@304NotModified
Copy link

304NotModified commented Feb 18, 2016

(Comment hijacked to summarize the advancement.)

shields/server.js

Line 3163 in 5e4c711

{ headers: { 'Accept': 'application/atom+json,application/json' } },

NuGet returns a different content type, which is probably why shields.io breaks on the XML/Atom response received from NuGet.

Using the v3 API:

  • Append the package identifier + index.json, for example: https://api.nuget.org/v3/flatcontainer/{packageid-lowercase}/index.json. The JSON has all versions of the package and can tell you in one go what the latest version is. eg, https://api.nuget.org/v3/flatcontainer/microsoft.aspnet.mvc/index.json
  • Get the latest version: (latest = last item in the list, latest stable is last one in the list that does not have a - in the version number)

There is no download information in v3, we'd have to keep the old system which still works for Chocolatey.

Chocolatey doesn't seem to use the v3: https://api.chocolatey.org/v3/flatcontainer/scriptcs/index.json, so we can't use it even for versions.

We cannot find the v3 endpoint for myget: neither https://www.myget.org/F/yolodev/api/v3/flatcontainer/fsharpsupport/index.json nor https://api.myget.org/F/yolodev/v3/flatcontainer/fsharpsupport/index.json work.


(Original comment here.)

The NuGet badges are inaccessible for days. Is this a rate limit? Is there something I can do? Is this for every visitor? Can you cache more at your side?

Current what I see:

image

One of the links:

We see it also on shield.io:

image

We have arround 5K views/day

image

@MathewSachin

This comment has been minimized.

Copy link

MathewSachin commented Feb 22, 2016

I also experience the same issue on my repository with not that many views.

@odinserj

This comment has been minimized.

Copy link

odinserj commented Feb 22, 2016

I have the same with Hangfire project.

@t1st3

This comment has been minimized.

Copy link

t1st3 commented Feb 23, 2016

seems it is fixed (2016/02/23 11PM LMT)

@odinserj

This comment has been minimized.

Copy link

odinserj commented Feb 23, 2016

Confirming, fixed 🎉

@304NotModified

This comment has been minimized.

Copy link

304NotModified commented Feb 25, 2016

Down again

@304NotModified

This comment has been minimized.

Copy link

304NotModified commented Feb 25, 2016

we moved partly to https://badge.fury.io/for/nu, which do work (but has less features)

@dustinmoris

This comment has been minimized.

Copy link

dustinmoris commented Feb 28, 2016

Shields NuGet badges stopped working for me as well so I added support for NuGet badges to buildstats.info.

@SimonCropp

This comment has been minimized.

Copy link

SimonCropp commented Mar 1, 2016

any update on this?

@maartenba

This comment has been minimized.

Copy link
Contributor

maartenba commented Mar 2, 2016

Seems this is the culprit:

shields/server.js

Line 3163 in 5e4c711

{ headers: { 'Accept': 'application/atom+json,application/json' } },

NuGet returns a different content type, which is probably why shields.io breaks on the XML/Atom response received from NuGet.

Alternatively, you may want to use the V3 API for shields as it is much, much faster. The goal is to pick the latest version, right?

  • First, grab the RegistrationBaseAddress entry from https://api.nuget.org/v3/index.json (this does not change often but it's best to grab it every once in a while)
  • Then append the package identifier + index.json, for example: https://api.nuget.org/v3/flatcontainer/{packageid-lowercase}/index.json. The JSON has all versions of the package and can tell you in one go what the latest version is.
@304NotModified

This comment has been minimized.

Copy link

304NotModified commented Mar 2, 2016

@maartenba thx for the tech info!

@espadrine can you help us with this?

martincostello added a commit to martincostello/sqllocaldb that referenced this issue Mar 8, 2016

Change NuGet badge
Use different composite NuGet badge to work around the shields.io
version no longer working
(badges/shields#655).

martincostello added a commit to martincostello/browserstack-automate that referenced this issue Mar 8, 2016

Change NuGet badge
Use different composite NuGet badge to work around the shields.io
version no longer working (badges/shields#655).
@danbarua

This comment has been minimized.

Copy link

danbarua commented Mar 9, 2016

The MyGet badge is broken too.

@304NotModified

This comment has been minimized.

Copy link

304NotModified commented Mar 9, 2016

The MyGet badge is broken too.

Good luck. We have issues with the NuGet badges for more then 30 days, without any response of shields.io team.

AArnott added a commit to AArnott/pinvoke that referenced this issue Mar 9, 2016

Fix nuget badges on readme
badges/shields#655 isn't getting fixed it seems. So we're switching to buildstats.info
@dustinmoris

This comment has been minimized.

Copy link

dustinmoris commented Mar 10, 2016

@danbarua I have added a MyGet badge to buildstats.info. Please have a look if it suits you...

@SimonCropp

This comment has been minimized.

Copy link

SimonCropp commented Mar 10, 2016

i moved to buildstats

chwarr added a commit to chwarr/bond that referenced this issue Mar 10, 2016

Switch NuGet badge to buildstats.info
We were using shields.io for this before, but recent NuGet changes look
to have broken this badge (badges/shields#655).
@danbarua

This comment has been minimized.

Copy link

danbarua commented Mar 11, 2016

@dustinmoris Sweet, thanks!

@kzu

This comment has been minimized.

Copy link
Contributor

kzu commented Mar 11, 2016

Confirmed to still be broken :(

@Yortw

This comment has been minimized.

Copy link

Yortw commented Mar 12, 2016

Still broken for me too.

@atifaziz

This comment has been minimized.

Copy link

atifaziz commented Mar 14, 2016

Likewise

@espadrine

This comment has been minimized.

Copy link
Member

espadrine commented Mar 14, 2016

We have issues with the NuGet badges for more then 30 days, without any response of shields.io team.

Sorry. PRs get priority treatment, which unfortunately can only go as fast as I can review them.

NuGet returns a different content type, which is probably why shields.io breaks on the XML/Atom response received from NuGet.

Yes, I receive XML which I parse as JSON. @Alxandr do you know if there is an easy fix?

Chocolatey still works fine with the same code, though.

First, grab the RegistrationBaseAddress entry from https://api.nuget.org/v3/index.json (this does not change often but it's best to grab it every once in a while)

That could be done with regularUpdate(). I cannot find RegistrationBaseAddress in it though.

@AArnott

This comment has been minimized.

Copy link

AArnott commented Mar 14, 2016

@espadrine: @maartenba's prescribed fix looks pretty simple, and his URLs result in JSON responses so it would avoid you having to parse XML.

@espadrine

This comment has been minimized.

Copy link
Member

espadrine commented Mar 14, 2016

@AArnott I am very much open to PRs on this. I know very little about NuGet, let alone its API. Given the range of what we support, it feels nontrivial for me to replace it without breaking Chocolatey, even if the described fix was clear. But as I said, I cannot find RegistrationBaseAddress in https://api.nuget.org/v3/index.json, and https://api.nuget.org/v3/flatcontainer/microsoft.aspnet.mvc/index.json yields limited information.

It is unclear to me how to ask for the latest version (with or without including prerelease ones), and doing it manually will cause pain (should we use semver? what if there is a non-semver version in the list?). I don't know where the download information is stored.

@maartenba

This comment has been minimized.

Copy link
Contributor

maartenba commented Mar 14, 2016

Oops, need to be RegistrationsBaseUrl.
ANd all URLs sould be lowercase at all times.

@AArnott

This comment has been minimized.

Copy link

AArnott commented Mar 14, 2016

@espadrine: for what it's worth, both I and @vbfox tried to prepare a PR for this change, but we couldn't get your project's dependencies installed locally to prepare the fix. We both have Windows machines, and @vbfox even tried setting up a Linux box.

@espadrine

This comment has been minimized.

Copy link
Member

espadrine commented Mar 14, 2016

@maartenba thanks. What is the purpose of the registration URL? Do you know if there is a way to ask for the latest version, as we had before when using filters? Also, where is the download information?

Is there a good link to the most exhaustive piece of documentation on the v3 API?

@AArnott A change I merged yesterday should make local testing much easier, as the project no longer relies on Cairo.

@maartenba

This comment has been minimized.

Copy link
Contributor

maartenba commented Mar 14, 2016

@espadrine The registration URL has all versions of the package. There is also PackageBaseAddress/3.0.0 which has just the list of versions, for example https://api.nuget.org/v3/flatcontainer/microsoft.aspnet.mvc/index.json (latest = last item in the list, latest stable is last one in the list that does not have a - in the version number)

Regarding downloads, there is no API for that currently.

@espadrine

This comment has been minimized.

@kzu

This comment has been minimized.

Copy link
Contributor

kzu commented Mar 14, 2016

shouldn't all those be different paths though? Why would chocolatey or myget limit what API you use for nuget.org? Aren't (or shouldn't) they different badges altogether?

@espadrine

This comment has been minimized.

Copy link
Member

espadrine commented Mar 14, 2016

They have different domains, but the same code is running on each of those domains, so we could perform the same requests.

@Alxandr

This comment has been minimized.

Copy link
Contributor

Alxandr commented Mar 14, 2016

Myget supports v3. Chocolatey I have no idea.

@espadrine

This comment has been minimized.

Copy link
Member

espadrine commented Mar 14, 2016

@alexandr do you know what URL I should try for MyGet?

espadrine added a commit that referenced this issue Mar 14, 2016

NuGet: use API v3
The v2 API returned XML even though we asked for JSON.

MyGet is still not working.

Part of #655.
@Alxandr

This comment has been minimized.

Copy link
Contributor

Alxandr commented Mar 14, 2016

The entrypoint of a feed is here https://www.myget.org/F/dotnet/api/v3/index.json

If you just go to the nuget gallery and pick a random feed (like I just did) it'll tell you.

@espadrine

This comment has been minimized.

Copy link
Member

espadrine commented Mar 14, 2016

@Alxandr

This comment has been minimized.

Copy link
Contributor

Alxandr commented Mar 14, 2016

@espadrine

This comment has been minimized.

@Alxandr

This comment has been minimized.

Copy link
Contributor

Alxandr commented Mar 15, 2016

@espadrine

This comment has been minimized.

Copy link
Member

espadrine commented Mar 15, 2016

Unfortunately, the download information is lost in translation for both nuget and myget.

@espadrine espadrine closed this in fbb034f Mar 15, 2016

@304NotModified

This comment has been minimized.

Copy link

304NotModified commented Mar 15, 2016

Thanks for the fix!

@kzu

This comment has been minimized.

Copy link
Contributor

kzu commented Mar 15, 2016

Awesome! Thanks!

On Tue, Mar 15, 2016 at 3:01 PM Julian Verdurmen notifications@github.com
wrote:

Thanks for the fix!


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#655 (comment)

@atifaziz

This comment has been minimized.

Copy link

atifaziz commented Mar 15, 2016

Cheers! 👏

odinserj added a commit to HangfireIO/HangfireIO.github.io that referenced this issue Mar 21, 2016

shaynevanasperen added a commit to shaynevanasperen/PowerTasks that referenced this issue May 18, 2016

shaynevanasperen added a commit to shaynevanasperen/NHibernate.Sessions.Operations that referenced this issue May 18, 2016

shaynevanasperen added a commit to shaynevanasperen/NHibernate.Sessions that referenced this issue May 18, 2016

cskwrd added a commit to cskwrd/DbUp that referenced this issue Mar 27, 2017

Update README.md
NuGet download counts are not currently supported on Shields.io. This is due to the fact that the NuGet Gallery API doesn't currently provide this information.

See badges/shields#655

@cskwrd cskwrd referenced this issue Mar 27, 2017

Closed

Update README.md #247

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