-
Notifications
You must be signed in to change notification settings - Fork 24
Optimize issue fetching #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| it("should cap review points at 5", () => { | ||
| const mockPRs: AnalyzedPR[] = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test file appears to have multiple test definitions using it() blocks. According to the project's testing standards, each test file should contain at most one test() call, with additional tests split into separate numbered files. Consider refactoring these tests into multiple files (e.g., test-pr-scoring-1.test.ts, test-pr-scoring-2.test.ts, etc.) to align with the established testing pattern.
Spotted by Diamond (based on custom rules)
Is this helpful? React 👍 or 👎 to let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Issue Retrieval Flaw Causes Inaccurate Statistics
The getRecentIssues function incorrectly retrieves recent issues, leading to incomplete and inaccurate contributor statistics. It only fetches the first 100 issues (per_page: 100) without pagination, missing older issues in high-activity repositories. Furthermore, the since parameter filters by updated_at (not created_at), causing it to include old, recently updated issues and exclude new, un-updated ones, despite sorting by created.
lib/data-retrieval/getRecentIssues.ts#L1-L16
contribution-tracker/lib/data-retrieval/getRecentIssues.ts
Lines 1 to 16 in 4806c1a
| import { octokit } from "lib/sdks" | |
| export async function getRecentIssues(repo: string, since: string) { | |
| const [owner, repoName] = repo.split("/") | |
| const { data } = await octokit.issues.listForRepo({ | |
| owner, | |
| repo: repoName, | |
| state: "all", | |
| sort: "created", | |
| direction: "desc", | |
| per_page: 100, | |
| since, | |
| }) | |
| return data.filter((issue) => !issue.pull_request) | |
| } |
BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.
Was this report helpful? Give feedback by reacting with 👍 or 👎
Summary
Testing
bun test testsbun run formathttps://chatgpt.com/codex/tasks/task_b_6863743dcd08832e9d3df091df05b95d