feat: add maintainer analytics trends#195
Conversation
|
@saurabhhhcodes is attempting to deploy a commit to the codersogs-3057's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks again for assigning #92. I kept this scoped to the maintainer analytics page and moved the aggregation into Postgres so the UI only receives compact chart data. When reviewing, could you also add the appropriate GSSoC approval / difficulty / type labels if this fits the program scoring? I included the EXPLAIN ANALYZE query in the PR body for the performance check. |
|
Synced this branch with the latest Validation after the sync:
I also retried |
Summary
/maintainerPerformance notes
The heavy aggregation is done in Postgres via
maintainer_analytics_trends(repo_names text[], as_of timestamptz default now()).EXPLAIN ANALYZEquery used for review:The query is bounded to 12 weeks for weekly PR/XP trends and 6 months for level distribution snapshots. It filters by
repo_full_name = any(repo_names)and uses existing indexed tables/columns aroundpull_requests.repo_full_name,pull_requests.state, recommendation issue joins, and profile/level-up lookups. The function returns one JSON payload, so the route avoids shipping raw event rows to React.Tests
npm run test -- src/lib/maintainer/analytics.test.tsnpm run lint -- --file 'src/app/(app)/maintainer/page.tsx' --file 'src/app/(app)/maintainer/analytics-trends.tsx' --file src/app/actions/maintainer.ts --file src/lib/maintainer/analytics.tsnpm run typechecknpm run buildpasses; existing unrelated warnings remain insrc/app/(app)/dashboard/sync-button.tsx,src/app/(app)/issues/issues-list.tsx, and metadataBase.Closes #92