-
-
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
Added Codecov integration #269
Conversation
Looks good on inspection. It's a bit weird to use headers (X-Coverage) for this, but if it works, it works. ;) I have permissions to merge this, but I don't think I should be the guy to do it since I haven't written any code in this repo. I have no idea how it deploys anyway. @espadrine ? |
@cainus I thought it may be easier then snipping it from the image name. If that is preferable then its should be easy to implement. Thank you! |
@stevepeak Thanks a lot! Using X-Coverage is just fine if it is likely to survive for some time. If it starts to break, it will probably fall on me to fix it (or remove the support), but I have no insight about the continued support of X-Coverage by Codecov. On the other hand, I can't risk having the server crash upon an invalid badge. $ curl -I https://codecov.io/github/jekyll/jekyll/coverage.png
HTTP/1.1 302 Found
Server: Cowboy
Connection: keep-alive
Content-Length: 0
X-Coverage: unknown (Btw, I did find this Not to worry, though: covering the sensitive part with this should fix it. // Here be the part just in the request callback, just after the if (err != null)
try {
// Setting the badge information here.
} catch(e) {
badgeData.text[1] = 'malformed';
sendBadge(format, badgeData);
return;
} Beyond that, this line does not work, since node puts keys lowercase: var coverage = res.headers['X-Coverage']; // should be 'x-coverage' Finally, this line cannot work either: badgeData.colorscheme = coveragePercentageColor(percentage); // First use of percentage. Another nitpick, there is a trailing space on line 967. It is obvious that this PR was not tested, which is why I took much more time to review it than I wanted, delaying other reviews and making my eyes sleepy this morning for work. Is there anything I could have done to make it easier for you to test your PR? Apart from that, I'd like to use the URL |
Some fixes: b935dad |
As far as Using Let me know what, if anything, you would like me to do next. Thanks again! |
Well a couple of things:
Also if a failure in any service can take down the whole server, you might want to try using something like express-domain-middleware to get better isolation. Anyway... just some ideas. I'm willing to help where I can too. |
Where would you write these? They are both in
ok
There are very varied techniques to scrape the information we need, so we can't create a unique spec to copy. That said, maybe my attempts were insufficient. Maybe someone else can do it. The flexibility that this part of the program requires makes this a challenging task. |
@cainus it would be my honor for you to proof this pr's validity. Thank you!