Badges for Flags

Description

How do you create a badge for an individual badge?

Repository

private

Simple question. Docs just say: “Badges and graphs may express specific flags only. More details on this will come soon.” (https://docs.codecov.io/docs/flags#section-flag-badges-and-graphs). Does that mean the docs will come soon, or the ability to create badges for flags (feature) will come soon?

1 Like

Hi @cjancsar, thanks for your question! Unfortunately, it means that the feature will be coming soon. I don’t yet have a timeline for you, but I’ll be sure to bring this up with the product team.

Hello @cjancsar,

using the querystrign ?flag=<flag-name> works. This returns a badge with the numbers from only the mentioned flag.

I’m currently using like this: https://codecov.io/gh/<org>/<project>/branch/<branch>/graph/badge.svg?flag=<flag-name>

As an example: https://github.com/B2W-BIT/asgard-api

1 Like

Add this solution to the document?

People need to search for this solution.

I don’t think it solves the problem. It shows unknown and also in the repo you mentioned as an example.

@VijayanB, I’m not sure what you mean

Demo flag
https://codecov.io/gh/thomasrockhu/cf-flags-demo/branch/master/graph/badge.svg?flag=demo&precision=2

Index flag
https://codecov.io/gh/thomasrockhu/cf-flags-demo/branch/master/graph/badge.svg?flag=index&precision=2

No flag
https://codecov.io/gh/thomasrockhu/cf-flags-demo/branch/master/graph/badge.svg?precision=2

@tom I stand corrected. I was referring to different branch which never uploaded coverage report and got unknown as coverage. After merging the branch and once upload happened from that branch, i see the values. Thanks,

1 Like