Skip to content

fix(signals): preserve repo casing for open PR lookups#1716

Merged
JSONbored merged 1 commit into
mainfrom
codex/propose-fix-for-case-variant-pr-issue
Jun 29, 2026
Merged

fix(signals): preserve repo casing for open PR lookups#1716
JSONbored merged 1 commit into
mainfrom
codex/propose-fix-for-case-variant-pr-issue

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • A recent change grouped open PRs case-insensitively but then reused a single PR's repoFullName casing for all downstream exact-case DB lookups, which caused mixed-case rows to be skipped for reviews/checks/files and under-counted pending scenarios.
  • The goal is to ensure case-insensitive grouping remains while preserving each PR's stored casing when performing exact-case lookups so signal loading and pending-pr detection remain correct.

Description

  • Use case-insensitive matching helpers and sameRepoFullName to select PR rows for signal loading and scenario detection instead of exact === equality in src/scoring/pending-pr-scenarios.ts.
  • Load reviews/checks and files using each PR's stored repoFullName (e.g. pr.repoFullName) so exact-case DB accessors resolve the correct rows, and compute per-repo PR lists by filtering the original pullRequests set case-insensitively in src/signals/contributor-open-pr-monitor.ts.
  • Add sameRepoFullName helper and update detectPendingPrScenario/loadContributorRepoOpenPrSignals to use it, and adjust buildContributorOpenPrMonitor to call listPullRequestFiles with each PR's stored casing.
  • Add/update a unit test in test/unit/contributor-open-pr-monitor.test.ts that simulates mixed-case PR rows and asserts both PRs retain reviews/files and are included in pending scenario counts.

Testing

  • Ran the focused unit suite with npx vitest run test/unit/contributor-open-pr-monitor.test.ts test/unit/pending-pr-scenarios.test.ts and all tests passed (29 tests across 2 files).
  • Ran TypeScript typecheck with npm run typecheck and it succeeded.
  • npm run test:coverage failed due to the coverage provider error TypeError: jsTokens is not a function, so full coverage collection could not complete locally.
  • npm run test:ci and npm audit --audit-level=moderate were blocked by external/tooling issues (actionlint setup fallback complaining about a custom runner label and the npm audit endpoint returning 403), so the complete gated CI could not be run in this environment.

Codex Task

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 29, 2026
@gittensory-orb

gittensory-orb Bot commented Jun 29, 2026

Copy link
Copy Markdown

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-06-29 18:33:11 UTC

3 files · 1 AI reviewer · no blockers · readiness 68/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review

Review summary
The change correctly preserves each cached PR row's repository casing for exact DB lookups while still grouping and scenario detection case-insensitively. The monitor now derives the repo-scoped PR list from the already-loaded contributor PRs, which matches the downstream contributor-only filter and avoids reintroducing a case-sensitive repository query. The focused regression test exercises both review and file lookup casing for the mixed-case group.

Nits — 6 non-blocking
  • nit: test/unit/contributor-open-pr-monitor.test.ts still mocks repositories.listPullRequests in several monitor tests even though src/signals/contributor-open-pr-monitor.ts no longer calls it, which makes those tests imply coverage for a removed path.
  • nit: src/scoring/pending-pr-scenarios.ts:232 and src/signals/contributor-open-pr-monitor.ts:214 now carry separate case-insensitive comparison logic; extracting a shared repo-name matcher would reduce drift if normalization rules change.
  • test/unit/contributor-open-pr-monitor.test.ts: remove the now-dead listPullRequests spies from monitor tests, or add an assertion that it is not called if that is the intended contract after this change.
  • src/scoring/pending-pr-scenarios.ts and src/signals/contributor-open-pr-monitor.ts: consider sharing the repository-name equality helper instead of duplicating lowercasing at each call site.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ⚠️ 1 scoped overlap Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:S; no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 2 registered-repo PR(s), 2 merged, 280 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 2 PR(s), 280 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 2 PR(s), 280 issue(s).
  • Related work: Titles/paths share 6 meaningful terms. (PR #1693)
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Triage stale or unlinked PRs.
  • No action.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@gittensory-orb gittensory-orb Bot added gittensor Gittensor contributor context gittensor:bug Gittensor-scored bug fix - worth 0.5x multiplier. labels Jun 29, 2026
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.56%. Comparing base (8652e6c) to head (0f62305).
⚠️ Report is 12 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1716      +/-   ##
==========================================
- Coverage   95.58%   95.56%   -0.02%     
==========================================
  Files         204      204              
  Lines       22295    22296       +1     
  Branches     8053     8053              
==========================================
- Hits        21310    21307       -3     
  Misses        408      408              
- Partials      577      581       +4     
Files with missing lines Coverage Δ
src/scoring/pending-pr-scenarios.ts 93.90% <100.00%> (-2.40%) ⬇️
src/signals/contributor-open-pr-monitor.ts 96.22% <100.00%> (-1.89%) ⬇️
🚀 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

aardvark codex gittensor:bug Gittensor-scored bug fix - worth 0.5x multiplier. gittensor Gittensor contributor context size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant