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

Add appveyor support #174

Closed
MoOx opened this issue May 13, 2014 · 9 comments
Closed

Add appveyor support #174

MoOx opened this issue May 13, 2014 · 9 comments

Comments

@MoOx
Copy link

MoOx commented May 13, 2014

http://www.appveyor.com/
Their badge is weird (eg: https://github.com/gruntjs/grunt#readme )

@seanlinsley
Copy link
Contributor

For posterity:

screen shot 2014-05-12 at 11 12 16 pm

@espadrine
Copy link
Member

The only API they seem to provide is about team management.

They also provide a webhook for project owners to specify. It wouldn't really be practical to use for us, since we need to store the information for them instead of requesting that data from their servers. We have no way to check that the information we have is up-to-date.

They block direct HEAD requests by returning a 405 Method Not Allowed. On the other hand, the image they produce can be directly accessed. There is no evidence of rate limiting in their HTTP headers:

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 1749
Content-Type: image/png
Expires: -1
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 18 Jun 2014 17:28:21 GMT

So, I can see two ways to sneak in compatibility:

  • Rely on the content length (as a PNG, we can be hopeful that the red badge will have a different size than the green badge). Pros: easy to implement. Cons: any change they make to the image can break it.
  • Compare the bytes to those produced by the document example. Pros: probably won't break upon image change. Cons: requires to download the example badge regularly.
  • Rely on the main color of the badge. Extract it from the raw data. Pros: harder for them to break. Cons: harder to implement, although there are libraries for it.

@espadrine
Copy link
Member

I'd love to have an example of a failing badge for testing. Any pointers?

@traversaro
Copy link

Failing badge example: https://github.com/robotology/ycm

@espadrine
Copy link
Member

@traversaro Thanks a lot!

@sebmck
Copy link
Contributor

sebmck commented Jun 19, 2014

There's an API available from https://ci.appveyor.com/api/projects/gruntjs/grunt where the status of the latest build is available at "ProjectBuildResults Build Status".

@sebmck
Copy link
Contributor

sebmck commented Jun 19, 2014

That's an XML API although if you pass "Accept:application/json" you get JSON API and the status is available from "project.build.status".

@espadrine
Copy link
Member

@sebmck Good find! Plenty of thanks in your direction!

espadrine added a commit that referenced this issue Jun 19, 2014
Part of issue #174.
@espadrine
Copy link
Member

@sebmck Oh, well… I read your comment a bit late…

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

5 participants