feat: add maintainer day-over-day stat deltas#522
Conversation
|
@GhanshyamJha05 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. |
Ayush-Patel-56
left a comment
There was a problem hiding this comment.
line 207 in analytics.ts - query now fetches every PR ever ingested (removed the date filter). add .gte('github_created_at', yesterdayStart.toISOString()) to limit to 2 days. also dropping mentor_verified = true changes which PRs count toward avg review time - intentional? and line 237 - call buildDayOverDayStats directly instead of buildMaintainerAnalyticsTrends with empty arrays
|
Ok will do shortly |
| .select('github_created_at, mentor_review_at') | ||
| .select('github_created_at, merged_at, mentor_review_at') | ||
| .in('repo_full_name', repos) | ||
| .eq('mentor_verified', true) |
There was a problem hiding this comment.
this filter means openedPrs and mergedPrs will only count already-verified PRs - nearly always 0, since PRs aren't verified at open time. need a second query without this filter for the opened/merged counts, keeping mentor_verified = true only for the review-time calculation.
There was a problem hiding this comment.
should i remove the merged for true check or add another similar block without check
There was a problem hiding this comment.
add a second query without the filter for opened/merged counts. keep the existing query (with mentor_verified = true) only for calculating review time. removing the filter entirely would break the review-time calculation.
| const yesterdayStart = new Date(); | ||
| yesterdayStart.setDate(yesterdayStart.getDate() - 1); |
There was a problem hiding this comment.
setDate uses local server time but buildDayOverDayStats uses UTC day boundaries - they can disagree near UTC midnight. use Date.UTC(...) instead to match.
There was a problem hiding this comment.
ahh i see the dates are conflicting for the time zone ..
Summary
Adds day-over-day delta indicators to the maintainer dashboard stat tiles so maintainers can quickly compare today’s activity against yesterday’s values.
Type of Change
Related Issue
Closes #450
What was changed?
Screenshots
Not added. UI change is limited to maintainer dashboard stat tiles.
Checklist
npm run dev)