[BUG] Repo analytics reports one pull request when a repo has none
Maintainer thường phản hồi trong vòng 1 ngày
@Dhruvdesai793 đang làm issue này rồi.
Từ ngày 3/12/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github, nextjs, typescript
- Lĩnh vực
- analytics, backend-api-design
Hướng nghiên cứu
Read src/app/api/metrics/repo-analytics/route.ts around lines 190–206, then inspect test/repo-analytics-validation.test.ts for route test patterns. Mock a successful empty pulls response without a Link header and check the returned total. Done means prActivity.total is 0 for an empty result while existing analytics behavior remains covered.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened?
Repo analytics reports one pull request for a repository with no pull requests. The route requests one page item, checks the pagination Link header, and falls back to 1 whenever the response is successful but has no rel=last link. GitHub's empty result has no Link header, so the empty case is reported as one.
Expected: return 0 when the successful response contains no pull requests.
Source: the request and fallback set totalPrs to 1 in this case; the Repo Analytics sheet displays that value.
Steps to reproduce
- Sign in and open Repo Analytics for a repository with no pull requests.
- Inspect GET /api/metrics/repo-analytics?repo=owner/repo.
- GitHub returns an empty pull-request list with no Link header.
- The route returns prActivity.total: 1, and the sheet displays one PR instead of zero.
Where is it?
Dashboard overview
Where did you see it?
Local development
Browser and device
Not browser-specific; server-side API data.
Screenshots, console errors or logs
No screenshot or runtime log applies. This is a source-level reproduction from the successful empty-response branch; I did not make a live request to GitHub for a specific repository. I did not run tests for this report to avoid using the shared checkout while another contributor is working. Existing test/repo-analytics-validation.test.ts checks parameter validation and cache behavior, but does not assert the pull-request total for an empty result. A route regression test should mock an empty successful pulls response without a Link header and expect prActivity.total to be 0.
Want to fix it?
- I'd like to work on this. A maintainer will assign you; please don't start before that.
- Ngôn ngữ chính
- TypeScript
- Star
- 246
- Fork
- 436
- Merge trung bình
- 9 giờ 33 phút
- Pull request đã merge (30 ngày)
- 213
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Priyanshu-byte-coder/devtrack
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Priyanshu-byte-coder/devtrack#4067 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Priyanshu-byte-coder/devtrack#4066 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Webhook manager: replace the browser confirm() dialogs with ConfirmModalCó thể đã có người làm @Nandaninaulaa đã nhận 4 ngày trước. Đang mởgood first issue level 1 level:beginner status:assigned type:design
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Priyanshu-byte-coder/devtrack#3889 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Goals form: square arcade buttons for recurrence, Create goal and RefreshCó thể đã có người làm @KartikeyG-world đã nhận 4 ngày trước. Đang mởgood first issue level 1 level:beginner status:assigned type:design
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Priyanshu-byte-coder/devtrack#3877 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Goals: the error banner and the "No goals yet" hint show at the same timeCó thể đã có người làm @KartikeyG-world đã nhận 4 ngày trước. Đang mởgood first issue level 1 level:beginner status:assigned type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Priyanshu-byte-coder/devtrack#3872 · 6 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Priyanshu-byte-coder/devtrack
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
makecindy/cindy#15342 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
kwitsch/claude-code-plugin-tooling#219 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
no-repo-link tool-submission
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
BraveOPotato/NoSignups#2618 ·
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100