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

Nuget badges inaccessible #655

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

Nuget badges inaccessible #655

304NotModified opened this issue Feb 18, 2016 · 39 comments

Comments

@304NotModified
Copy link

(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
Copy link

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

@odinserj
Copy link

I have the same with Hangfire project.

@t1st3
Copy link

t1st3 commented Feb 23, 2016

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

@odinserj
Copy link

Confirming, fixed 🎉

@304NotModified
Copy link
Author

Down again

@304NotModified
Copy link
Author

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

@dustinmoris
Copy link

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

@SimonCropp
Copy link

any update on this?

@maartenba
Copy link
Contributor

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
Copy link
Author

@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
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
Use different composite NuGet badge to work around the shields.io
version no longer working (badges/shields#655).
@danbarua
Copy link

danbarua commented Mar 9, 2016

The MyGet badge is broken too.

@304NotModified
Copy link
Author

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 dotnet/pinvoke that referenced this issue Mar 9, 2016
badges/shields#655 isn't getting fixed it seems. So we're switching to buildstats.info
@dustinmoris
Copy link

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

@SimonCropp
Copy link

i moved to buildstats

chwarr added a commit to chwarr/bond that referenced this issue Mar 10, 2016
We were using shields.io for this before, but recent NuGet changes look
to have broken this badge (badges/shields#655).
@danbarua
Copy link

@dustinmoris Sweet, thanks!

@kzu
Copy link
Contributor

kzu commented Mar 11, 2016

Confirmed to still be broken :(

@Yortw
Copy link

Yortw commented Mar 12, 2016

Still broken for me too.

@atifaziz
Copy link

Likewise

@espadrine
Copy link
Member

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
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
Copy link
Member

@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
Copy link
Contributor

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

@AArnott
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
Copy link
Member

@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
Copy link
Contributor

@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
Copy link
Member

@kzu
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
Copy link
Member

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

@Alxandr
Copy link
Contributor

Alxandr commented Mar 14, 2016

Myget supports v3. Chocolatey I have no idea.

@espadrine
Copy link
Member

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

espadrine added a commit that referenced this issue Mar 14, 2016
The v2 API returned XML even though we asked for JSON.

MyGet is still not working.

Part of #655.
@Alxandr
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
Copy link
Member

@Alxandr
Copy link
Contributor

Alxandr commented Mar 14, 2016

The dotnet feed and the yolodev feed are not the same.

https://dotnet.myget.org/F/dotnet-corert/api/v3/flatcontainer/Microsoft.DotNet.AppDep/index.json

@espadrine
Copy link
Member

@Alxandr
Copy link
Contributor

Alxandr commented Mar 15, 2016

Yes, but that package no longer does :)

https://www.myget.org/F/yolodev/api/v3/flatcontainer/YoloDev.Dnx.FSharp/index.json

@espadrine
Copy link
Member

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

@304NotModified
Copy link
Author

Thanks for the fix!

@kzu
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
Copy link

Cheers! 👏

odinserj added a commit to HangfireIO/Hangfire.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
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

No branches or pull requests