Skip to content

Post testhub build and test statuses to GitHub commits - #163

Merged
wmwolf merged 1 commit into
masterfrom
feature-github-status
Dec 1, 2026
Merged

wmwolf merged 1 commit into
masterfrom
feature-github-status

Conversation

@wmwolf

@wmwolf wmwolf commented Dec 1, 2026

Copy link
Copy Markdown
Member

What

The testhub can now post two commit statuses to MESAHub/mesa. A PR then shows them for its head commit, next to the GitHub Actions checks:

  • testhub/build
    • Success once a computer builds the commit and none fails.
    • Failures are judged per computer and toolchain. A failed build that the same computer and toolchain later built successfully (a retry) doesn't count. A failure with one SDK next to a success with another still does.
  • testhub/tests
    • Success once one computer has run every test with full inlists, plus any [ci fpe] / [ci converge] mode the commit asks for, and no matrix cell has failed on any computer.
    • FPE failures count.
    • Mixed cells, where one computer's repeat runs in one configuration disagree, are ignored.
    • Pending descriptions say what's missing, e.g. full inlists 412/530 (tycho).

[ci skip] commits get no statuses. Full rules and rollout steps are in docs/github-status.md.

Why

So a PR page shows whether its latest commit is ready to merge as far as testing goes. This is dispatcher Phase F; the design was settled in the roadmap's backlog entry.

How

  • GithubStatus (service) decides the states.
    • It reuses test_computer_matrix for failures.
    • It uses a new Commit#ci_coverage for single-computer coverage. That query is pulled out of refresh_ci_satisfaction!, which now shares it.
  • GithubStatusJob posts them with GIT_TOKEN. It's enqueued:
    • after CommitRefreshJob, which is already debounced per burst of results;
    • after BranchSyncJob moves a branch head, so a new PR head shows "pending" right away.
  • The job posts a context only when its state or description changes. The new github_commit_statuses table records what was last posted.
  • Rate limits, 5xx and network errors are retried. Other 4xx errors are logged and dropped.
  • Rake tasks github_statuses:post (SHA=/BRANCH=, FORCE=1) and github_statuses:heads post statuses by hand.

Rollout

The feature is off by default. Nothing is enqueued or posted until GITHUB_STATUSES_ENABLED=1 is set on the Railway service. After merging and deploying:

  1. Set the variable.
  2. Optionally run rake github_statuses:heads on the service.
  3. Check a PR.

GIT_TOKEN's repo scope already covers writing statuses. Statuses will appear as posted by MESA-testhub.

Testing

  • New specs for the rules (spec/services/github_status_spec.rb) and for the job (posting, skip-if-unchanged, force, [ci skip], off switch, error handling, enqueue hooks).
  • A branch-sync spec checks the push trigger.
  • The full suite passes locally (717 examples).
  • Not yet tested against the real GitHub API: no status has been posted to GitHub yet.

🤖 Generated with Claude Code

A PR now shows two testhub checks for its head commit, beside MESA's
GitHub Actions checks, so reviewers can see whether it's ready to merge
as far as testing goes (dispatcher Phase F).

- testhub/build: success once a computer builds and none fails. Failures
  are judged per computer and toolchain, so a retried build that
  succeeded doesn't count against the commit.
- testhub/tests: success once one computer has run every test with full
  inlists (plus any [ci fpe] / [ci converge] mode the commit asks for)
  and no matrix cell has failed on any computer. Mixed cells (one
  computer's repeat runs disagreeing in one configuration) are ignored.

GithubStatus decides what the statuses say. GithubStatusJob posts them
after CommitRefreshJob (once per burst of results) and after a push
moves a branch head. It posts a context only when its state or
description changes, recorded in the new github_commit_statuses table.
It's off unless GITHUB_STATUSES_ENABLED=1. The rake tasks
github_statuses:post and :heads post by hand.

Commit#ci_coverage pulls out the single-computer coverage query that
refresh_ci_satisfaction! already used, so both share it.
@wmwolf
wmwolf merged commit b4bf24c into master Dec 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant