profile-summary-for-github icon indicating copy to clipboard operation
profile-summary-for-github copied to clipboard

Get commits from organizations

Open tipsy opened this issue 8 years ago • 15 comments

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?

tipsy avatar Dec 13 '17 23:12 tipsy

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.

tipsy avatar Dec 16 '17 01:12 tipsy

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 avatar Dec 17 '17 17:12 mithlesh4257

@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.

tipsy avatar Dec 18 '17 01:12 tipsy

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()

tipsy avatar Dec 18 '17 17:12 tipsy

Using the App approach to increase API limits is good, better than the stargaze method

matejkramny avatar Dec 18 '17 22:12 matejkramny

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

tipsy avatar Jan 01 '18 22:01 tipsy

I would definitely be okay with authenticating.

tedivm avatar Jan 05 '18 07:01 tedivm

This feature would be awesome!

aduguid avatar Jan 30 '18 23:01 aduguid

any news on this?

ghost avatar Apr 26 '18 14:04 ghost

@lordadamson no, I've pretty much stopped adding new functionality to this project. If you wanna create a PR I'll merge it though.

tipsy avatar Apr 26 '18 14:04 tipsy

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.

ghost avatar Apr 26 '18 14:04 ghost

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.

tipsy avatar Apr 26 '18 15:04 tipsy

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

dolmen avatar Aug 29 '18 12:08 dolmen

Note that Commit per quarter doesn't work for an organization: only zeroes.

dolmen avatar Aug 29 '18 12:08 dolmen

I don't have the time to work on this project at the moment, but pull requests are welcome @dolmen !

tipsy avatar Aug 29 '18 14:08 tipsy