Skip to content

fix(backfill): use baseRefName so deleted base branches don't null out base_ref#217

Open
anderdc wants to merge 1 commit into
testfrom
fix/backfill-base-ref-name
Open

fix(backfill): use baseRefName so deleted base branches don't null out base_ref#217
anderdc wants to merge 1 commit into
testfrom
fix/backfill-base-ref-name

Conversation

@anderdc

@anderdc anderdc commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Problem

The GraphQL PR backfill selects baseRef { name }. In GitHub's schema baseRef is a nullable Ref that resolves to null once the base branch is deleted or renamed away. Since the persist is an upsert keyed on (repoFullName, prNumber), the nightly backfill overwrites a previously-correct webhook-written base_ref with null — pure data loss for the validator's branch-eligibility gate.

Fix

Select baseRefName (non-nullable String!) instead; it preserves the historical base ref name on the PR record even after branch deletion. baseRefOid and headRef are untouched.

Existing null rows self-repair whenever the incremental backfill next touches them.

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