Shields: Codeship badge returns "Build: Unknown"

Created on 20 Apr 2018  ·  19Comments  ·  Source: badges/shields

The codeship badges on https://shields.io/ are "returning Build: Unknown", as are the badges I attempted to create for my new codeship tests.

image

The codeship api seems to indicate that all calls need an access token. Perhaps this requirement was added after the shields.io badge was coded up?

If codeship cannot be supported, then we should remove it.

Most helpful comment

@mikkabouzu see #1538:

Quoting @paulmelnikow:

Deploys usually happen every 1–3 weeks. Thaddée, who has limited time on this project, is the only sysadmin. He's working on giving me access to deploy and logs, but doing so is complicated because the hosting account (and maybe the servers too) are shared with other services he runs.

It's been a bit over a month now (last commit Mar 25) so hopefully it shouldn't be too far off.
:crossed_fingers:

All 19 comments

that is correct that the API requires authentication.

Not sure about what is possible on the shields.io end, but the codeship badge URLs return parsable SVG which include the status. Here's an example: https://app.codeship.com/projects/c3c92d10-63f1-0133-8a1d-5a56884200ab/status?branch=master which contain the element <g id="status_success" clip-path="url(#clip0)"> indicating success. Perhaps that's useful to determine state?

there's a list of possible error codes here: https://documentation.codeship.com/general/account/notifications/#webhook

Seems to be working again:
image
Not sure what would have changed though.

@dennisnewel
Just had a look through the code and looks like we are already parsing the svg image header to determine the state:
image

_Edit: Looks to be down again, maybe hitting their rate limit._
Will track the uptime here.

@RedSparr0w the problem seems to be with the regexp checking the header: .match(/filename="status_(.+)\.png"/)
Codeship returns svg instead of png, so it's not matching.
The file extension doesn't seem to matter, so changing it to .match(/filename="status_(.+)\./) should solve the issue, right?

That could probably explain it. We (Codeship) don't have any rate limits in place on the badges

Nice catch! Are you up for creating a PR or would you like me to?

@dennisnewel That's good to know, Thanks.
Is the ?branch= parameter required for the badges?
Because i noticed on the badge link you provided above , if you remove ?branch=master it errors:
https://app.codeship.com/projects/c3c92d10-63f1-0133-8a1d-5a56884200ab/status:

https://app.codeship.com/projects/c3c92d10-63f1-0133-8a1d-5a56884200ab/status?branch=master:

@RedSparr0w the branch parameter allows you to select which branch to check. without it, it returns the status of the last build in the project (in the case above, it's an infrastructure failure i managed to trigger on my dev branch - not an error in returning state)

here's another example from a different project https://app.codeship.com/projects/cdb18f20-d75d-0134-dcb2-760971575778/status

Ah, okay that makes perfect sense! thanks for that.

Please remove codeship from the list, it's not supported anymore. We are getting build: unknown on all of our projects. Thanks guys!

i can't see why it shouldn't work though...the only small thing is that we've moved from https://codeship.com to https://app.codeship.com for the badges, so maybe something get's stuck in the load balancer?

@mrz1836 when did it stop working for you?

About a week ago. Are you able to replicate the issue @dennisnewel ?

yeah, the codeship badges work fine codeship but not when using shields.io shields even though i'm using the same project uuid

I'm glad it's not just me ;-). I have the exact same situation @dennisnewel . Oh well, out goes the sheilds.io image for now...

there has been some changes to the badges around a week ago or so, basically to make them work better on retina screens, but also the switch from png to svg (including changing the content type to svg+xml). I just don't see how those changes could cause the shields.io process to stop working...

@mrz1836 If you look at the comments before yours, it has been fixed in the latest dev branch via #1662,
The patch just needs to be pushed to production.

@dennisnewel It would be because we were specifically searching for .png in the header info which is now .svg so the regex was not finding a match.
we have changed the regex to exclude the file extension now so even if it changes to another format in the future we should be okay.

You can confirm the fix is working in the dev branch here
NOTE:

I'd request that the staging server be restricted to testing. Since we're on the free plan, Heroku limits the number of hours per month the server can be used. If we exceed those with production usage, the staging server becomes unusable for testing, which is why it's there. That said, you're welcome to host your own server on Heroku!


Edit:
on a side note we also added the codeship logo that can be used on your badges with ?logo=codeship:
_(once latest commits are pushed to production server)_

🤦‍♂️ sorry...not sure why i assumed it was already in production.

nice detail with the logo!

No worries, it's definitely a common assumption 😄

Thanks!

@RedSparr0w is there an ETA on the production rollout?

@mikkabouzu see #1538:

Quoting @paulmelnikow:

Deploys usually happen every 1–3 weeks. Thaddée, who has limited time on this project, is the only sysadmin. He's working on giving me access to deploy and logs, but doing so is complicated because the hosting account (and maybe the servers too) are shared with other services he runs.

It's been a bit over a month now (last commit Mar 25) so hopefully it shouldn't be too far off.
:crossed_fingers:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

najeeb-ur-rehman picture najeeb-ur-rehman  ·  3Comments

stclairdaniel picture stclairdaniel  ·  3Comments

kirankotari picture kirankotari  ·  3Comments

irgolic picture irgolic  ·  3Comments

PyvesB picture PyvesB  ·  3Comments