feat(commits): add highly optimized advanced mode for all-time stats and custom ranges via single GraphQL request#4890
Open
JessicaKei wants to merge 19 commits into
Conversation
…unt age query schema
…ar and all_commits_api parameters
…namic year query generator
…andleGraphQLErrors utility
…ustom GraphQL overrides
…ode orchestration
…o fetchStats pipeline
…veAdvancedStatsQuery
Introduced a server-side environment variable to safely disable the advanced commits API functionality if needed. Defaults to enabled.
…ecking Added getValidatedCommitsApiValue helper to validate incoming API values against allowed types. Refactored stats fetcher to use the validated commitsApi variable.
…ITS variable Updated the parameters table with commits_api and commits_end_year options. Expanded include_all_commits and commits_year descriptions, and documented the DISABLE_ADVANCED_COMMITS environment variable.
|
@JessicaKei is attempting to deploy a commit to the github readme stats Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Description
This PR introduces an
advancedmode for the commits API using GitHub's GraphQL API. Crucially, it fetches the entire all-time commit history or custom year ranges efficiently in a SINGLE, highly optimized GraphQL request. Unlike previous community attempts, it completely avoids any loop-based request spamming or pagination overhead, bypassing the limitations of the default REST/Search implementation with minimal performance impact.🛑 Zero Impact on Existing Logic (Non-breaking Extension)
commits_api=advancedin their query parameters.🛠️ Features Added:
commits_api=advanced.include_all_commits=trueis provided.commits_yearandcommits_end_year.🛡️ Server-Side Safety (Feature Toggle)
To eliminate any performance or rate-limiting concerns on the public production deployment, I have introduced a feature toggle:
DISABLE_ADVANCED_COMMITS=truecompletely disables this feature globally and safely falls back to the default behavior. It's a bulletproof solution for public instances while keeping the feature fully available for self-hosted deployments.🧪 Quality Assurance
README.mdwith new parameters, types, notes on case-sensitivity, fallback behaviors, and environment variables.