Skip to content

Promote: closing-PR fallback for solved_by_pr (test → main)#170

Merged
anderdc merged 1 commit into
mainfrom
test
Jun 2, 2026
Merged

Promote: closing-PR fallback for solved_by_pr (test → main)#170
anderdc merged 1 commit into
mainfrom
test

Conversation

@anderdc

@anderdc anderdc commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Promotes testmain. One commit:

What it does

When an issue is closed without GitHub recording a PR closer (manual close, or Closes #N added after the fixing PR merged), solved_by_pr previously stayed null even though a merged same-repo PR fixed it — surfacing as linked PR and zero issue-discovery credit. selectClosingPr now prefers the authoritative ClosedEvent.closer, then falls back to closedByPullRequestsReferences, gated to COMPLETED + merged + same-repo + mergedAt ≤ closedAt. Shared by both the webhook closure path and the backfill.

Schema / migrations

None — code-only change to github-fetcher.service.ts (GraphQL query + attribution logic). No runbook SQL required.

Post-deploy step

Trigger a backfill to repair existing rows:

POST /api/v1/admin/backfill   x-api-key: <key>
{"repoFullName": "infiniflow/ragflow", "days": 90}

Verify via GET /api/v1/dashboard/issues?since=2026-05-20T00:00:00Z: ragflow #15115/#15117/#15367/#15369 should gain a non-null solving_pr; #15119 (unmerged ref) and #15365 (open ref) correctly stay null.

…nt closer (#169)

Issues closed manually (or with a Closes #N keyword added after the PR
merged) carry no ClosedEvent.closer, so solved_by_pr stayed null even when
a merged same-repo PR plainly fixed them — surfacing as '—' linked PR in
the UI and zero issue-discovery credit.

selectClosingPr now prefers the authoritative closer, then falls back to
the issue's closedByPullRequestsReferences, gated to a COMPLETED closure
and a merged same-repo PR that merged at or before the close. The webhook
closure path and the backfill share the selector, so a normal repo
backfill re-resolves existing rows.

Co-authored-by: anderdc <me@alexanderdc.com>
@anderdc anderdc merged commit 7f30c47 into main Jun 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant