fix(miners): normalize join conditions in getPullRequestsByRepo to LOWER() for case-insensitive repo matching#156
Closed
Tet-9 wants to merge 1 commit into
Conversation
…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
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getPullRequestsByRepoinminers.service.tsjoined thewindowsCTE onLOWER(p.repo_full_name)but then joinedpr_review_summaryandreposusing exact-casep.repo_full_name. For any repo where rows in those tables were stored under a different casing variant thanpull_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
Testing
Lint confirmed only pre-existing errors in cache.module.ts, unrelated to this change.
Fixes #152