Skip to content

docs: add inline comments explaining GitHub API rate limiting#1877

Merged
Priyanshu-byte-coder merged 3 commits into
Priyanshu-byte-coder:mainfrom
sudha09-git:docs/add-rate-limit-comments-93
Jun 3, 2026
Merged

docs: add inline comments explaining GitHub API rate limiting#1877
Priyanshu-byte-coder merged 3 commits into
Priyanshu-byte-coder:mainfrom
sudha09-git:docs/add-rate-limit-comments-93

Conversation

@sudha09-git
Copy link
Copy Markdown
Contributor


Summary

Added inline comments to src/app/api/metrics/contributions/route.ts explaining how GitHub API rate limiting works, how it is detected, and what the user sees when limited.

Closes #93


Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup

Changes Made

  • Added top-level comment block explaining the two rate limit tiers (60 req/hr unauthenticated, 5,000 req/hr authenticated)
  • Documented how the OAuth token / PAT in the Authorization header activates the higher limit
  • Expanded the existing while loop comment to clarify HTTP 403 vs 429 and the X-RateLimit-Remaining: 0 header
  • Added comment above the fetch call explaining why the Authorization header matters for rate limits
  • Clarified the partial-results strategy — returning collected data on rate limit instead of failing the whole request
  • Documented what the user sees when rate limited ("GitHub API error" in the dashboard)

How to Test

  1. Open src/app/api/metrics/contributions/route.ts
  2. Verify the top-level rate limit comment block appears before export const dynamic
  3. Verify the while loop comment explains 403, 429, and X-RateLimit-Remaining
  4. Verify the fetch call has an inline comment about the Authorization header
  5. Confirm no logic was changed — only comments were added


Checklist

  • Linked issue in summary
  • npm run lint passes locally
  • No TypeScript errors (npm run type-check)
  • Self-reviewed the diff
  • Added/updated tests if applicable

Accessibility Checklist

  • Proper keyboard navigation tested
  • Responsive UI verified
  • Accessibility labels added where needed

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

@sudha09-git is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:docs GSSoC type bonus: documentation (+5 pts) type:feature GSSoC type bonus: new feature labels Jun 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@sudha09-git sudha09-git force-pushed the docs/add-rate-limit-comments-93 branch 3 times, most recently from 21e5662 to 24886f4 Compare June 2, 2026 19:07
@sudha09-git sudha09-git force-pushed the docs/add-rate-limit-comments-93 branch from 24886f4 to dad4934 Compare June 2, 2026 19:27
@sudha09-git
Copy link
Copy Markdown
Contributor Author

Hi @Priyanshu-byte-coder

All 9 CI checks are now passing . This PR adds inline comments to src/app/api/metrics/contributions/route.ts explaining the GitHub API rate limiting behavior (60 req/hr unauthenticated vs 5,000 req/hr with Authorization header).

Would love to get your review when you get a chance. Thanks!

@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level:beginner GSSoC: Beginner difficulty (20 pts) quality:clean GSSoC: Clean quality multiplier (×1.2) labels Jun 3, 2026
@Priyanshu-byte-coder Priyanshu-byte-coder merged commit 9d77516 into Priyanshu-byte-coder:main Jun 3, 2026
10 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

🎉 Merged! Thanks for contributing to DevTrack.

If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers.

Keep an eye on open issues for your next contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level:beginner GSSoC: Beginner difficulty (20 pts) quality:clean GSSoC: Clean quality multiplier (×1.2) type:docs GSSoC type bonus: documentation (+5 pts) type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] GitHub API rate limit handling — show user-visible feedback when rate limited

2 participants