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

Some of Code Climate badges are not working #1518

Closed
ghost opened this issue Feb 21, 2018 · 68 comments
Closed

Some of Code Climate badges are not working #1518

ghost opened this issue Feb 21, 2018 · 68 comments
Labels
needs-upstream-help Not actionable without help from a service provider operations Hosting, monitoring, and reliability for the production badge servers service-badge New or updated service badge

Comments

@ghost
Copy link

ghost commented Feb 21, 2018

Hi, guys! It seems to be an issue again/still.
Badges with percentage are not working.
Any info on that?

@PyvesB
Copy link
Member

PyvesB commented Feb 21, 2018

Hello @voplex95!

I hopefully fixed all the badges in #1387. Even though the pull request has been merged, it has not yet been pushed to production. We'll need to be a little more patient. 😉

@paulmelnikow paulmelnikow added operations Hosting, monitoring, and reliability for the production badge servers service-badge New or updated service badge labels Mar 4, 2018
@kachkaev
Copy link

kachkaev commented Mar 17, 2018

@PyvesB thanks for the fix! Is it in production now? It could be me, but I can't make my coverage badge working.

repo: https://codeclimate.com/github/gicentre/prettier-plugin-elm
badge (https://img.shields.io/codeclimate/coverage/github/gicentre/prettier-plugin-elm.svg?style=flat-square): coverage

Example badges on shields.io are also grey:

screen shot 2018-03-17 at 16 23 58

@PyvesB
Copy link
Member

PyvesB commented Mar 17, 2018

@kachkaev unfortunately not. You can check out the fixed version on our staging environment, but we'll still have to wait some time before getting it pushed to production. ^^

@kachkaev
Copy link

kachkaev commented Mar 17, 2018

Thanks for this info @PyvesB! When about are you planning to push the fix into production? Just curious 🙂 If there's anything blocking, how can I help?

Meanwhile, will it be OK if use a staging badge at https://shields-staging.herokuapp.com/codeclimate/coverage/gicentre/prettier-plugin-elm.svg?style=flat-square?

@PyvesB
Copy link
Member

PyvesB commented Mar 17, 2018

I simply help maintaining the project, I'm afraid I'm not going to be able to provide a more helpful answer. Let's ping @paulmelnikow and @espadrine , they may be able to shed some light on the next deployment plans. 😉

@paulmelnikow
Copy link
Member

paulmelnikow commented Mar 17, 2018

See #1538!

@DannyBen
Copy link

Any update on this? I know it used to work a few days ago (but then shields.io still suffered from the occasional timeout images), and that the URL for Code Climate changed, and that Code Climate dropped support for the "Issues" badge - but I hope the Maintainability badge can be fixed soon.

@PyvesB
Copy link
Member

PyvesB commented Apr 10, 2018

As far as I can tell, the Code Climate badges should be working as expected. This is what I see when I visit the Shields homepage:

codeclimate

I did submit a yet undeployed pull request to make our Code Climate code more reliable (#1613) and we are facing more general issues due to lack of capacity (see #1568), but I don't believe much else can be done right now.

@DannyBen
Copy link

This is what I see (at the time of this comment):
image

@PyvesB
Copy link
Member

PyvesB commented Apr 10, 2018

As we've got three production servers, we might be hitting different ones when requesting the badges (or possibly different versions of cached badges).

@platan
Copy link
Member

platan commented Apr 10, 2018

I checked https://img.shields.io/codeclimate/issues/twbs/bootstrap.svg badge by replacing img.shields.io with an IP address of production server https://github.com/badges/shields/blob/master/doc/production-hosting.md#main-server-sysadmin and all 3 returns the same result - "issues: 114".

@platan
Copy link
Member

platan commented Apr 10, 2018

And now I get "not found" for all CodeClimate badges at "http://shields.io/". A moment ago they all were OK.

@DannyBen
Copy link

And now I get "not found" for all CodeClimate badges at "http://shields.io/". A moment ago they all were OK.

... and the plot thickens ...

@RedSparr0w
Copy link
Member

All currently showing ok for me, perhaps we are hitting CodeClimates rate limit?

@PyvesB
Copy link
Member

PyvesB commented Apr 10, 2018

@RedSparr0w yes, I was thinking that as well. We go back to the "more aggressive caching" mentioned in #1568. 😃

@RedSparr0w
Copy link
Member

RedSparr0w commented Apr 13, 2018

Did some tests overnight and i'm certain we are hitting the API limit:
#4bb2c5 Found
#eaa228 Not Found
chart
On average after ~28 Minutes we start getting the not found badges.
And immediately after the hour rolls over, the badges start working again.

@epistrephein
Copy link

epistrephein commented Apr 14, 2018

I did the same test yesterday, I'd say it's definitely an API limit problem.

Maintainability badge found/not-found logs
I, [2018-04-13T14:00:21UTC]  INFO -- : Badge OK
I, [2018-04-13T14:10:04UTC]  INFO -- : Badge OK
I, [2018-04-13T14:20:04UTC]  INFO -- : Badge OK
E, [2018-04-13T14:30:08UTC] ERROR -- : Badge NOT FOUND
E, [2018-04-13T14:40:04UTC] ERROR -- : Badge NOT FOUND
E, [2018-04-13T14:50:03UTC] ERROR -- : Badge NOT FOUND
I, [2018-04-13T15:00:11UTC]  INFO -- : Badge OK
I, [2018-04-13T15:10:05UTC]  INFO -- : Badge OK
I, [2018-04-13T15:20:03UTC]  INFO -- : Badge OK
E, [2018-04-13T15:30:03UTC] ERROR -- : Badge NOT FOUND
E, [2018-04-13T15:40:03UTC] ERROR -- : Badge NOT FOUND
E, [2018-04-13T15:50:12UTC] ERROR -- : Badge NOT FOUND
I, [2018-04-13T16:00:03UTC]  INFO -- : Badge OK
I, [2018-04-13T16:10:04UTC]  INFO -- : Badge OK
I, [2018-04-13T16:20:03UTC]  INFO -- : Badge OK
E, [2018-04-13T16:30:04UTC] ERROR -- : Badge NOT FOUND
E, [2018-04-13T16:40:03UTC] ERROR -- : Badge NOT FOUND
E, [2018-04-13T16:50:03UTC] ERROR -- : Badge NOT FOUND
I, [2018-04-13T17:00:04UTC]  INFO -- : Badge OK
I, [2018-04-13T17:10:03UTC]  INFO -- : Badge OK
I, [2018-04-13T17:20:05UTC]  INFO -- : Badge OK
E, [2018-04-13T17:30:03UTC] ERROR -- : Badge NOT FOUND
E, [2018-04-13T17:40:03UTC] ERROR -- : Badge NOT FOUND
E, [2018-04-13T17:50:03UTC] ERROR -- : Badge NOT FOUND
I, [2018-04-13T18:00:03UTC]  INFO -- : Badge OK
I, [2018-04-13T18:10:04UTC]  INFO -- : Badge OK
I, [2018-04-13T18:20:03UTC]  INFO -- : Badge OK
I, [2018-04-13T18:30:04UTC]  INFO -- : Badge OK
E, [2018-04-13T18:40:03UTC] ERROR -- : Badge NOT FOUND
E, [2018-04-13T18:50:04UTC] ERROR -- : Badge NOT FOUND
I, [2018-04-13T19:00:03UTC]  INFO -- : Badge OK
I, [2018-04-13T19:10:04UTC]  INFO -- : Badge OK
I, [2018-04-13T19:20:03UTC]  INFO -- : Badge OK
I, [2018-04-13T19:30:04UTC]  INFO -- : Badge OK
E, [2018-04-13T19:40:06UTC] ERROR -- : Badge NOT FOUND
E, [2018-04-13T19:50:06UTC] ERROR -- : Badge NOT FOUND
I, [2018-04-13T20:00:03UTC]  INFO -- : Badge OK
I, [2018-04-13T20:10:03UTC]  INFO -- : Badge OK
I, [2018-04-13T20:20:04UTC]  INFO -- : Badge OK
I, [2018-04-13T20:30:03UTC]  INFO -- : Badge OK
I, [2018-04-13T20:40:03UTC]  INFO -- : Badge OK
E, [2018-04-13T20:50:04UTC] ERROR -- : Badge NOT FOUND
I, [2018-04-13T21:00:04UTC]  INFO -- : Badge OK
I, [2018-04-13T21:10:03UTC]  INFO -- : Badge OK
I, [2018-04-13T21:20:03UTC]  INFO -- : Badge OK
I, [2018-04-13T21:30:03UTC]  INFO -- : Badge OK
E, [2018-04-13T21:40:03UTC] ERROR -- : Badge NOT FOUND
E, [2018-04-13T21:50:03UTC] ERROR -- : Badge NOT FOUND
I, [2018-04-13T22:00:04UTC]  INFO -- : Badge OK

@PyvesB
Copy link
Member

PyvesB commented Apr 14, 2018

The API documentation states:

The API enforces a limit of 5,000 requests per token per hour.

As we're not actually using tokens in our queries, I'm wondering whether we might be getting rate limited sooner. Also, these Code Climate badges systematically require two API calls to get all needed information, which isn't helping us either.

@kachkaev
Copy link

kachkaev commented Apr 14, 2018

Given that your project is so popular and important to people, WDYT of writing to Code Climate and asking them for a King Token that would not have the rate limits? They might be happy with providing you such token for free as it is also in their interests.

I would not know about Code Climate without stumbling across your badges and so would not create an account there. At the moment I only have one open-source project in Code Climate and this does not generate any direct profits to them, but I'm already half way through in becoming a paying customer. Guess this situation is not unique.

@shrink
Copy link

shrink commented Apr 14, 2018

I have just recently started to use Code Climate for my open source project and ran into this rate limiting issue with the badges in my repository. Although I'm not associated with shields, I have sent an email to Code Climate pointing them to this issue asking that they provide some information here on whether or not they'll be able to grant an access token with higher rate limits.

epistrephein added a commit to epistrephein/rarbg that referenced this issue Apr 16, 2018
Until badges/shields#1518 is fixed, Code Climate official badges should
be used to avoid not-found errors. Since these badges are round, all
other badges should be used in round form for consistency.
@blackxored
Copy link

This is still not working to this day. Any way I can help?

@shrink
Copy link

shrink commented Apr 18, 2018

I heard back from Code Climate support:

Hey Samuel-

Thanks for reaching out and sorry for the trouble with those badges. Happy to help with this.

I'd like to run this by one of my dev colleagues here to help provide some guidance.

Once I have an update on my end, I'll be back in touch. 👌 If you have any questions in the meantime, please feel free to shoot me an email.

Thanks again,

-Emily

@kachkaev
Copy link

@efueger please do not deprecate shields.io badges – this is how you may aquire additional new customers. I personally knew about your service by just searching ‘coverage’ there.

The point of shields.io is to provide developers with a nice choice of styles, eg flat badges with rect corners. Even if your official badges mimic these styles (which will cost you money to develop), they won’t be 100% alike. Users won’t like the mismatch between the styles and will less likely add your badge to readme (which reduces audience reach for you).

Simply turning off rate limiting for shields.io agents looks like a solution that suits everyone.

@AlexWayfer
Copy link

@efueger please do not deprecate shields.io badges – this is how you may aquire additional new customers. I personally knew about your service by just searching ‘coverage’ there.

I think I'll have to abandon this service for my projects if they deprecate shields.io, because I like consistency:

image

I do not understand why somebody want to drop shields.io support.

@PyvesB
Copy link
Member

PyvesB commented Oct 29, 2018

I've done a bit of work in #2201 to make the examples on our homepage static, therefore sparing some requests and hopefully helping us stay within the extremely tight boundaries of the public Code Climate API.

@efueger any news on the @codeclimate side of things? I'm hoping the above responses from our users will shed some light on the issue at hand.

@citricsquid maybe it's worth following up by email as well?

@AlexWayfer
Copy link

@PyvesB, thank you. I hope that Code Climate will give us the ability to use their service with beautiful and customizable badges from shields.

@paulmelnikow
Copy link
Member

Could we solve this by scraping their SVG badges (as in #2229)?

@PyvesB
Copy link
Member

PyvesB commented Oct 31, 2018

@paulmelnikow I'll briefly sum up some of the history around these badges so that we're all on the same page. Initially we had a coverage percentage badge that retrieved the content disposition header from a PNG image returned by Code Climate. Two score badges (i.e. with letters) which did do SVG scraping were later implemented in #1236. However, Code Climate changed the format of one of their SVG badges only a few weeks later, and replaced the score with a percentage. Therefore we ended up with broken badges on our side, and no means of retrieving the letter score by scraping anymore. To solve this, I submitted #1368 and switched to using the API which still returned the now missing information. Shortly afterwards, we had to carry out other fixes as Code Climate changed things again on their side (pertaining to the old content disposition header badge) and I overhauled the whole implementation in #1387. Unfortunately ever since we have been hitting rate limits, even though we've improved things quite a lot with better caching and static examples on the homepage.

Unless things have changed recently, the native Code Climate SVG badges are very limited and only provide two pieces of information:

  • maintainability score.
  • coverage percentage.

Our badges are much more diverse:

  • number of issues.
  • maintainability score.
  • maintainability percentage.
  • coverage score.
  • coverage percentage.
  • technical debt.

Only the full API allows to build all of them properly. Our many additional badges, alongside nicer and more consistent visuals, as well as amazing customisation options provided by Shields.io are some of the reasons why our users have been so passionate about getting this issue resolved. Unfortunately, after 6 months of following up, @codeclimate's only official message on this issue showcases a lack of understanding of the problem at hand.

@RedSparr0w how often does your uptime robot refresh its data? I can only display until October 24th at the time of writing. I would be quite interested in knowing the impact of #2201.

@paulmelnikow
Copy link
Member

Would using a pool of tokens be possible, or would the token need to correspond to the account that owns the project?

@PyvesB
Copy link
Member

PyvesB commented Nov 1, 2018

@paulmelnikow well we've mentioned solutions using tokens in some way or the other since the early days of this issue, and I believe @citricsquid contacted @codeclimate's support precisely on this matter back in April, with several follow ups in the meantime. This is where we have been hitting a wall.

@paulmelnikow
Copy link
Member

It sounds like what we asked is for them to drop the rate limit, or give us a king token with a higher rate limit.

GitHub basically made the same call a while back, which is what led us to use the elaborate token rotation scheme we're using now. I'm wondering if either part of that solution could be used here.

For example:

  1. If I signed up for my own code climate account, could I use my token to make queries against other users' public repos?
  2. Would using a single token get us more requests than we're getting with no token?
  3. Would a rotation of several tokens solve both problems?

Just trying to poke in the corners of our assumptions and see if there's anything we might have missed!

@efueger
Copy link

efueger commented Nov 13, 2018

Hi @PyvesB ,

Thanks for the summary.

I really appreciate the effort you've put into this already. I've spoken to our Product and Engineering teams and it does sound like we need to provide you a different rate limit. Unfortunately, we can’t alter rate limits for security limits. And, I don't think we can prioritize this work in the near future.

I know this was not the answer you were looking for, and I'm really sorry about that.

-> To confirm for our devs notes: your users do not provide a Code Climate API key, correct?

@PyvesB
Copy link
Member

PyvesB commented Nov 18, 2018

@efueger thank you for your response. No, our users do not provide a Code Climate API key, we are currently relying on the unauthenticated API limits.

@kachkaev
Copy link

kachkaev commented Dec 22, 2018

I found a personal solution for this rather long standing and irritating problem. Not sure if CodeClimate people will like it though, because it involves dropping their service as well as Travis/AppVeyor in favour of Azure DevOps! 😅 Check out the result here:
https://github.com/gicentre/prettier-plugin-elm

No more coverage: unknown in a badge and no more clumsy integrations between a bunch of services, which are hard to make work together. Such a relief! ✨

Sorry for a slight off-topic, but hope it will help someone like me here and also give @efueger an important message to communicate to the CodeClimate management and devs.

@willstocks
Copy link

Any movement on this at all? I came to add a CodeClimate badge to my repo today and the styling/font is just nasty (apologies @efueger - but to be blunt about it, pretty much all other badges seem to follow a standard format, not sure why CC is so far off and there are no customization options!) and the shields version isn't working for me 😞

I know it's shallow - because CC works for me and works well as a product - but the simple fact that the public facing badge is so... 🤢 makes me want to not use it in favour of having something "nicer".

@epistrephein
Copy link

epistrephein commented Jan 28, 2019

I agree. I mean, if they don't want to provide a token for shields, they could give their users a choice between their normal badge design and the de-facto standard badge design of almost every service (Travis, Gemfury, Depfu to name a few).
But I suppose branding is important in this regard too 😕

@willstocks
Copy link

willstocks commented Jan 28, 2019 via email

@efueger
Copy link

efueger commented Jan 29, 2019

Hi everyone - thanks again for all of the input here. I definitely understand why those badge formats are a pain for you.


I don't have an ETA on changes, but we're actively collecting this feedback from you (and other internal and external users).

  • do any of you use these badges for private repos?
  • or, are you primarily oss?
  • does this impact any other aspect of your repos? (other than your READMEs)

@AlexWayfer
Copy link

AlexWayfer commented Jan 29, 2019

do any of you use these badges for private repos?

No.

or, are you primarily oss?

Yes.

does this impact any other aspect of your repos? (other than your READMEs)

No.


But it's kind of off-topic, I think it's better to create Google Forms for this purpose.

@willstocks
Copy link

I can second @AlexWayfer's responses:

do any of you use these badges for private repos?

No.

or, are you primarily oss?

Yes.

does this impact any other aspect of your repos? (other than your READMEs)

No - HOWEVER, please do not forget that a README is going to be the first thing that 99% of people see! I know I for one head straight to GitHub for OpenSource projects to review documentation, supportability etc. and the first thing I do is check the README! Whilst it seems "insignificant", first impressions matter... just my honest opinion 😄

@epistrephein
Copy link

Did the rewrite address the usage limit issue discussed here?

@PikachuEXE
Copy link

I still see invalid badge most of the time
Only see it working yesterday...
Today = fail again

@paulmelnikow
Copy link
Member

Did the rewrite address the usage limit issue discussed here?

No, the rewrite was unrelated.

@PyvesB
Copy link
Member

PyvesB commented Sep 9, 2020

No issues with our Code Climate badges were reported recently. Over the years, we've improved caching on our side and we happen to be hitting the Code Climate API with five distinct IP addresses nowadays instead of three previously, which means that we'll hit the rate-limiting more slowly. I consider this as a workaround rather than a proper fix, if usage of our Code Climate badges increases significantly, the rate-limiting will likely kick in again.

Given that the fix mostly depends on Code Climate themselves and we haven't heard from them since early 2019, I don't think there's value in keeping this issue open forever, so I'm gonna go ahead and close it.

Thanks to all those who shared their thoughts and feedback!

@PyvesB PyvesB closed this as completed Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-upstream-help Not actionable without help from a service provider operations Hosting, monitoring, and reliability for the production badge servers service-badge New or updated service badge
Projects
None yet
Development

No branches or pull requests

15 participants