Skip to content

fix(miners): normalize join conditions in getPullRequestsByRepo to LOWER() for case-insensitive repo matching#156

Closed
Tet-9 wants to merge 1 commit into
entrius:testfrom
Tet-9:fix/152-case-insensitive-joins-getPullRequestsByRepo
Closed

fix(miners): normalize join conditions in getPullRequestsByRepo to LOWER() for case-insensitive repo matching#156
Tet-9 wants to merge 1 commit into
entrius:testfrom
Tet-9:fix/152-case-insensitive-joins-getPullRequestsByRepo

Conversation

@Tet-9
Copy link
Copy Markdown
Contributor

@Tet-9 Tet-9 commented May 30, 2026

Summary

getPullRequestsByRepo in miners.service.ts joined the windows CTE on LOWER(p.repo_full_name) but then joined pr_review_summary and repos using exact-case p.repo_full_name. For any repo where rows in those tables were stored under a different casing variant than pull_requests.repo_full_name, both LEFT JOINs returned NULL — silently dropping review summary and repo metadata from scoring output for that miner.

Root Cause

-- Before (incorrect)
LEFT JOIN pr_review_summary rs ON rs.repo_full_name = p.repo_full_name
LEFT JOIN repos r ON r.repo_full_name = p.repo_full_name

-- After (correct)
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)

Changes

  • packages/das/src/api/miners/miners.service.ts: normalized both LEFT JOIN conditions to use LOWER() on both sides, consistent with the windows CTE join.

Testing

Lint confirmed only pre-existing errors in cache.module.ts, unrelated to this change.

Fixes #152

…WER() for case-insensitive repo matching

LEFT JOINs to pr_review_summary and repos used exact-case
p.repo_full_name while the windows CTE join used LOWER(p.repo_full_name).
Mixed-case repos would cause both LEFT JOINs to return NULL, silently
dropping review summary and repo metadata from scoring output.

Fixes entrius#152
@xiao-xiao-mao
Copy link
Copy Markdown

xiao-xiao-mao Bot commented May 30, 2026

You already have 3 open PRs in this repo. The threshold is 3, so closing this one until a maintainer can triage your existing PRs. Please don't open any more — they'll be closed too.

@xiao-xiao-mao xiao-xiao-mao Bot closed this May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant