fix: normalize repo name casing in dict lookups (#1214)#1263
Open
alpurkan17 wants to merge 1 commit into
Open
Conversation
## Summary Three dict lookups in scoring/load/scan use exact-case matching on repository full names. When a data source provides a different casing than the master_repositories keys (always lowercase), the lookup silently returns None — skipping PRs from scoring, eligibility checks, and issue discovery. ## Root Cause keys are normalized to lowercase at load time (load_weights.py:177) but the lookup values from legacy (GitHub API) and mirror paths are not consistently lowercased at every call site. ## Impact - Legacy scoring path: PRs with mixed-case repo names silently score zero - Mirror load: PRs from repos with casing mismatches silently dropped - Issue discovery: solving PRs for mismatched repos silently ignored ## Fix Add at three dict lookup call sites for case-insensitive matching, matching the already-lowercased dictionary keys. ## Related Issues Fixes entrius#1214 ## Test plan ### How to verify - Existing tests pass (no behavioral change for lowercase inputs) - Manually verified master_repositories dict keys are lowercase - Mirror model already lowercases repo_full_name at parse time ### Edge cases considered - Empty string: .lower() on '' returns '' — no change - Already lowercase: .lower() is idempotent — no change - Unicode: GitHub repo names are ASCII only ### Post-merge verification - Scoring rounds continue normally - No new scoring gaps for repos with mixed-case names
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
master_repositoriesdict keys are lowercase at load time, but lookups from legacy/mirror paths were not consistently lowercased — causing silentNonereturns and skipped scoring/eligibility/issue-discovery for repos with mixed-case names.Fix: apply
.lower()at the three affected call sites.Validation
Closes #1214