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

include_all_commits=true shows incorrect amount of commits and Total Commits 2023 is equal to Total Commits #2726

Closed
MitkoVtori opened this issue May 14, 2023 · 2 comments
Labels
bug Something isn't working. upstream Problems caused by upstream issues.

Comments

@MitkoVtori
Copy link

MitkoVtori commented May 14, 2023

My Total Commits are 1.9K

If I use include_all_commits=true, they become 1.6K, but when I remove it, it says Total Commits (2023): 1.9k(which is my total commits for all years).

Screenshot 2023-05-14 134310
Screenshot 2023-05-14 134355

@MitkoVtori MitkoVtori added the bug Something isn't working. label May 14, 2023
@rickstaa
Copy link
Collaborator

@MitkoVtori This is because with the include_all_commits flag it uses the search function of the Rest API, which is known to be inaccurate. You can test this out by using the following syntax in the GraphQL explorer:

query userInfo($login: String!) {
  user(login: $login) {
    name
    login
    contributionsCollection {
      totalCommitContributions
      restrictedContributionsCount
    }
  }
}
{"login": "MitkoVtori"}

and then the check the following REST request:

https://api.github.com/search/commits?q=author:MitkoVtori

Graphql gives: 1881
The REST API gives: 1568

The Rest API is used because fetching all commits through the GraphQL API is too expensive on the public instance and will cause the rate limits to be reached. I created a feature request with GitHub to improve this (see https://github.com/orgs/community/discussions/35675). Please add your support to that feature request if you want to see the situation improved.

We might be able to improve this behaviour by merging #1691 and making that behaviour available under an environmental variable. We can then enable it through this variable under the Vercel instances that are deployed by users or the experimental GRS GitHub action.

@rickstaa rickstaa added the upstream Problems caused by upstream issues. label May 15, 2023
@MitkoVtori
Copy link
Author

@rickstaa Thank you for the support. I hope GitHub accepts your feature request. Until this happens, I can proceed using the Total Commits (2023), even though they're incorrect because it shows my total :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. upstream Problems caused by upstream issues.
Projects
None yet
Development

No branches or pull requests

2 participants