Skip to content

feat(prs): add review time histogram buckets to /api/metrics/prs and … - #3260

Open
Nareshkumawat-star wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
Nareshkumawat-star:feature/pr-review-time-histogram
Open

feat(prs): add review time histogram buckets to /api/metrics/prs and …#3260
Nareshkumawat-star wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
Nareshkumawat-star:feature/pr-review-time-histogram

Conversation

@Nareshkumawat-star

Copy link
Copy Markdown
Contributor

Summary

Adds a PR Review Time Distribution Histogram to PRMetrics.tsx and extends /api/metrics/prs/route.ts to return review turnaround time buckets (<1h, 1–4h, 4–24h, 1–3d, 3–7d, 7d+). This replaces reliance on a single average review time with a color-coded distribution chart.

Closes #3245


Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📝 Documentation update
  • ♻️ Refactor / code cleanup (no functional change)
  • ⚡ Performance improvement
  • 🔒 Security fix
  • 🧪 Tests only

What Changed

  • src/app/api/metrics/prs/route.ts:
    • Computed PR review durations and categorized them into 6 standardized time buckets (<1h, 1–4h, 4–24h, 1–3d, 3–7d, 7d+).
    • Added support for single account, GitLab, and combined account aggregation.
  • src/components/PRMetrics.tsx:
    • Added Recharts BarChart histogram displaying review time buckets with custom tooltips ("X PRs reviewed within this range").
    • Applied color coding: Emerald (fast), Amber (moderate), Red (slow).

How to Test

  1. Navigate to the DevTrack dashboard and scroll to PR Analytics.
  2. Verify that the Review Time Distribution histogram renders below the stat cards and donut chart.
  3. Hover over histogram bars to inspect turnaround count tooltips.
  4. Toggle time ranges (7d, 30d, 90d) and verify that histogram bucket counts update dynamically.

Checklist

  • Self-reviewed my own diff
  • No unnecessary console.log or debug code
  • Responsive layout & color legend verified
  • Single average skew issue addressed via histogram distribution

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature labels Jul 28, 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

@github-actions github-actions Bot added type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:performance GSSoC type bonus: performance (+15 pts) labels Jul 28, 2026
@Nareshkumawat-star

Copy link
Copy Markdown
Contributor Author

Hi @Priyanshu-byte-coder kindly review and merge it

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

Labels

gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add PR review time histogram — distribution of review durations across all PRs

1 participant