Skip to content

feat: add PR review metrics — reviews given vs received (#253)#586

Open
mallya-m wants to merge 2 commits into
Priyanshu-byte-coder:mainfrom
mallya-m:feat/pr-review-metrics-253
Open

feat: add PR review metrics — reviews given vs received (#253)#586
mallya-m wants to merge 2 commits into
Priyanshu-byte-coder:mainfrom
mallya-m:feat/pr-review-metrics-253

Conversation

@mallya-m
Copy link
Copy Markdown
Contributor

@mallya-m mallya-m commented May 21, 2026

Summary

Adds a "Reviews Given" tab to the existing PR Analytics card so users can see their code review contributions alongside their authored PRs.

Closes #253

Type of Change

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

Changes Made

  • Added fetchReviewMetrics() in route.ts using GitHub GraphQL pullRequestReviewContributions
  • Extended GET handler to return review data for single, combined, and per-account modes
  • Added tab switcher (PRs Authored / Reviews Given) to PRMetrics.tsx
  • New Reviews Given tab shows: total reviews, approval rate, most reviewed repos (top 5)

How to Test

  1. Run npm run dev
  2. Open http://localhost:3000
  3. Go to the PR Analytics card
  4. Click the "Reviews Given" tab
  5. Verify total reviews, approval rate, and top repos are displayed
  6. Click "PRs Authored" tab — verify existing stats still work

Screenshots

Screenshot 2026-05-21 201458

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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

@mallya-m 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:feature GSSoC type bonus: new feature labels May 21, 2026
@github-actions
Copy link
Copy Markdown

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

@mallya-m
Copy link
Copy Markdown
Contributor Author

Hi @Priyanshu-byte-coder!

The implementation for #253 is ready for review.

Here's a quick summary of what's been added:

  • fetchReviewMetrics() via GitHub GraphQL pullRequestReviewContributions
  • Extended the existing /api/metrics/prs route to include review data
  • New Reviews Given tab in the PR Analytics card showing total reviews, approval rate, and most reviewed repos (top 5)
  • Graceful fallback when no reviews are found

Could you please add the following labels?

  • level:intermediate
  • gssoc:approved
  • quality:clean
  • type:feature

Happy to make any changes based on your feedback. Thanks!

@Priyanshu-byte-coder Priyanshu-byte-coder added the level:intermediate GSSoC: Intermediate difficulty (35 pts) label May 21, 2026
Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

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

Two issues:

  1. Wrong file pathsrc/types/src/types/css.d.ts has a double src/types/src/types in the path. This should be src/types/css.d.ts.

  2. Missing EOF newlines on both src/types/src/types/css.d.ts and at least one other file.

mallya-m added 2 commits May 22, 2026 01:26
- Add fetchReviewMetrics() using GitHub GraphQL contributionsCollection
- Extend GET route to return reviews alongside PR stats
- Add Reviews Given tab to PRMetrics component
- Show total reviews, approval rate, and top reviewed repos
@mallya-m mallya-m force-pushed the feat/pr-review-metrics-253 branch from 9076ec5 to 1a7440e Compare May 21, 2026 19:58
@mallya-m
Copy link
Copy Markdown
Contributor Author

@Priyanshu-byte-coder fixed both issues:

  1. Removed incorrectly nested path — css.d.ts is now correctly at src/types/css.d.ts
  2. Added EOF newlines to all modified files

Ready for merge!

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

Labels

gssoc26 GSSoC 2026 contribution level:intermediate GSSoC: Intermediate difficulty (35 pts) type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add GitHub pull request review metrics — reviews given vs received

2 participants