Fix checks not updating on rebuild; handle GitHub's own re-run webhooks - #375
Open
alexreinking wants to merge 1 commit into
Open
alexreinking wants to merge 1 commit into
alexreinking wants to merge 1 commit into
Conversation
…GitHub re-run webhooks An intermittent build failure followed by clicking "Rebuild" in the Buildbot Web UI left the check stuck on "failure": GitHubAppCheckPush.createStatus() patched the most recent check run for a given name+sha even after it had already completed, but PATCHing a completed run's status back to queued/in_progress isn't how GitHub expects reruns to be handled. Only reuse a check run while it's still open; once it's completed, start a fresh one, matching GitHub's own guidance for handling check_run.rerequested. Separately, GitHub's own "Re-run"/"Re-run all jobs" buttons never reached Buildbot at all, since SafeGitHubEventHandler had no handler for the check_run/check_suite webhook events those buttons send. Add handlers for the "rerequested" action that re-run the exact build(s) a check (run or suite) points at, via the same data-API path the Buildbot Web UI's own "Rebuild" button uses. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related bugs in the GitHub Checks API integration added in #373/#374:
GitHubAppCheckPush.createStatus()looked up the most recent check run for a given name+sha and always PATCHed it, even if that run had already gonecompleted. On rebuild, the new build's "queued"/"in_progress" reports were patching the old, finished run backward, which isn't a transition GitHub expects. Now a check run is only reused (PATCHed) while it's still open; once completed, the next report creates a fresh check run, matching GitHub's own documented guidance for handlingcheck_run.rerequested.SafeGitHubEventHandlerhad no handler for thecheck_run/check_suitewebhook events those buttons send (delivered via the halide-ci App's own webhook subscription, separate from the classic repo push/pull_request webhook). Added handlers for thererequestedaction that resolve the check run's owndetails_url(Buildbot's own build URL) back to abuilderid/build_number, then rebuild it via the same data-API path (rebuildBuildrequest) the Web UI's own Rebuild button uses.check_suitererequests list the suite's check runs and rebuild each one that's ours (namestarting withbuildbot/), so "Re-run all jobs" covers every builder.The halide-ci GitHub App's webhook has been reconfigured to point at Buildbot's existing
/change_hook/githubendpoint with the Checks events subscribed, so both fixes are live once this deploys.Test plan
ruff check/ruff format --checkty check --error-on-warning master/master.cfg master/custom_steps.pybandit,codespell,vulturebuildbot checkconfig master🤖 Generated with Claude Code