test(scoring): cover pending-pr helpers' ghost-login exclusion and case-insensitive matching#8468
Conversation
…se-insensitive matching
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-24 14:47:40 UTC
Review summary Nits — 3 non-blocking
CI checks failing
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests-merge)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
What
src/scoring/pending-pr-scenarios.ts's two filter helpers had a real branch-coverage gap onthe logic that decides which of a contributor's open PRs count toward their pending-PR signals:
sameLogin'svalue &&short-circuit — which exists to exclude ghost/deleted GitHubaccounts whose
authorLoginisnull/undefined(PullRequestRecord.authorLoginis typedstring | null | undefined) — had no test proving the falsy-valueside (anulllogin isexcluded, not matched or thrown).
.toLowerCase()case-normalization in bothsameLoginandsameRepoFullName— GitHubowner/repo and login are case-insensitive but stored values aren't guaranteed consistent —
had no test proving a case-only difference still matches.
Every existing test set
authorLoginto a concrete same-case string, so neither branch wasexercised.
Change
Pure test addition (no source change) in
test/unit/pending-pr-scenarios.test.ts: one casefeeding
loadContributorRepoOpenPrSignalRecordsfour PRs —authorLogin: nullandauthorLogin: undefinedfor the searched login → both excluded(covers
sameLogin's falsy-valueshort-circuit);repoFullNamediffering only in case → included (coverssameRepoFullName'scase-normalization);
authorLogindiffering only in case → included (coverssameLogin's truthy side +case-normalization).
The per-PR review mock lets the test assert exactly which pull numbers survive the filter
(
[82, 83]), pinning the include/exclude outcome for each branch.Validation
npx vitest run test/unit/pending-pr-scenarios.test.ts→ all pass.npm run test:changednet green (modulo the pre-existing Windows-onlysubprocess/symlink baseline failures that pass on Linux CI).
Closes #8329