Repository navigation
feat(events): parse GitHub status, check_suite and check_run events - #775
Merged
hieptl merged 1 commit intoNov 19, 2026
Merged
Conversation
GitHub's CI result events other than workflow_run had no payload class, so the requested-types endpoint never listed them, the OpenHands server dropped every delivery, capabilities did not offer them and preflight refused a trigger on them. check_run had a detection rule and no parser; status and check_suite had neither. Register CheckSuitePayload, CheckRunPayload and StatusPayload in GITHUB_PAYLOAD_CLASSES and add detection rules for check_suite and status. A status payload names no wrapper object, so its rule matches the payload's own sha, state and context keys. The models keep what a CI gate needs: the result (conclusion or state), the head sha, the branch, the associated pull requests and, for a check run, its name and URL. The suite nested in a check run is optional and keeps only its branch, so a run that carries a reduced suite still parses. Requested-types, capabilities and preflight read the registry, so a CI-gate automation can now trigger on status, check_suite.completed or check_run.completed with a filter such as state == 'failure' or check_suite.conclusion == 'failure'. Tests cover detection and parsing of the three events, a forwarded failed status creating a run, and preflight accepting a type that has no action. The verify-automation feature map uses workflow_job as its unsupported GitHub example and expects ten parseable families and ten detection rules.
Merged
3 tasks
This was referenced Nov 19, 2026
Merged
Contributor
|
Warning Your comment is too long (maximum is 65536 characters), so the coverage report was not added. See the job log for how to reduce it. |
Contributor
|
🚀 Released in 1.34.0. |
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.
Native GitHub automations could not trigger on a CI result other than
workflow_run.statusandcheck_suitehad neither a detection rule nor a payload class, andcheck_runhad a detection rule and no parser. Everything downstream readsGITHUB_PAYLOAD_CLASSES:GET /v1/events/github/requested-typesomitted the three types, so the OpenHands server dropped every delivery; capabilities did not offer them, so the event key picker never listed them; and preflight rejectedon: statusoron: check_suite.completedas a type the deployment cannot parse. A customer who gates a pipeline on whether CI went green or red on a commit had to register a custom webhook for it.event_schemas/github.py:CheckSuitePayload(check_suite.completed),CheckRunPayload(check_run.created,check_run.completed) andStatusPayload(status, which has no action), registered under their event types, plus detection rules forcheck_suiteandstatus. A status payload has no wrapper object, so its rule matches the payload's ownsha,stateandcontextkeys. The models carry what a CI gate needs: the result (conclusionorstate), head sha, branch, the associated pull requests and, for a check run, its name andhtml_url; a status keeps itscontext,description,target_urland branches.conclusionis null until a suite or run completes andhead_branchis null for a commit on a fork. The suite nested in a check run is optional and keeps only its branch, so a run that carries a reduced suite still parses.check_runtoworkflow_job, and the requested-types recipe expects ten families and ten detection rules.Once the OpenHands server refreshes requested types (five-minute cache) it forwards the three events, Agent Canvas lists
check_run.*,check_suite.*andstatusin the event key picker, and preflight accepts them. A CI gate filters on the payload, for examplestate == 'failure'orcheck_suite.conclusion == 'failure' && check_suite.app.slug == 'github-actions'. GitHub reports each result separately: Actions creates a check suite per workflow run, and a status fires on every state change includingpending, so one commit sends several of these events and nothing here aggregates them.Tests:
uv run pytest tests/test_event_schemas.py tests/test_event_router.py tests/test_capabilities_router.py tests/test_verify_automation_skill.py— 217 passed. New cases:test_detect_check_suite,test_detect_check_runandtest_detect_status(detection and typed parse),test_receive_github_status_failure_creates_run(a signed forwarded delivery answersmatched: 1with one run), thetype-without-an-actionpreflight case, and the requested-types and capabilities lists now include the types. Onmainthe schema test module fails to import the new payload classes, andtest_requested_github_event_types_returns_supported_event_families,test_receive_github_status_failure_creates_run,test_configured_deployment_advertises_event_supportandtest_event_types_are_checked_against_what_the_deployment_parses[type-without-an-action]fail.ruff check,ruff format --check,pycodestyleandpyrightare clean. The check suite and check run field shapes were compared with the objects the GitHub REST API returns for this repository; the status shape follows GitHub's webhook documentation.Not exercised against a live install.
GitHub sends these events only to an app that subscribes to them, and every delivery of a parsed type is forwarded and recorded, so
check_run(sent for every CI job) is best left to installs that need the result of a single check.Companion changes: the GitHub App setup helper subscribes new apps to Status and Check suite and requests the Checks permission read-only (OpenHands/OpenHands-Cloud#1644), the docs list the events with a CI gate example (OpenHands/docs#1163), and the openhands-automation skill table lists their keys (OpenHands/extensions#965). Apps created before the helper change need the events enabled under Permissions & events, plus the Checks permission for the check events.
Tracking: OHE-4122.