Get commits from organizations
ruslan suggests to get all user commits from orgs via listUserOrgs(user).forEach { org -> org.repos.forEach { repo -> repo.statictics } }
this will potentially result in thousands of requests, depending on what kind of orgs user is a member of
maybe request limit can be increased if user auths? maybe there is a better way?
To the people who want this: Would you be okay with authorizing the app to let it make requests with your token? I can't think of any way to do this with my own token that won't instantly trigger the rate-limit.
Shall we not first list user organizations and find commits to each orgs ? https://developer.github.com/v3/orgs/#list-user-organizations https://developer.github.com/v3/repos/commits/
This may work.
@mithlesh4257 Writing the code for it isn't really a problem, but let's say I'm a member of google, which has 1148 repos. I picked ten repos at random and got an average of 800 commits (I have no idea if this number is correct, but let's assume it is for now).
The max page size for the API is 100, which gives us 1140/100 * 800/100 = 12 * 80 = 960 requests. These requests come on top of the normal user requests, and only account for 1 organization. I'm already approaching the rate-limit every hour, and several people who work for google, microsoft, and other huge organizations have been using the tool.
I suppose we could run a batch-job for organizations to cache the relevant information. It would mean slightly outdated info, but that's probably okay. It's a bit of work though.
It seems that it's possible to use the event-api to achieve this:
val repoCommits2 = GhService.getUserEvents(username).filter { event -> event.type == Event.TYPE_PUSH }.map {
it.repo to (it.payload as PushPayload).commits
}.toMap()
Using the App approach to increase API limits is good, better than the stargaze method
The event API is basically useless:
Events support pagination, however the per_page option is unsupported. The fixed page size is 30 items. Fetching up to ten pages is supported, for a total of 300 events - /v3/activity/events
I would definitely be okay with authenticating.
This feature would be awesome!
any news on this?
@lordadamson no, I've pretty much stopped adding new functionality to this project. If you wanna create a PR I'll merge it though.
So is getting a user personal key the way to go?
On Apr 26, 2018 16:10, David [email protected] wrote:
@lordadamsonhttps://github.com/lordadamson no, I've pretty much stopped adding new functionality to this project. If you wanna create a PR I'll merge it though.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/tipsy/profile-summary-for-github/issues/16#issuecomment-384654836, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AF6HdCwbRrL3BURaZggT__Pxn9Mfg6DRks5tsdVPgaJpZM4RBU_y.
Probably. Traffic is pretty low on the project these days, so I think it would also be okay to try without, then if the number of requests falls under a certain limit require auth.
Use case: I have so many repos that I have created organizations for my own projects per language:
- https://github.com/dolmen
- https://github.com/dolmen-go
- https://github.com/dolmen-perl
So I would like to be able to see https://profile-summary-for-github.com/user/dolmen-go
Note that Commit per quarter doesn't work for an organization: only zeroes.
I don't have the time to work on this project at the moment, but pull requests are welcome @dolmen !