Report build status via the GitHub Checks API using the halide-ci App - #373
Merged
Conversation
GitHubStatusPush only ever POSTs to the legacy Statuses API, which has no "in progress" state, so a running build shows a static pending dot instead of GitHub's spinner. Add GitHubAppCheckPush, a small subclass that reports through the Checks API instead, authenticating as the halide-ci GitHub App (the Checks API rejects plain PATs). AppInstallationToken mints and caches installation access tokens as a buildbot IRenderable, so it plugs into GitHubStatusPush's existing `token=` argument unchanged.
master.cfg now reads secrets/github_app_private_key.pem unconditionally, but the checkconfig job only stubbed the pre-existing secrets, so this PR's own CI run failed with FileNotFoundError.
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
GitHubStatusPushonly posts to the legacy Statuses API, which has no "in progress" state — a running build shows a static pending dot instead of GitHub's spinner. The Checks API has that state, but requires GitHub App auth (a PAT can't create/update check runs).GitHubAppCheckPush(subclassesGitHubStatusPush, overriding only_get_auth_headerandcreateStatusto hitcheck-runsinstead ofstatuses) andAppInstallationToken, a buildbotIRenderablethat mints and caches installation access tokens from thehalide-ciApp, so it plugs into the existingtoken=argument unchanged.master.cfgusing thehalide-ciApp's client ID and installation ID, backed by a newsecrets/github_app_private_key.pem(mounted viadocker-compose.yml, ignored via.gitignore). The existingGITHUB_TOKENPAT is untouched — it's still used by the webhook handler.custom_steps.pyalready has.Test plan
pre-commit run --files master/github_app_check_push.py master/master.cfg docker-compose.yml pyproject.toml .pre-commit-config.yaml .gitignore— all hooks passbuildbot checkconfigonmaster/master.cfgpasses (verified with stubbed secret files for keys not present in this checkout)AppInstallationToken.getRenderingForunder a real Twisted reactor with_fetchmocked: single-caller caching works, and 3 concurrent renders against an expired token collapse to exactly 1 underlying fetch (theDeferredLockguard works as intended)Halide/Haliderepo specifically (not just the org)