Skip to content

fix(signals): group contributor open PRs by repo case-insensitively#1527

Open
galuis116 wants to merge 1 commit into
JSONbored:mainfrom
galuis116:fix/open-pr-monitor-repo-case
Open

fix(signals): group contributor open PRs by repo case-insensitively#1527
galuis116 wants to merge 1 commit into
JSONbored:mainfrom
galuis116:fix/open-pr-monitor-repo-case

Conversation

@galuis116

Copy link
Copy Markdown
Contributor

Summary

Fixes #1526.

groupByRepo in buildContributorOpenPrMonitor bucketed a contributor's open PRs by the raw pr.repoFullName, while every other repo-name operation in the same function is case-insensitive (the registered-repo set, the open-PR filter, the repo lookup). GitHub repo names are case-insensitive, so case-variant repoFullName values for one repo split into separate groups — under-counting per-repo open PRs, running duplicate detection only within each partial group, and querying listPullRequests once per casing.

What changed

  • groupByRepo now keys buckets on pr.repoFullName.toLowerCase(), matching the function's own repo-name handling.
  • The consumer loop derives the canonical repoFullName from a bucket's first PR (its original casing) for the case-sensitive per-repo DB queries — the established key-by-lower / keep-original pattern used in contributor-evidence-graph.ts.

Scope

Validation

  • git diff --check
  • npm run typecheck
  • npm run test:coverage locally (4619 passed); the new grouping lines are covered by a case-variant test, and the existing same-casing tests are unchanged.
  • npm run test:workers
  • npm audit --audit-level=moderate
  • New unit test: two open PRs for one repo under different casings group together and the case-sensitive query never runs against the case-variant.

If any required check was skipped, explain why:

  • OpenAPI/types/migrations unchanged — internal grouping only; the monitor's output shape is identical.

Safety

  • No secrets, wallets, hotkeys, PATs, trust scores, or private evidence exposed.
  • Public text sanitized and low-noise (monitor output sanitizer test still passes).
  • No auth/CORS/session change.
  • API/OpenAPI/MCP behavior unchanged.
  • No UI changes.
  • No changelog edit.

Notes

  • Confined to src/signals/contributor-open-pr-monitor.ts; mirrors the case-insensitive repo handling already present in the same function and in contributor-evidence-graph.ts.

@galuis116 galuis116 requested a review from JSONbored as a code owner June 26, 2026 13:22
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 26, 2026
@superagent-security

Copy link
Copy Markdown

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.46%. Comparing base (6b1389b) to head (c6ea025).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1527   +/-   ##
=======================================
  Coverage   95.45%   95.46%           
=======================================
  Files         195      195           
  Lines       21121    21123    +2     
  Branches     7637     7637           
=======================================
+ Hits        20161    20165    +4     
  Misses        383      383           
+ Partials      577      575    -2     
Files with missing lines Coverage Δ
src/signals/contributor-open-pr-monitor.ts 98.11% <100.00%> (+1.95%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: contributor open-PR monitor groups PRs by case-sensitive repoFullName, splitting one repo into two

1 participant