test(scoring): cover pending-pr-scenarios' sameLogin/sameRepoFullName match branches#8505
Conversation
…epo match branches loadContributorRepoOpenPrSignalRecords filters open PRs by sameLogin (which short-circuits a null/undefined authorLogin via Boolean(value && ...)) and sameRepoFullName (case-insensitive), but neither branch was directly covered. Add two tests extending the existing loader test: (1) PRs with authorLogin null and undefined are excluded (not matched or thrown on), asserting only the target login's PR is loaded; (2) a repoFullName differing from the query only in letter case still matches. No source change -- coverage for existing, correct logic.
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-24 16:43:48 UTC
Review summary Nits — 4 non-blocking
CI checks failing
Flagged checks (non-blocking)
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionPartially addressed 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 & why
Closes #8329.
loadContributorRepoOpenPrSignalRecords(src/scoring/pending-pr-scenarios.ts) filters a repo's open PRs bysameLogin— which short-circuits anull/undefinedauthorLoginviaBoolean(value && value.toLowerCase() === login.toLowerCase())— andsameRepoFullName(case-insensitive). Neither branch had direct coverage, and the repo's patch gate counts branches.What's added (test-only — no source change)
Two tests extending the existing loader test in
test/unit/pending-pr-scenarios.test.ts:authorLogin: nullandauthorLogin: undefinedare dropped bysameLogin's short-circuit (not matched, not thrown on) — asserted by mocking the per-PR review fetch and confirming only the target login's own PR (feat(mcp): add local workspace intelligence v2 #70) is loaded (listPullRequestReviewscalled exactly once, for feat(mcp): add local workspace intelligence v2 #70).PullRequestRecordwhoserepoFullNameis"Entrius/Allways-UI"still matches the query"entrius/allways-ui"—sameRepoFullNamelowercases both.loadContributorRepoOpenPrSignalRecords's logic is untouched — this is coverage for existing, correct code.Validation
test/unit/pending-pr-scenarios.test.ts: 19 tests pass (17 existing + 2 new); typecheck clean;git diff --checkclean.sameRepoFullNamecase-sensitive fails the case test, proving it exercises that branch.main, mergeable-clean.