-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[GitHubGistStars] add GitHub Gist Stars #8471
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking this up. It is in pretty good shape already. Just a few minor comments.
stargazerCount: Joi.number(), | ||
url: Joi.string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stargazerCount: Joi.number(), | |
url: Joi.string(), | |
stargazerCount: Joi.number().required(), | |
url: Joi.string().required(), |
|
||
static route = { | ||
base: 'github/stars/gists', | ||
pattern: ':gist', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the param :gistId
to match
static route = { base: 'github-gist/last-commit', pattern: ':gistId' } |
} | ||
|
||
static render({ stargazerCount, url }) { | ||
return { message: metric(stargazerCount), link: [url] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the repo stars badge, we link the left side of the badge to the repo URL and the right side to /stargazers
. Can we do the same thing for the gist version too please.
shields/services/github/github-stars.service.js
Lines 48 to 51 in 8e1680d
link: [ | |
`https://github.com/${slug}`, | |
`https://github.com/${slug}/stargazers`, | |
], |
Gists also have a similar stargazers URL e.g: https://gist.github.com/maratori/47a4d00457a92aa426dbd48a18776322/stargazers
hi @chris48s , thanks for suggesting these changes. Please review the commit i just pushed. I have committed those changes and updated test cases as well and it passes the tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Thanks for working on this.
Thanks for merging my PR!🚀 |
closes #8269
added a new service class which extends
GithubAuthV4Service
. It uses Github GraphQL API to query the stargazers count for the provided gist id. also added tester file for the same service class.screen-shots of example badges generated:
https://gist.github.com/47a4d00457a92aa426dbd48a18776322
https://gist.github.com/invalid-gist-id