Badgen.net: Coveralls branch percentage bug?

Created on 10 Aug 2018  ·  13Comments  ·  Source: badgen/badgen.net

I'm not sure if this is a bug in badgen or Coveralls API, but shields.io seems to be returning the expected 100% while badgen seems to be using a percentage from a recent PR.

Badgen URL: https://flat.badgen.net/coveralls/c/github/expressjs/morgan/master
shields.io URL: https://img.shields.io/coveralls/expressjs/morgan/master.svg?style=flat-square

Rendered:
Badgen:
shields.io:

All 13 comments

Hmm 🤔

For master branch, this api
https://coveralls.io/github/expressjs/morgan.json?branch=master returns 99.13 (right now),

And the "default" endopoint:
https://coveralls.io/github/expressjs/morgan.json returns 99.15 (right now)

I mostly expected it was going tot be a bug in the Coveralls API. Not sure how shields.io is getting 100% (it's possible they have it cached maybe -- though the build the lower % is from is quite old so 🤷‍♂️ ).

Thanks for taking a look @amio

It looks like shields.io is not even using an API for coveralls is what's happening -- it just loads https://coveralls.io/repos/github/expressjs/morgan/badge.svg?branch=master under the hood, looks at the Location response header and parses the percentage from that. I wonder why they go through that trouble 🤔 Maybe the Coveralls API has just always been broken?

I think what they do is getting the result of coveralls.io's default badge data.

coveralls.io use redirection for performance (no need to generate badge svg on the fly), then shields.io read the Location header for faster result.

coveralls.io's "official" badge shows coverage | 100% while their page reporting COVERAGE DECREASED (-0.4%) TO 99.138% 😅

image

Seems the official badge might be outdated sometime, and shields.io try to be consistent with official badge.

Well, 100% is correct for master branch. The lower % you are seeing is from a pull request.

Using shields.io means that a badge will show coverage of repo code but switching to badgen.net with this bug means it will show whatever the most recent pr to the repo is instead it seems.

Hmm, yes. If there's no api for that, I should use same method as shields.

This is amazing, thank you!

Call it Coveralls, and don't hate it more. :rofl:

What? Call it "coveralls" on label?

No no.. :D Just trolling Coveralls, cuz always was not good.

😂

Was this page helpful?
0 / 5 - 0 ratings

Related issues

styfle picture styfle  ·  5Comments

tunnckoCore picture tunnckoCore  ·  4Comments

tunnckoCore picture tunnckoCore  ·  3Comments

wopian picture wopian  ·  3Comments

tunnckoCore picture tunnckoCore  ·  6Comments