-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[CodeClimate] Fix coverage and maintainability score badges #1368
Conversation
Thanks for this, changes look good to me 👍 Think this part of the codeclimate badge may also be broken if you feel like taking a look into it 😄 |
@RedSparr0w: thanks for the review. I thought they were broken at first, but actually after doing some tests locally I think the examples in the homepage are just badly chosen. But this may have changed since I checked two weeks or so ago! ^^ |
I'm not really sure what the other badge is supposed to return, Also from the looks of it, the wrong header regex is being tested? |
@RedSparr0w: after looking at it again, you're right, other things seem to have broken as well. I'm tempted to get rid of all the broken Code Climate code in server.js, add missing tests and only use the new proper API rather than trying to do pattern matching on headers from their own badges, as this has caused us a lot of trouble recently. |
@PyvesB Yeah looks like all the codeclimate badges are broken (excl this one) |
By the looks of it, all five badges will have to make the same first API call and will then all make their second call to either the |
Nope, that all sounds good to me, Thanks for all your work on this! |
Hello there,
This pull request takes care of issue #1329.
I had a closer look at the API documentation and managed to find a way to retrieve the now missing code coverage score in a different way. As before, the code is making a call to the get repository endpoint, but instead of firing a second call to retrieve the headers of Code Climate's own badges, it's now calling the get snapshot or get test coverage reports endpoint to get the scores. In essence the coverage and maintainability badges are now generated only via API body responses rather than trying to do pattern matching on returned headers, which should hopefully be cleaner and more reliable. 👍
Cheers,
Pyves