Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add [PUB] popularity badge #7920

Merged
merged 4 commits into from
May 8, 2022
Merged

add [PUB] popularity badge #7920

merged 4 commits into from
May 8, 2022

Conversation

G1Joshi
Copy link
Contributor

@G1Joshi G1Joshi commented May 1, 2022

@shields-ci
Copy link

shields-ci commented May 1, 2022

Messages
📖 ✨ Thanks for your contribution to Shields, @G1Joshi!

Generated by 🚫 dangerJS against 3c2676c

services/pub/pub.tester.js Outdated Show resolved Hide resolved
@G1Joshi
Copy link
Contributor Author

G1Joshi commented May 1, 2022

This PR depends on #7921.
All tests will pass after merging the above-mentioned PR.

services/pub/pub-popularity.service.js Outdated Show resolved Hide resolved
services/pub/pub-popularity.tester.js Outdated Show resolved Hide resolved
return {
label: 'popularity',
message: `${Math.round(popularityScore * 100)}%`,
color: 'brightgreen',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with #7918 there is the opportunity to convey some useful information using color here rather than just make everything brightgreen even if your score is low. Same question here really. Is there any existing community norm for what represents a "good" score we can represent here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I have added the blue color for popularity scores as there are no such norms for scores.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Most of our rating badges are for star ratings (out of 5). Translating the splits we use there to percentages would give us

const roundedScore = Math.round(popularityScore * 100)

return {
  label: 'popularity',
  message: `${roundedScore}%`,
  color: floorCount(roundedScore, 40, 60, 80),
}

I reckon lets go with that. It seems like popularity is a pretty straightforward scale and this will be consistent with other rating badges.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@G1Joshi G1Joshi requested a review from chris48s May 4, 2022 17:37
@chris48s chris48s added service-badge New or updated service badge squash when passing labels May 8, 2022
@repo-ranger repo-ranger bot merged commit 3e2c9b2 into badges:master May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge New or updated service badge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add [PUB] popularity badge
3 participants