Duplicate check
| Item |
Relation |
| #140 (open) |
Webhook gate case-sensitive lookup — different code path |
| #120 (open) |
Uninstall case-sensitive PK — different code path |
| #70 (closed) |
Admin validateRepoFullName lowercase — different code path |
| No open/closed issue |
getPullRequestsByRepo mixed casing within same query |
Description
getPullRequestsByRepo in miners.service.ts joins the windows CTE on LOWER(p.repo_full_name) for the main filter, but then joins pr_review_summary and repos using exact-case p.repo_full_name:
The window join uses LOWER() but the LEFT JOINs to pr_review_summary and repos use exact-case. If rows in those tables were stored under a different casing variant than pull_requests.repo_full_name, both LEFT JOINs return NULL — silently dropping review summary and repo metadata from scoring output for that miner.
Steps to Reproduce
- Ingest a repo stored as
Org/Repo in repos and pr_review_summary.
- Ingest pull requests stored as
org/repo (lowercase) in pull_requests.
- Call
POST /api/v1/miners/{authorId}/pulls with since_by_repo targeting org/repo.
- Observe
rs.* and r.* columns are NULL in results despite data existing.
Expected Behavior
All join conditions should use the same casing normalization so review summary and repo metadata are never silently dropped. Suggested fix:
LEFT JOIN pr_review_summary rs ON LOWER(rs.repo_full_name) = LOWER(p.repo_full_name)
LEFT JOIN repos r ON LOWER(r.repo_full_name) = LOWER(p.repo_full_name)
Files
packages/das/src/api/miners/miners.service.ts — getPullRequestsByRepo query (~lines 229-240).
Environment
- Runtime/Node version: Node 20
- OS: Linux
Duplicate check
getPullRequestsByRepomixed casing within same queryDescription
getPullRequestsByRepoinminers.service.tsjoins thewindowsCTE onLOWER(p.repo_full_name)for the main filter, but then joinspr_review_summaryandreposusing exact-casep.repo_full_name:The window join uses LOWER() but the LEFT JOINs to
pr_review_summaryandreposuse exact-case. If rows in those tables were stored under a different casing variant thanpull_requests.repo_full_name, both LEFT JOINs return NULL — silently dropping review summary and repo metadata from scoring output for that miner.Steps to Reproduce
Org/Repoinreposandpr_review_summary.org/repo(lowercase) inpull_requests.POST /api/v1/miners/{authorId}/pullswithsince_by_repotargetingorg/repo.rs.*andr.*columns are NULL in results despite data existing.Expected Behavior
All join conditions should use the same casing normalization so review summary and repo metadata are never silently dropped. Suggested fix:
LEFT JOIN pr_review_summary rs ON LOWER(rs.repo_full_name) = LOWER(p.repo_full_name)
LEFT JOIN repos r ON LOWER(r.repo_full_name) = LOWER(p.repo_full_name)
Files
packages/das/src/api/miners/miners.service.ts—getPullRequestsByRepoquery (~lines 229-240).Environment