Skip to content

feat(enrichment): derive linked issue from PR body when unset - #1864

Merged
JSONbored merged 4 commits into
JSONbored:mainfrom
kiannidev:feat/enrichment-linked-issue-body-fallback
Jun 30, 2026
Merged

feat(enrichment): derive linked issue from PR body when unset#1864
JSONbored merged 4 commits into
JSONbored:mainfrom
kiannidev:feat/enrichment-linked-issue-body-fallback

Conversation

@kiannidev

@kiannidev kiannidev commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

When pr.linkedIssues is empty (e.g. before sync materializes links), parse Fixes #N from the PR description and forward the resolved linkedIssue envelope to REES.

Issue

Action: Open upstream issue feat(enrichment): derive linked issue from PR body when unset and link Fixes #… before gate review.

Depends on

Merge #1863 first, then rebase this branch onto main so the PR diff is only the body-fallback commit. Until then the PR includes the linked-issue envelope work from #1863.

Validation

npx vitest run test/unit/enrichment-wire.test.ts test/unit/enrichment-wiring.test.ts

Test plan

  • resolveEnrichmentLinkedIssueNumbers prefers explicit linkedIssues over body parsing
  • Body-only Fixes #55 resolves via local issue cache in processor wiring test

@kiannidev
kiannidev requested a review from JSONbored as a code owner June 30, 2026 10:46
@dosubot dosubot Bot added the size:M label Jun 30, 2026
@loopover-orb

loopover-orb Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-06-30 19:06:28 UTC

4 files · 1 AI reviewer · no blockers · readiness 55/100 · CI green · unknown

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review

Review summary
This threads a resolved linkedIssue envelope into the REES enrichment request and adds a body-parser fallback when explicit linkedIssues are absent. The production path is fail-safe: enrichment remains flag-gated, request payload already accepts linkedIssue, DB lookup errors degrade to number-only, and explicit links win over parsed body refs. The main review note is that the new body-only processor test bypasses the normal PR upsert path, which already derives linkedIssues from the same body parser, so this should be covered as legacy/direct-call recovery rather than the common webhook path.

Nits — 7 non-blocking
  • nit: test/unit/enrichment-wiring.test.ts:258 manufactures `linkedIssues: []` with `body: "Fixes docs(ci): add coverage buffer and contributor test-quality guidance #55"` even though the normal webhook path at src/db/repositories.ts:4220 stores `linkedIssues: extractLinkedIssueNumbers(pr.body ?? "")`; add a stored-row/legacy-row regression or document that this covers direct/legacy callers.
  • nit: src/review/enrichment-wire.ts:176 catches `getIssue` failures and returns number-only with no telemetry; consider a bounded warning so broken issue-cache reads are distinguishable from ordinary cache misses.
  • nit: test/unit/enrichment-wire.test.ts:570 covers explicit preference and body fallback, but it does not assert that invalid explicit entries are filtered before deciding whether to parse the body.
  • In test/unit/enrichment-wiring.test.ts:258, seed a cached PR row or call through the same stored-PR path used by `maybePublishPrPublicSurface`, then force only the stored `linkedIssues` empty to prove the recovery path is reachable for stale/legacy data.
  • In src/review/enrichment-wire.ts:176, log/cache-miss telemetry only on thrown DB errors, not on normal `null`, to keep the enrichment path fail-safe while making degraded issue context observable.
  • 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 ✅ Linked #55
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:M; 1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR; address the blocker before review.
Contributor workload ✅ 10/10 Author activity: 3148 registered-repo PR(s), 1801 merged, 53 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kiannidev; Gittensor profile; 3148 PR(s), 53 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
  • Author: kiannidev
  • Role context: outside_contributor
  • 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: 3148 PR(s), 53 issue(s).
  • Related work: Titles/paths share 7 meaningful terms. (PR #1852)
  • Related work: Titles/paths share 6 meaningful terms. (PR #1867)
  • Related work: Titles/paths share 5 meaningful terms. (PR #1882)
  • Additional title-only matches omitted; title-only overlap does not block.
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Fix the blocker.
  • Triage stale or unlinked PRs.
  • Refresh registry data or choose a registered active repo.
  • 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

kiannidev and others added 2 commits June 30, 2026 13:00
Resolve pr.linkedIssues into a compact linkedIssue payload via the local
issue cache so REES history can correlate PR work with issue context.

Co-authored-by: Cursor <cursoragent@cursor.com>
When pr.linkedIssues is empty, parse Fixes #N from the PR description so
REES history still receives linkedIssue context before sync catches up.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kiannidev
kiannidev force-pushed the feat/enrichment-linked-issue-body-fallback branch from dd4cda5 to 705899b Compare June 30, 2026 11:00
@JSONbored JSONbored closed this Jun 30, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 30, 2026
@JSONbored JSONbored reopened this Jun 30, 2026
JSONbored and others added 2 commits June 30, 2026 10:49
Move resolveEnrichmentLinkedIssue inside the isEnrichmentEnabled branch
so flag-off reviews do no extra DB work. Addresses JSONbored review on JSONbored#1863.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dosubot dosubot Bot added the lgtm label Jun 30, 2026
@JSONbored
JSONbored merged commit bb0fe76 into JSONbored:main Jun 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants