Skip to content
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

Add support for tracking commits pushed to branch (Forked) #602

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rajku-dev
Copy link
Contributor

Fixes #373
2nd Part of #601

Copy link

netlify bot commented Jan 10, 2025

👷 Deploy request for leaderboard-develop pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 4e24cfe

@rajku-dev
Copy link
Contributor Author

rajku-dev commented Jan 10, 2025

One possible approach is

For each forked repo -

  • First get all PRs associated with that repo,
  • finally, get the commits of pr.merged_at(for closed) prs and open prs

This way we narrow down our hunt to just the commits that were merged or open in a PR, commits pushed to any branch that were not associated with any PR and the PR that were closed with unmerged commits will be ignored.

This can reduce time complexity to some extend, @rithviknishad

@rajku-dev
Copy link
Contributor Author

rajku-dev commented Jan 12, 2025

In the implemented approach, following algo is followed

  1. Fetch all members of organization
  2. Fetch all repos of organization
  3. Fetch all open PRs of each repository
  4. Filter the PRs whose author is not a member & not blacklisted
  5. Fetch all commits (excluding merge commit) through REST API
  6. Add the user

I ran the scrapers, and they ran perfectly fine.
Used a combination of GraphQL and REST to optimize the rate limits, i.e., 5000 points/hour for GraphQL and 5000 requests/hour for REST.

@rithviknishad if these changes are applicable or need any changes please let me know
I will move ahead with implementing the types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for tracking commits pushed directly to branch
1 participant