feat: add maintainer analytics trends#195
Open
saurabhhhcodes wants to merge 1 commit into
Open
Conversation
Contributor
|
@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. |
Contributor
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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