feedback icon indicating copy to clipboard operation
feedback copied to clipboard

Status badge color does not respect configuration

Open ccadar opened this issue 1 year ago • 2 comments

Describe the bug The color of the status badge does not respect configuration in .codecov.yaml

To Reproduce We are using Codecov for an open-source project. The color range is configured as follows:

coverage:
  range: 70...90

Our .codecov.yaml file can be found at https://github.com/klee/klee/blob/master/.codecov.yml and was validated via https://codecov.io/validate

With 70% coverage (70.21% more precisely at the moment), I would expect the badge color to be yellow, but it is red:

What is the problem? Thank you.

ccadar avatar Jan 31 '24 17:01 ccadar

@ccadar I'm confused here, 70% is the low range for coverage and so should be red.

thomasrockhu-codecov avatar May 14 '24 16:05 thomasrockhu-codecov

@thomasrockhu-codecov thanks for the response. According to https://docs.codecov.com/docs/coverage-configuration range: 70...90 means that when the coverage was between 70% and 90% (it was 70.21% when I reported this) we should have seen a yellow bar, not a red one. Is the documentation wrong then, or am I reading it incorrectly?

ccadar avatar May 14 '24 17:05 ccadar

Hi @ccadar, it seems this is a documentation mishap, it's true that in the UI those bars would show up as yellow as soon as it's above the range. The badge behaves differently by gradually changing the colour across the range.

I mentioned it seems like a documentation mishap, but I'm curious to know which behaviour you prefer? I think we can make the behaviour of the badge match the behaviour of the UI and put that behind a config option.

joseph-sentry avatar Jun 20 '24 20:06 joseph-sentry

Sorry for the late reply here. I think a configuration option would be best. But at the very least, the current behavior should be documented -- in my case, I thought the color change happens at the threshold rather than gradually, which is why I opened this issue. Thanks again!

ccadar avatar Aug 08 '24 14:08 ccadar