fix(host-service): treat a check run that failed to start as a failure

Merged
AK
1mo ago
+30-0

Fixes #8962

Problem

mapCheckRunStatus in pull-request-mappers.ts has no STARTUP_FAILURE case. A check run that GitHub reports as COMPLETED with that conclusion falls to the default branch and comes out as pending, so computeChecksStatus keeps the pull request pending. The workflow never started, so GitHub shows that check run as a failure, and the mobile client already maps this conclusion to failed.

Changes

  • Map STARTUP_FAILURE to failure in mapCheckRunStatus, next to TIMED_OUT and ACTION_REQUIRED.
  • Add two tests: the check status from parseCheckContexts, and the aggregate from parseCheckContexts plus computeChecksStatus.
  • Leave mapStatusContextState and STALE untouched.

Tests

  • pull-request-mappers.test.ts before the fix: 12 pass, 2 fail, both new tests. After the fix: 14 pass, 0 fail.
  • cd packages/host-service && bun test --pass-with-no-tests --parallel with bun 1.4.3: 2683 pass, 8 todo, 3 fail. The three failures are the terminal router integration tests that need a real pty daemon, and the same three fail on main.
  • A parallel run also times out at the 5 s limit on one or two unrelated tests now and then. Those tests pass in other runs and on main, so the extra timeout is run ordering, not this change. A run just now had only the three pty daemon failures.
  • biome check and biome format on the changed files report no issues. bun run typecheck is red on main because of unrelated @superset/trpc errors, and this change adds no new errors.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too). Lint passes on the changed files. Typecheck fails on main in @superset/trpc and is unrelated to this change.
  • "Allow edits from maintainers" is checked on fork PRs
  • I have signed the CLA (the bot asks on your first PR)