feat: add gitlab mr stats to pr metrics#293
Conversation
|
@Akanksha-020 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
This PR conflicts with recently merged changes. Please rebase onto main: Resolve any conflicts, push, and I'll review. |
|
okay I will do that and get back to you |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Changes Required
1. Depends on unmerged GitLab OAuth (PR #317)
session.gitlabToken won't exist until the GitLab OAuth PR lands — and that PR itself has blocking issues. This feature silently no-ops until then. Please mark as draft or rebase after #317 merges.
2. Rebase required
Conflicts with PRs #392 and #396 which also modify prs/route.ts. Rebase after those are resolved.
3. Only 100 GitLab MRs fetched — no pagination
per_page=100 with no follow-up pages means heavy GitLab users lose data silently. Add X-Total-Pages header handling or at least document the 100-MR cap.
4. Missing withMetricsCache wrapper
Other metric routes (post PR #311) use withMetricsCache. This route hits both GitHub and GitLab on every request with no caching.
5. GitHub state === "closed" counts rejected PRs as merged
githubStats.merged++ triggers on pr.state === "closed" which includes PRs closed without merging. Use pr.pull_request?.merged_at != null to count only actually merged PRs (same fix applied in PR #396).
Summary
Brief description of what this PR does.
Closes #10
Type of Change
Changes Made
How to Test
Steps for the reviewer to verify this works:
Screenshots (if UI change)
NA
Checklist
npm run lintpasses locallynpm run type-check)