Skip to content

feat: Add Pull Request Review Intelligence & Bottleneck Analytics System (#468)#469

Open
surjeetkumar8006 wants to merge 3 commits into
GitMetricsLab:mainfrom
surjeetkumar8006:feature/pr-review-analytics
Open

feat: Add Pull Request Review Intelligence & Bottleneck Analytics System (#468)#469
surjeetkumar8006 wants to merge 3 commits into
GitMetricsLab:mainfrom
surjeetkumar8006:feature/pr-review-analytics

Conversation

@surjeetkumar8006
Copy link
Copy Markdown
Contributor

@surjeetkumar8006 surjeetkumar8006 commented May 24, 2026

Description

This pull request implements the Pull Request Review Intelligence & Bottleneck Analytics System requested in #468. It introduces a comprehensive review intelligence suite that tracks repository pull requests and review latency to identify reviewer capacity, workload distribution, and delay issues.

Closes #468


Key Features Implemented

  1. Analytical Dashboard (PRAnalytics.tsx):

    • Computes time to first review, review completion duration, average merge turnaround time, and stalled pull request metrics.
    • Calculates a repository health index from 0 to 100 based on review coverage and latency thresholds.
    • Highlights capacity bottlenecks such as overloaded reviewers and delayed PRs waiting for reviews for over 48 hours.
  2. Visualizations:

    • Recharts-powered pie charts for workload distribution across reviewers.
    • Bar charts illustrating response time trends.
    • Detailed logs representing each Pull Request's lifecycle metrics.
  3. Routing & Navigation:

    • Mapped /pr-analytics to the new dashboard in Router.tsx.
    • Linked "PR Analytics" in both mobile and desktop menus in Navbar.tsx.
    • Added a feature card on the homepage in Features.tsx.

Verification & Git Pushing

  • Switched to the new branch: feature/pr-review-analytics.
  • Ran TypeScript typecheck and built the production bundles successfully.
  • Pushed the branch to the repository.

Summary by CodeRabbit

Release Notes

New Features

  • Introduced PR Analytics feature — analyze your GitHub repositories with insights including PR review turnaround metrics, reviewer workload distribution, repository health scoring, and detailed PR lifecycle tracking
  • Added PR Analytics link to main navigation menu for convenient access

@netlify
Copy link
Copy Markdown

netlify Bot commented May 24, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit baedabd
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a1bb6954f408c00081b1fe0
😎 Deploy Preview https://deploy-preview-469--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a comprehensive PR analytics feature to the GitHub Tracker application. It introduces a new /pr-analytics route, updates navigation menus, advertises the feature in the landing page, and implements a full analytics page that fetches PR data, computes review metrics, and visualizes reviewer workload and repository health.

Changes

PR Analytics Feature

Layer / File(s) Summary
Routing, Navigation & Feature Advertisement
src/Routes/Router.tsx, src/components/Navbar.tsx, src/components/Features.tsx
Router extends to /pr-analytics route. Navbar adds desktop and mobile NavLinks to the new route. Features component advertises PR Review Intelligence with GitPullRequest icon and teal styling.
PR Analytics Page Implementation
src/pages/PRAnalytics/PRAnalytics.tsx
New page component fetches PR and review data via authenticated Octokit, computes per-PR timing metrics (time-to-first-review, completion duration, turnaround), detects stalled PRs, aggregates reviewer workload, derives repository health score, and renders metric cards, pie/bar charts, bottleneck lists, and a scrollable PR table with lifecycle state and formatted durations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • GitMetricsLab/github_tracker#440: Both PRs modify src/components/Features.tsx—the main PR adds a new "PR Review Intelligence" feature card while the retrieved PR rewrites/animates the Features section—so their changes directly overlap in the same component.
  • GitMetricsLab/github_tracker#405: Both PRs modify src/components/Features.tsx: one refactors the Features UI to a terminal-style TerminalCard rendering, while the other updates the feature list by adding a new "PR Review Intelligence" card in a specific position.
  • GitMetricsLab/github_tracker#237: Both PRs modify src/components/Navbar.tsx to change the navigation link set/behavior—the main PR adds a /pr-analytics "PR Analytics" link, while the retrieved PR refactors the navbar using NavLink and updates mobile/desktop menu links.

Suggested labels

type:feature, level:advanced, quality:clean

Poem

🐰 A new route springs forth with metrics in tow,
Reviewers revealed in a dashboard's soft glow,
Workload and health scores now help us all see,
Where collaboration flows smooth as can be! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a PR Review Intelligence & Bottleneck Analytics System.
Description check ✅ Passed The description follows the template with all required sections completed, including related issue, comprehensive feature details, and verification steps.
Linked Issues check ✅ Passed The PR fully implements all coding requirements from #468: PR lifecycle metrics tracking, reviewer workload analytics, bottleneck detection, health scoring, and visualizations.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the PR Review Intelligence system; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@surjeetkumar8006
Copy link
Copy Markdown
Contributor Author

Hi maintainers, the PR has been updated successfully and all checks are now passing. The implementation includes the complete PR Review Intelligence & Bottleneck Analytics System requested in #468, along with analytics visualizations, repository health insights, and review workflow tracking.

Kindly review and merge the PR when convenient. Thank you!

@mehul-m-prajapati
Copy link
Copy Markdown
Collaborator

home page is broken

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pages/PRAnalytics/PRAnalytics.tsx`:
- Around line 148-155: The stalled-PR logic (isStalled) is too narrow: instead
of only checking submittedReviews, compute a lastActivity timestamp that
considers submittedReviews, issue comments, and review comments (e.g., use
submittedReviews, comments, reviewComments arrays) and use now - lastActivity >
7 days as the inactivity criterion; then keep the existing openDuration > 14
days and pr.state === "open" checks but replace the submittedReviews-based check
with the unified lastActivity check so PRs with recent discussion or review
comments aren't incorrectly marked stalled.
- Line 157: The code currently de-duplicates reviewer logins with Array.from(new
Set(...)) (see the reviewers constant derived from reviews.map in
PRAnalytics.tsx), which counts each reviewer once per PR; change this to
aggregate review events instead by removing the Set and keeping each review
event (e.g., const reviewers = reviews.map(r => r.user?.login).filter(Boolean)
as string[]), and update any other identical deduplication sites that use
Array.from(new Set(...)) (the other occurrences of the same pattern) so the
workload chart and overload detection consume review event counts rather than
unique reviewers-per-PR.
- Around line 317-324: trendData currently calls slice(-10) on prDetailsList
without guaranteeing it's ordered by recency; sort prDetailsList by a reliable
timestamp (e.g., pr.mergedAt or fallback to pr.createdAt/updatedAt) in
descending order before filtering/mapping so the last 10 truly represent the
most recent PRs. Update the pipeline around trendData to perform a sort step
(comparing new Date(pr.mergedAt || pr.createdAt || pr.updatedAt)) then filter by
timeToFirstReview and take the first 10 entries for mapping to prNumber,
firstReviewHrs, and turnaroundDays.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8112401d-900c-47e6-957e-37d89cb7ac44

📥 Commits

Reviewing files that changed from the base of the PR and between e7b8fc8 and baedabd.

📒 Files selected for processing (4)
  • src/Routes/Router.tsx
  • src/components/Features.tsx
  • src/components/Navbar.tsx
  • src/pages/PRAnalytics/PRAnalytics.tsx

Comment thread src/pages/PRAnalytics/PRAnalytics.tsx
Comment thread src/pages/PRAnalytics/PRAnalytics.tsx
Comment thread src/pages/PRAnalytics/PRAnalytics.tsx
@surjeetkumar8006
Copy link
Copy Markdown
Contributor Author

Hi @mehul-m-prajapati,

The issue has been fixed and all checks are passing now. Could you please review and merge the PR if everything looks good?

Thank you!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚀 Feature: Pull Request Review Intelligence & Bottleneck Analytics System

3 participants