Skip to content

fix(webhook): refresh PR files on pull_request.edited base retarget (#62)#115

Open
jeffrey701 wants to merge 1 commit into
entrius:testfrom
jeffrey701:fix/pr-files-refresh-on-base-edit-62
Open

fix(webhook): refresh PR files on pull_request.edited base retarget (#62)#115
jeffrey701 wants to merge 1 commit into
entrius:testfrom
jeffrey701:fix/pr-files-refresh-on-base-edit-62

Conversation

@jeffrey701
Copy link
Copy Markdown

Summary

Pull-request file scoring data is refreshed on opened, synchronize, and merged closed events but not on pull_request.edited. When a PR's base branch is retargeted, GitHub sends edited with a changes.base block; the row's baseSha is updated, but pr_files and scoringDataStored stay pinned to the old base.

Treat the changes.base form of edited as another refresh trigger: clear scoringDataStored and enqueue the same PR_FILES job used for normal refreshes (with the new base/head SHAs).

Related Issues

Closes #62

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Testing

  • Verified the fix shape matches the issue's "narrow fix" suggestion (detect base changes, clear scoringDataStored, enqueue PR_FILES).
  • No tests added; the patch reuses the existing prFilesJobId job and scoringDataStored flag.

Checklist

  • I have read the Contributing Guide
  • Code builds without errors
  • New and existing tests pass (if applicable)
  • Documentation updated (if applicable)
  • No unnecessary dependencies added

…ntrius#62)

The handler enqueues PR_FILES on opened / synchronize / merged-closed but
not on pull_request.edited with a base-ref change. The PR row updates
its baseSha, but the stored pr_files and scoringDataStored stay pinned
to the old base — leaving scoring inputs stale.

Detect a base retarget via payload.changes.base, clear scoringDataStored,
and enqueue PR_FILES with the new base/head SHAs through the existing
prFilesJobId path.

Closes entrius#62
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 19, 2026
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 20, 2026

Duplicate of #64 which is better scoped/implemented. Closing.

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 20, 2026

Reopening — reconsidered, #115 is the cleaner shape (inline check, no single-use helper). Closing #64 instead.

Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline check is cleaner than #64's single-use helper. Same idempotent shape (deterministic jobId + upsert) and #62's narrow fix.

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 20, 2026

fix CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] PR base-branch edits do not refresh stored file scoring data

2 participants