Merged PR role count can double-count when the current PR is outside the first search page
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đá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
- 76/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, typescript
Hướng nghiên cứu
Tìm countMergedPrs và onPullRequest, sau đó đọc các bài kiểm thử hiện có cho kết quả tìm kiếm và trường hợp exceptUrl. Tái hiện sự cố với total_count: 101 và 100 mục không có PR hiện tại; đảm bảo số lượng trước đó loại trừ PR này ngay cả khi nó không xuất hiện trên trang đầu tiên. Hoàn tất khi webhook đánh giá ngưỡng vai trò bằng số lượng chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug
countMergedPrs requests only the first 100 GitHub search results, then uses total_count for the full result set. When called from the merged-PR webhook with exceptUrl, it subtracts one only if the current PR is present in those first 100 items.
For a linked contributor with more than 100 merged PRs, GitHub can include the just-merged PR in total_count but omit it from the first page. In that case countMergedPrs(..., pr.html_url) returns a count that already includes the current PR. onPullRequest then adds one again (earlier + 1), which can grant a contributor role one merge earlier than its configured threshold.
Reproduction
- Mock a GitHub search response with
total_count: 101and 100 items that do not include the current PR URL. - Call
countMergedPrswithexceptUrlset to that current PR URL. - The function returns 101 instead of 100 because it cannot tell whether the omitted 101st result is the current PR.
- The webhook adds one and evaluates role tiers using 102.
Expected behavior
The webhook's earlier-PR count should exclude the current PR even when it is not on the first search page, so role thresholds are evaluated against an accurate count.
- Ngôn ngữ chính
- TypeScript
- Star
- 0
- Fork
- 1
- Merge trung bình
- 2 giờ 38 phút
- Pull request đã merge (30 ngày)
- 73
Chuẩn bị môi trường
- Không có Dockerfile hay 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 codercops/discord-bot
-
`/leaderboard`, the page and the share image say "be the first" for a program that hasn't startedĐang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
codercops/discord-bot#152 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Keep the slash command list in one module, and test that `/help` and the registered commands matchĐang mởhelp wanted testing
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
codercops/discord-bot#154 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
codercops/discord-bot#153 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Contributing to discord-bot: start hereCó thể làm lại được @sank8-2 đã nhận 21 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 15/100
codercops/discord-bot#15 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của codercops/discord-bot
Issue tương tự
-
Out of order / duplicate key error shows the key bytes as decimal or UTF-8, not hexCó thể đã có người làm @bardrop đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
-
bug i18n
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
endora-commerce/endora-commerce#1315 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Two stored artist rows are not act names: "DJS" from a Renate floor heading and "Stevie Cox -"Đang mởarea:data-quality importer size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
enorm-labs/event-junkie#5136 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(scripts): set-device-owner.ps1 fails to parse on Windows PowerShell 5.1 (UTF-8 without BOM)Đang mở
Độ khó 1/5 Dưới một 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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
WenyuChiou/agent-board#1518 ·
Maintainer thường phản hồi trong vòng 1 ngày