Description
POST /api/v1/miners/:githubId/pulls (getPullRequestsByRepo) windows repos case-insensitively via LOWER(p.repo_full_name), but joins pr_review_summary and repos using exact-case PK equality. When pull_requests.repo_full_name casing differs from the joined tables (legacy rows, pre-normalization backfills), review_summary and default_branch come back empty/zero despite data existing under the canonical casing.
Steps to Reproduce
- Store a PR under PK
Org/MyRepo#42 with matching pr_review_summary row keyed as Org/MyRepo.
- Call
POST /api/v1/miners/{id}/pulls with since_by_repo: { "org/myrepo": "<since>" }.
- The PR is returned (window join uses
LOWER), but review_summary counts are all zero and default_branch is null.
Expected Behavior
Joins should match repo names case-insensitively, consistent with the windows join and /repos/:owner/:repo/maintainers.
Actual Behavior
LEFT JOIN pr_review_summary rs
ON rs.repo_full_name = p.repo_full_name -- exact case
LEFT JOIN repos r
ON r.repo_full_name = p.repo_full_name -- exact case
Environment
- OS: Linux
- Runtime/Node version: Node 20
Description
POST /api/v1/miners/:githubId/pulls(getPullRequestsByRepo) windows repos case-insensitively viaLOWER(p.repo_full_name), but joinspr_review_summaryandreposusing exact-case PK equality. Whenpull_requests.repo_full_namecasing differs from the joined tables (legacy rows, pre-normalization backfills),review_summaryanddefault_branchcome back empty/zero despite data existing under the canonical casing.Steps to Reproduce
Org/MyRepo#42with matchingpr_review_summaryrow keyed asOrg/MyRepo.POST /api/v1/miners/{id}/pullswithsince_by_repo: { "org/myrepo": "<since>" }.LOWER), butreview_summarycounts are all zero anddefault_branchis null.Expected Behavior
Joins should match repo names case-insensitively, consistent with the
windowsjoin and/repos/:owner/:repo/maintainers.Actual Behavior
Environment