Skip to content

GithubWebhooksService.handlePullRequest never reacts to a PR being opened — markInReview only ever fires synthetically at merge time #168

Description

@chonilius

handlePullRequest() returns [] immediately unless payload.action === 'closed' && payload.pull_request.merged — i.e. it does nothing at all for a PR-opened (or reopened, synchronize, etc.) webhook event. BountiesService.markInReview(id, prUrl, prNumber) exists specifically to transition a bounty CLAIMED -> IN_REVIEW when a PR is opened against its issue, but the only place it's ever called is inside handlePullRequest's merged-PR branch, immediately before markMergedAndRelease — i.e. markInReview only ever fires in the same instant as a merge, never in response to the actual "a PR was opened" event that should trigger it.

Practical consequence: a contributor who opens a PR that sits open for review (the common case) never sees their bounty move to IN_REVIEW from the webhook's perspective — it stays CLAIMED in the database (and in any UI reading Bounty.status) right up until the PR is merged, at which point IN_REVIEW and MERGED both happen within the same request. This is distinct from the already-filed issue about a PR closed without merging having no handler — this is about PRs that are opened (merged or not) having no handler either. Add a case for action === 'opened' (and arguably 'reopened') that resolves the linked bounty and calls markInReview at the time the PR is actually opened.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requesthelp wantedExtra attention is neededvery hardVery difficult task, expert-level effort required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions