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

fix(stats-fetcher): user's overall commits #1691

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rongronggg9
Copy link
Contributor

@Rongronggg9 Rongronggg9 commented Apr 2, 2022

  1. precise overall public commits (formerly exaggerated or decreased)
  2. precise overall private commits (formerly only the recent year)
    1+2. precise overall commits including private commits
current my fork
torvalds_curr torvalds_my
tiwai_curr tiwai_my
jhedberg_curr jhedberg_my
Icenowy_curr Icenowy_my

context: #564 (comment)
The search API is entirely unreliable and we should never use it. Though using such a traversal could potentially cause rate limits, we should still get rid of using the search API. Why? Almost all Linux kernel contributors could never use this project as you have already seen above. It is absolutely unacceptable, isn't it? If we need to avoid being rate limited, we should consider using a database to cache users' commits in the past years.

Even I and @anuraghazra are affected:

current my fork
Rongronggg9_curr Rongronggg9_my
anuraghazra_curr anuraghazra_my

If you want to check if you are affected, my deployment is https://github-readme-stats-rongronggg9.vercel.app/api

Close #518
Close #564
Close #1061
Close #1234
Close #1515

May influence #1260, #1455

@vercel
Copy link

vercel bot commented Apr 2, 2022

@Rongronggg9 is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@ofek
Copy link

ofek commented Jun 3, 2022

@anuraghazra Does this look alright to merge now?

return 0;
return {
totalPublicCommits: 0,
totalPrivateCommits: 0,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can also return a success boolean and use it in

res.setHeader("Cache-Control", `public, max-age=${cacheSeconds}`);

To set the header?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I choose to throw an error if any error occurs, just like what fetchStats() and totalStarsFetcher() do.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! For your case, that is the best option since your using the GraphQL API!

@chrisK824
Copy link

Shouldn't this be marked as bug and get a higher priority for merge?

@rickstaa rickstaa added bug Something isn't working. and removed enhancement New feature or request. labels Mar 27, 2023
@rickstaa
Copy link
Collaborator

Shouldn't this be marked as bug and get a higher priority for merge?

Although this PR is correct and makes the stats' card more correct, it will break the Public Vercel instance since it costs a lot more GraphQL points (see https://docs.github.com/en/graphql/overview/resource-limitations and #1471). We therefore cannot merge this PR into the main branch. This feature will likely be included in the new GitHub action when it is released (see #2179).

@mathbunnyru
Copy link

@Rongronggg9 @rickstaa may I ask you to fix conflicts here? I would really like to merge this PR to my fork master branch.

@Rongronggg9
Copy link
Contributor Author

I've rebased the PR. However, due to #2100 which introduced mistaken GraphQL objects in the test suite, it cannot pass the tests. I will open another PR to fix this before I can force-push the rebased commits.

@rickstaa
Copy link
Collaborator

rickstaa commented May 6, 2023

I've rebased the PR. However, due to #2100 which introduced mistaken GraphQL objects in the test suite, it cannot pass the tests. I will open another PR to fix this before I can force-push the rebased commits.

Well spotted. I merged your PR 👍🏻 !

1. precise overall public commits (formerly exaggerated)
2. precise overall private commits (formerly only the recent year)
1+2. precise overall commits including private commits
@Rongronggg9 Rongronggg9 force-pushed the fix/total-commits branch from 9f26454 to 248be7c Compare May 6, 2023 15:21
@Rongronggg9
Copy link
Contributor Author

Rongronggg9 commented May 6, 2023

I've squashed and rebased the PR @mathbunnyru

@mathbunnyru
Copy link

Thanks @Rongronggg9 ❤️

@codecov
Copy link

codecov bot commented May 6, 2023

Codecov Report

Patch coverage: 91.04% and project coverage change: +0.06 🎉

Comparison is base (688f4e4) 97.35% compared to head (248be7c) 97.41%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1691      +/-   ##
==========================================
+ Coverage   97.35%   97.41%   +0.06%     
==========================================
  Files          24       24              
  Lines        4310     4341      +31     
  Branches      393      394       +1     
==========================================
+ Hits         4196     4229      +33     
+ Misses        112      110       -2     
  Partials        2        2              
Impacted Files Coverage Δ
src/fetchers/stats-fetcher.js 94.46% <91.04%> (+1.34%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
5 participants