fix(signals): recognize the fully-qualified owner/repo#N closing reference - #2860
Conversation
…rence extractLinkedIssueNumbers only matched the bare `KEYWORD #N` closing form, so GitHub`s other documented auto-close syntax -- the fully-qualified `KEYWORD owner/repo#N` (routinely emitted by Renovate/Dependabot and by contributors pasting a qualified reference) -- was silently dropped. A PR whose body says `Fixes myorg/myrepo#42` was therefore scored as having NO linked issue: it wrongly tripped the missing_linked_issue preflight finding and fed slop a false hasLinkedIssue=false, penalizing a properly-linked PR. Match the qualified form too, repo-scoped: count `owner/repo#N` only when owner/repo case-insensitively equals this repo, so a cross-repo reference (which closes an issue elsewhere) never spoofs a same-repo link. The bare form and the JSONbored#1988 word-boundary invariant are unchanged.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2860 +/- ##
=======================================
Coverage 96.01% 96.01%
=======================================
Files 259 259
Lines 28279 28282 +3
Branches 10288 10289 +1
=======================================
+ Hits 27151 27154 +3
Misses 491 491
Partials 637 637
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-04 01:32:33 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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.
|
extractLinkedIssueNumbers(the preflight linked-issue detector) matched only the bareKEYWORD #Nclosing form:The
\s+#requires whitespace immediately before#, so GitHub's other documented auto-close syntax — the fully-qualifiedKEYWORD owner/repo#N(Fixes octo-org/octo-repo#100) — is silently dropped.Why it matters
extractLinkedIssueNumbersfeedsbuildPreflightResult/buildLocalDiffPreflightResult, whose linked-issue output drives real gating/scoring:missing_linked_issuepreflight finding — a PR whose body saysFixes myorg/myrepo#42is flagged as having no linked issue, andslopreceiveshasLinkedIssue: false, tripping theno_linked_issue_without_rationaleslop finding. A legitimately-linked PR is penalized as slop.itemSharesPlannedLinkedIssue) — two PRs linking the same issue via the qualified form aren't recognized as overlapping.The qualified
owner/repo#Nform is standard — Renovate/Dependabot emit it routinely, and contributors paste fully-qualified references.Fix
Also match
KEYWORD owner/repo#N, repo-scoped: includeNonly whenowner/repocase-insensitively equals this repo. A cross-repo reference (other-org/other#5) closes an issue elsewhere and must not spoof a same-repo link — this is the correctness nuance that keeps it from over-linking.repoFullNameis threaded from both call sites (already in scope). The bare#Nform and the#1988word-boundary invariant (unfixes …is not a keyword) are unchanged.owner/direct)Closes #10[10][10]Fixes owner/direct#42[][42]Resolves Owner/Direct#42(case)[][42]Fixes other-org/other#42(cross-repo)[][]unfixes owner/direct#42(embedded kw)[][]Scope note: a parallel, intentionally-independent copy lives in
src/db/repositories.ts(extractLinkedIssueNumbersWithOverflow, per #1988); it is deliberately left out of scope because its consumers include a guarded code path — this PR targets the preflight/slop path only.Tests
Adds a regression case covering the same-repo qualified ref (links + suppresses
missing_linked_issue), case-insensitive owner/repo match, cross-repo exclusion (still firesmissing_linked_issue), the unchanged bare form, and the embedded-keyword guard. Verified the new cases FAIL on currentmainand PASS with the fix;signals-coverage+slopsuites stay green.No linked issue: issue creation is unavailable for this account.