-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: add popular repos query #5
Conversation
Pull Request Test Coverage Report for Build 9963614533Details
💛 - Coveralls |
6239da5
to
e3d4c2d
Compare
repos.go
Outdated
func popularRepos(count int, orgname string) []Repo { | ||
fmt.Println("Finding popular repos...") | ||
|
||
repos := make([]Repo, count) |
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.
haha, this totally broke it last night 🙃 reverting to prev changes fixes it
4a1d02e
to
4a3f38b
Compare
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 bringing this feature.
repos.go
Outdated
} | ||
}*/ | ||
|
||
var popularReposOrgQuery struct { |
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.
var popularReposOrgQuery struct { | |
var popularOrgReposQuery struct { |
It sounds better to me, but I might be wrong
I thiiink this would be better as a method for the Org struct. More legible + organized, so that'll be the next step here it would look something like: |
fwiw my original proposal to make these functions easier to reuse between user and organization will take some refactoring, but for right now we just need it to work. Would be fun to refactor this down the line though |
You can see the results of this version in this pull request: https://github.com/charmbracelet/.github/pull/6/files#diff-0e83982cf6f4dabedcbf7b12029a56c6f4a728064ba99543fff8f227c0654b45R12-R22 |
main.go
Outdated
funcMap["recentForks"] = recentForks | ||
funcMap["recentReleases"] = recentReleases | ||
funcMap["recentRepos"] = recentRepos | ||
funcMap["orgPopularRepos"] = orgPopularRepos |
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.
This is not specific for organizations though, you should be able to use it for users as well. I would rename it to popularRepos
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.
Or userPopularRepos
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.
Ah hold on, I finally figured out how to make this work for users and orgs 🎊 I'll update the query + solution across the board here. Thanks for the nudge :)
Co-authored-by: ccoVeille <[email protected]>
c9ad3bb
to
d2fc841
Compare
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.
LGTM, great work @bashbunni !
goal: support finding the most popular projects for an organization
used here: https://github.com/charmbracelet/.github/blob/stargazing/profile/README.md & https://github.com/charmbracelet/.github/blob/stargazing/templates/README.md.tpl#L13
todos:
README
with usage example for this query