-
Notifications
You must be signed in to change notification settings - Fork 151
Description
Bug Report
Description
The current implementation for fetching repository data incorrectly sources statistics (like stars, forks, and contributors) from a user's personal fork rather than the original upstream repository they contributed to.
This leads to a significant misrepresentation of a user's open-source contributions. For example, if a user forks and contributes to a project with 10k+ stars, the script currently reports the stats of their personal fork, which might have 0 stars and only 1 contributor (the user themselves).
Current Behavior
- The
fetch_all_github_reposfunction iterates through a user's repositories. - For a forked project, it takes stats like
stargazers_countandforks_countdirectly from the fork's data object. - It calls
fetch_repo_contributors(username, repo_name), using the user's ownusernameas the owner, thus fetching contributors from the fork, not the parent.

The Part Where Issue is =>
Expected Behavior
For forked repositories, the script should fetch and display the stats and contributors from the original parent repository to accurately reflect the impact and context of the user's contributions.
Proposed Solution
The logic in the fetch_all_github_repos function needs to be updated. When a repository is identified as a fork, the script should:
- Use the
repo['parent']object as the primary source for details likestargazers_count,forks_count,description, etc. - Extract the
ownerandrepo_namefrom the parent'sfull_name(repo['parent']['full_name']). - Use this parent owner and repo name when calling
fetch_repo_contributorsto get the correct list of contributors from the upstream project.
