-
-
Notifications
You must be signed in to change notification settings - Fork 23.3k
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
Stats and languages results incorrect due to graphql 100 records limit #1852
Comments
For the language card, a PR is already open to solve this #1178. For the stats card, there not yet exists a pull request. This is, however, less important since only people with more than 100 repositories with stars are affected. |
Why it is less important? Although people with more than 100 repositories with stars are less. |
@Luminous-Coder Thanks for your question. What I meant is that it is probably affecting fewer people. Since the GraphQL call we make returns the repositories listed from most starred to least starred, a user must have 100 repositories with many stars for to score to be significantly affected. I hope that clears things up. Nevertheless, we should solve both cases. 👍🏻 |
Hi @rickstaa, is it ok if I work on this for the stats card? |
@MatteoPierro of course! That would be amazing. An example of how this can be done using pagination can be found here. I think for the stats card, to be resource efficient, I think we can stop the pagination when the GraphQL API does not return repositories that have any stars. |
@rickstaa Can I work on fixing the |
@MatteoPierro, yea no problem. That would be great! 🚀 The pull request was created a long time ago, and I just reviewed it last week. The best thing to do is to work on this pull request so that @tc-imba gets co-authored. I think that #1178 should also be good if the syntax and tests are improved (see #1178 (comment)). |
ok. how can I work on @tc-imba PR in co-authored mode? |
The easiest way is to let git handle the co-authoring. This can be done as follows:
Let me know if you run into any problems. |
Alright, probably I made it. #2111 |
Just a heads-up, I filled a feature request to make the total stars a specific user has received on his/her repositories available under the user object of the GraphQL API. Adding this feature would also enable #2111 on the public instance.community/community#35677. Please add your support there. |
Hi! I'm experiencing the same issue too! This is the link of my stats card: It's inconsistent |
@milkshakegum Thanks for your report. Merging:
Will fix the issues you experience. You can already use these on your own fork. They are not yet merged into the master because we have to ensure the GraphQL and Vercel limits are not hit. We will likely implement this as an opt-in for Vercel instance and Github Action users (see #2179 and #2159). |
This pull request adds experimental Organization support. Users can include stats from Organization repositories to which they are collaborators using the `include_orgs` card argument. Please be aware that because of #1852, only the first 100 repositories are used. Including organization, stats might therefore skew your results. Co-authored-by: Raymond Nook <59678453+developStorm@users.noreply.github.com>
This pull request adds experimental Organization support. Users can include stats from Organization repositories to which they are collaborators using the `include_orgs` card argument. Please be aware that because of #1852, only the first 100 repositories are used. Including organization, stats might therefore skew your results. Co-authored-by: Raymond Nook <59678453+developStorm@users.noreply.github.com>
This pull request adds experimental Organization support. Users can include stats from Organization repositories to which they are collaborators using the `include_orgs` card argument. Please be aware that because of #1852, only the first 100 repositories are used. Including organization, stats might therefore skew your results. Co-authored-by: Raymond Nook <59678453+developStorm@users.noreply.github.com>
This pull request adds experimental Organization support. Users can include stats from Organization repositories to which they are collaborators using the `include_orgs` card argument. Please be aware that because of #1852, only the first 100 repositories are used. Including organization, stats might therefore skew your results. Co-authored-by: Raymond Nook <59678453+developStorm@users.noreply.github.com>
Describe the bug
The current language and stats card results are incorrect for users with more than 100 repositories (see https://docs.github.com/en/graphql/overview/resource-limitations). This is because we are currently only fetching the first 100 repositories of a user account.
github-readme-stats/src/fetchers/stats-fetcher.js
Line 47 in a68abbb
github-readme-stats/src/fetchers/top-languages-fetcher.js
Line 17 in a68abbb
Because of this not all languages and stars of a user are represented.
Expected behaviour
I think we can use pagination options (i.e.
cursor
,after
,endCursor
objects) to loop through all repositories of a user account (see https://stackoverflow.com/a/70039506/8135687). @anuraghazra Let me know what you think.TODOs
The text was updated successfully, but these errors were encountered: