Good. Here are 3 approaches, all using GitHub Issues as the source of truth:
Approach A: Expand existing listIssues to include closed issues
Change issues.ts to fetch both open + closed issues. Paginate to get all of them (not just 100). The existing URL extraction from issue bodies stays the same.
- Pros: Minimal code change, no new files or abstractions
- Cons: More API calls per run (paginating all issues every time), could hit rate limits on repos with many issues
Approach B: Use GitHub Search API instead of list API
Replace listIssues with a search query like repo:owner/repo label:radar which returns both open and closed issues and supports up to 1000 results. Can also search for the specific URL in the issue body.
- Pros: Single API call per candidate URL (or one bulk query), works across open/closed, efficient
- Cons: Search API has stricter rate limits (30 req/min), search index can lag a few seconds behind issue creation
Approach C: Paginated list + in-memory cache (recommended)
Fetch all issues (open + closed) with radar labels via paginated listForRepo, build a Set<string> of known URLs, then check candidates against it. This is what the code already does for open issues — we just expand it.
- Pros: Simple extension of existing pattern, one pass builds full dedup set, no search API rate limit concerns, predictable behavior
- Cons: Many pages for repos with thousands of issues (but radar repos are unlikely to have that many)
I recommend Approach C. It's the most natural extension of the existing code — listIssues already fetches open issues and extracts URLs. We just need to:
- Change
state: "open" to state: "all"
- Add pagination to fetch beyond 100
- Keep the state file as a secondary cache (optional optimization)
Does Approach C work for you, or would you prefer a different one?