Shields: SensioLabs options

Created on 10 Jan 2018  ยท  9Comments  ยท  Source: badges/shields

So, I'm switching from SesionLab's badge to the shields.io badge....
I kinda liked the โ˜…'s in the sensio version...

Are the query-string params standardized across all integrations, or could the Sensio integration be tweaked to allow customization of status text : โ˜…(U+2605) vs "platinum", "gold", "silver", & "bronze"?

statusType=["string"] | "stars"

Or, 1 step further and have the ability to specify custom text per status
statusTextBronze=%E2%98%85&statusTextSilver=meh would output "โ˜…" for bronze, "meh" for silver, and the defaults for gold and platinum

I see the label param can be used to override the label
https://img.shields.io/sensiolabs/i/45afb680-d4e6-4e66-93ea-bcfa79eb8a87.svg?label=SensioLabs

Will output "SensioLabs" on the left rather than "check"

service-badge

All 9 comments

Currently it's not possible to override the message. However I'd be down for adding a parameter to see stars instead of the text. How do the stars map onto the status strings?

Overriding the messages works against consistency, which is one of the goals of the project. If there's a lot of community support to do that, we could consider adding it. So far only one person has asked before.

How do the stars map onto the status strings?

status | stars
---|:---
No Medal |  
Bronze | โ˜…
Silver | โ˜…โ˜…
Gold |โ˜…โ˜…โ˜… _(I've never seen a gold medal... the most minor infraction drops my project from platinum to silver)_
Platinum | โ˜…โ˜…โ˜…โ˜…

Overriding the messages works against consistency

Roger that.. I wasn't sure if the project's goal is consistency of the restful api, or the consistency of the output (consistency of the pixel perfectness, a clear goal)

Maybe it could be added as something like ?metric=stars
or using the uri like /sensiolabs/i-stars/ or /sensiolabs/stars/

/cc @calebcartwright I just noticed this issue (re #2572).

I remember seeing this issue, but thinking it would be better added in a follow up once the service refactor in #2572 is merged.

Wanted to follow up on this one now that #2572 has been merged. We still support the old /sensiolabs/ paths for backward compatibility, but have changed the primary paths to reflect the rebranding. We currently support two badges:

  • Grade: /symfony/i/grade ex:
  • Violations: /symfony/i/violations ex:

I've got a few questions about supporting stars:
1) Should this be exposed via a separate route, such as /symfony/i/stars or /symfony/i/grade/stars, or as an option on one of the existing badge routes (I'd assume the grade badge) such as /smyfony/i/grade?metric=stars)?
2) Could we use a scale of 1-5 stars (1 star for no medal through 5 stars for platinum)? I believe this would make it easier to reuse some of our existing star-related functions which work on a 1-5 scale
3) What color scale should be used? The same color scale we're using for the grade badges or the standard color scale used on other Shields stars badges?
4) Regarding the format of the stars, how would you feel about the badge message looking like the other star badges (i.e. ) where there's always five stars shown, and the stars are filled in accordingly?

  1. I think it could be /symfony/i/stars. We've a few others which follow that pattern.
  2. I think it would be confusing to follow a different scale than Sensio's. If it's a little extra code we can live with it.
  3. Maybe the grade colors?
  4. Ooh, I like that idea. Though I'm assuming you mean it'd be shown out of four, the maximum?

2. I think it would be confusing to follow a different scale than Sensio's. If it's a little extra code we can live with it.

Ahh sorry I missed that before, didn't realize there was already an established star rating scale over there. Agreed on sticking with the 4 star scale, including for the badge format

Alright I've taken a shot at implementing this. Our staging apps don't have the required tokens so you can't test it live in the staging app (https://shields-staging-pr-2971.herokuapp.com/) but I added a few extra examples(only in my local env) to create the below screenshot to illustrate what they'll look like:

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

irgolic picture irgolic  ยท  3Comments

kerolloz picture kerolloz  ยท  3Comments

calebcartwright picture calebcartwright  ยท  3Comments

paulmelnikow picture paulmelnikow  ยท  3Comments

AlexWayfer picture AlexWayfer  ยท  3Comments