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

Magnum CI #523

Closed
larsbrinkhoff opened this issue Sep 8, 2015 · 6 comments
Closed

Magnum CI #523

larsbrinkhoff opened this issue Sep 8, 2015 · 6 comments

Comments

@larsbrinkhoff
Copy link
Contributor

API: https://magnum-ci.com/docs/api

Sample badge:

@espadrine
Copy link
Member

Thanks for the suggestion!

Sadly curl 'https://magnum-ci.com/api/v1/project/builds?token=96ffb83fa700f069024921b0702e76ff' is unsuccessful.

@larsbrinkhoff
Copy link
Contributor Author

It seems the public token for the build badge is different from the private API token.

@larsbrinkhoff
Copy link
Contributor Author

Would it be possible to guess the status from the contents of the PNG?

@espadrine
Copy link
Member

@larsbrinkhoff OCR is the worst kind of scrapping; nobody wants a badge that takes more than a few second to be generated, and I doubt the servers would survive that well.

So the answer is yes, but a PR that does it wouldn't be merged.

On the other hand, many vendors that serve PNG badges populate the Content-Disposition HTTP header with all the information we need. HTTP scraping is much more practical and in fact used quite often in shields.

curl -I https://magnum-ci.com/status/96ffb83fa700f069024921b0702e76ff.png | grep Content-Disposition
# Content-Disposition: inline; filename="pass.png"

If you want to implement that, you can find a similar HTTP scrapper in server.js. We'd need to know what it returns if the test is failing, though.

@larsbrinkhoff
Copy link
Contributor Author

We'd need to know what it returns if the test is failing, though.

This:

Content-Disposition: inline; filename="fail.png"

@larsbrinkhoff
Copy link
Contributor Author

PR submitted: #584.

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

2 participants