Skip to content

fix: prevent CI analytics GitHub quota amplification#5225

Merged
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
Krishnx21:fix/5224-ci-analytics-quota-amplification
Jun 12, 2026
Merged

fix: prevent CI analytics GitHub quota amplification#5225
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
Krishnx21:fix/5224-ci-analytics-quota-amplification

Conversation

@Krishnx21

Copy link
Copy Markdown
Contributor

Summary

  • add a fixed-bucket rate limit to the CI analytics endpoint so rotating usernames cannot obtain fresh buckets
  • validate and normalize GitHub usernames before starting analytics work
  • bound repository, workflow, and run pagination/fan-out to protect shared GitHub API quotas
  • add route and service security regression tests

Verification

  • npm run test -- app/api/ci-analytics services/github middleware.test.ts lib/rate-limit.test.ts (52 files, 293 tests passed)
  • npm run typecheck
  • focused ESLint
  • git diff --check
  • npm run build attempted; blocked by an existing Windows/OneDrive EPERM lock on .next/diagnostics

Fixes #5224

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@Krishnx21 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b4d4f351d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/api/ci-analytics/route.ts
Comment thread app/api/ci-analytics/route.ts

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good work on this one. I reviewed the diff and it looks ready to go from my side.

Everything looks good. Approving this now.

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jun 12, 2026
@JhaSourav07 JhaSourav07 merged commit ec6e306 into JhaSourav07:main Jun 12, 2026
5 of 6 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Congratulations @Krishnx21! Your PR has been successfully merged. 🚀

Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jun 12, 2026
@Aamod-Dev Aamod-Dev added mentor:Aamod007 level:intermediate Moderate complexity tasks quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected type:devops CI/CD pipelines, workflows, dev scripts, and config and removed type:devops CI/CD pipelines, workflows, dev scripts, and config labels Jun 12, 2026
@Aamod-Dev

Copy link
Copy Markdown
Collaborator

Review Summary
Removed extra type labels ( ype:devops) to strictly meet the rule of exactly one type label ( ype:bug retained).

@JhaSourav07 JhaSourav07 added gssoc:approved PR has been reviewed and accepted for valid contribution points and removed gssoc:approved PR has been reviewed and accepted for valid contribution points labels Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved PR has been reviewed and accepted for valid contribution points level:intermediate Moderate complexity tasks mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Unrate-limited CI analytics requests can amplify into GitHub API quota exhaustion

3 participants