You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
check_run webhook payloads do not contain a top-level pull_request property. From GitHub's own OpenAPI description of check-run-rerequested, the payload's top-level properties are:
Pull requests are exposed at check_run.pull_requests[], whose items carry only id, number, url, head, base.
So pr is undefined and pr.head.sha throws a TypeError immediately. Clicking "Re-run" on the DCO check has never done anything. The exception escapes before any check run is created, so nothing is reported and the existing result simply stays as it was.
Why it went unnoticed
There is no check_run.rerequested fixture in test/fixtures/ and no test for it anywhere in the suite. The repository enforces 100% coverage, but the handler shares its body with the pull_request.* handlers, so the check() function is fully covered through those events and the broken registration never shows up as a coverage gap. Only the event-name string is uncovered, and a string literal in an array is not a branch.
Note that check_run.requested_action (the "Set DCO to pass" button) is a separate handler that correctly reads context.payload.check_run, and it does work. Only the re-run path is broken.
Impact
This is the natural recovery path for a DCO check that is wrong or stuck, and it is what maintainers reach for first. It is also the remediation the app should be able to suggest when something goes wrong internally — see #302, where an unreported check leaves a required status pending indefinitely.
Fix
Give check_run.rerequested its own handler that resolves a real pull request before delegating to check():
Read context.payload.check_run.pull_requests.
The entries are minimal and lack fields check() needs (notably html_url, which is passed to getDCOStatus), so fetch the full PR with pulls.get using the entry's number.
Be aware that check_run.pull_requests can be empty — for example for check runs not associated with a pull request. That case needs defined behaviour rather than a crash.
Tests should use a realistic check_run.rerequested fixture rather than a hand-built object, so this class of mismatch cannot recur.
Activity
Fix: Run DCO check when a check run is rerequested