IndoGitHubers icon indicating copy to clipboard operation
IndoGitHubers copied to clipboard

[🙏] - Split Contributions into Smaller Category

Open ImBIOS opened this issue 1 year ago • 3 comments

Describe the request

in GH, contributions are counted from a lot of activity including commits, code reviews, PRs, and issue creations.

Split contributions into these minimum 4 activities for better understanding, and don't remove the contributions data because it's like the sum of those activities.

1. GitHub Commits

  • Endpoint: GET /repos/{owner}/{repo}/commits
  • Add query parameters like author={username} to filter commits by a specific user.
  • Loop through repositories to get all commits by the user.

2. Code Reviews

  • Endpoint: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews
  • Filter reviews by user and loop through pull requests to count reviews.

3. Pull Requests

  • Endpoint: GET /search/issues
  • Use a search query like type:pr author:{username}.
  • Example: https://api.github.com/search/issues?q=type:pr+author:username.

4. Issues

  • Endpoint: GET /search/issues
  • Use a search query like type:issue author:{username}.
  • Example: https://api.github.com/search/issues?q=type:issue+author:username.

Notes:

  • We'll need to loop through all repositories for detailed statistics.
  • The GitHub API has rate limits (e.g., 5,000 requests per hour for authenticated users).
  • Aggregating data for multiple repositories or organization-wide metrics may require GraphQL for efficiency.

ImBIOS avatar Dec 04 '24 04:12 ImBIOS

After thinking about it, it would be a huge changes, maybe we should split it into several more issues so it can become a "good first issue"

ImBIOS avatar Dec 04 '24 04:12 ImBIOS

The data coming from this repo: https://github.com/depapp/most-active-github-users-counter

mazipan avatar Dec 04 '24 08:12 mazipan

Since the code is written in Go, I don't think we have capability to perform any changes for now

mazipan avatar Dec 04 '24 08:12 mazipan