Description
GET/POST /api/v1/miners/:githubId/pulls applies inconsistent time windows across PR states. MERGED PRs correctly use merged_at >= since. CLOSED (unmerged) PRs use created_at >= since, while the sibling /issues endpoint uses closed_at >= since for closed issues. Old PRs closed inside the scoring window but opened before since are omitted from miner pull results.
Steps to Reproduce
- Mirror a repo with a miner-authored PR:
created_at = 60 days ago, closed_at = 5 days ago, state = CLOSED (not merged).
- Call
GET /api/v1/miners/{authorId}/pulls?since= (ISO timestamp 30 days ago).
- Call
GET /api/v1/miners/{authorId}/issues?since= (same timestamp).
- The closed issue appears (
closed_at >= since); the closed PR does not (created_at < since).
- Repeat with
POST .../pulls and since_by_repo — same filter in getPullRequestsByRepo.
Expected Behavior
CLOSED PRs should enter the window when closed_at >= since, matching issues and matching how MERGED uses merged_at.
Actual Behavior
(p.state = 'CLOSED' AND p.created_at >= $2) -- should use closed_at
Environment
- OS: Linux
- Runtime/Node version: Node 20
Description
GET/POST /api/v1/miners/:githubId/pullsapplies inconsistent time windows across PR states.MERGEDPRs correctly usemerged_at >= since.CLOSED(unmerged) PRs usecreated_at >= since, while the sibling/issuesendpoint usesclosed_at >= sincefor closed issues. Old PRs closed inside the scoring window but opened beforesinceare omitted from miner pull results.Steps to Reproduce
created_at= 60 days ago,closed_at= 5 days ago,state=CLOSED(not merged).GET /api/v1/miners/{authorId}/pulls?since=(ISO timestamp 30 days ago).GET /api/v1/miners/{authorId}/issues?since=(same timestamp).closed_at >= since); the closed PR does not (created_at < since).POST .../pullsandsince_by_repo— same filter ingetPullRequestsByRepo.Expected Behavior
CLOSEDPRs should enter the window whenclosed_at >= since, matching issues and matching howMERGEDusesmerged_at.Actual Behavior
Environment