Skip to content

fix: normalize repo name casing in dict lookups (#1214)#1263

Open
alpurkan17 wants to merge 1 commit into
entrius:testfrom
alpurkan17:fix/1214-case-insensitive-repo-match
Open

fix: normalize repo name casing in dict lookups (#1214)#1263
alpurkan17 wants to merge 1 commit into
entrius:testfrom
alpurkan17:fix/1214-case-insensitive-repo-match

Conversation

@alpurkan17
Copy link
Copy Markdown
Contributor

@alpurkan17 alpurkan17 commented May 14, 2026

Summary

master_repositories dict keys are lowercase at load time, but lookups from legacy/mirror paths were not consistently lowercased — causing silent None returns and skipped scoring/eligibility/issue-discovery for repos with mixed-case names.

Fix: apply .lower() at the three affected call sites.

Validation

  • ruff check
  • ruff format --check
  • Existing tests pass
  • Empty/already-lowercase strings idempotent

Closes #1214

## 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
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Admin repoFullName matching is case-sensitive, causing register/backfill failures for valid repos #91

1 participant