fix(desktop): accept every check conclusion GitHub reports

Closed
AK
1mo ago
+84-3

What & why

GHPRResponseSchema rejected the STARTUP_FAILURE and STALE check conclusions, and parsePRListResponse drops a pull request whose validation fails, so a pull request with a check run that failed to start vanished from the workspace view.

What changed:

  • types.ts: add STARTUP_FAILURE and STALE to the conclusion enum.
  • pr-resolution.ts: parseChecks and computeChecksStatus treat STARTUP_FAILURE as a failure, matching the host-service mapper in #8963 and the mobile client. STALE stays pending, as in the host-service mapper. parseChecks is exported so the mapping is testable, like computeChecksStatus.

The host-service side of the same gap is #8962 / #8963.

Fixes #9141

How I tested it

  • types.test.ts: the schema accepts both conclusions and keeps both rollup entries.
  • pr-resolution.test.ts: computeChecksStatus returns failure for STARTUP_FAILURE alone and beside a success; parseChecks maps it to failure and leaves STALE pending.
  • Without the change the schema tests fail (both safeParse calls reject) and parseChecks is missing.
  • bun test src/lib/trpc/routers/workspaces/utils/github in apps/desktop: 50 pass, 0 fail.
  • bun run lint clean. bun run typecheck clean for @superset/desktop.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint passes, and bun run typecheck passes for the packages this PR touches. Repo-wide bun run typecheck fails on main in @superset/relay and @superset/sandbox before this change, unrelated to it.
  • "Allow edits from maintainers" is checked on fork PRs
  • I have signed the CLA (the bot asks on your first PR)

Summary by cubic

Fixes pull requests with STARTUP_FAILURE or STALE check runs disappearing from the desktop workspace view. GHPRResponseSchema rejected both conclusions, and parsePRListResponse drops a pull request whose validation fails.

Bug Fixes

  • Accepts STARTUP_FAILURE and STALE in the check conclusion enum.
  • Maps STARTUP_FAILURE to failure in parseChecks and computeChecksStatus, matching the host-service mapper and the mobile client.
  • Treats STALE as pending in both parseChecks and computeChecksStatus so a rollup of only stale runs is not reported as success.
  • Exports parseChecks and adds tests for schema acceptance and status mapping.

Summary by CodeRabbit

  • Bug Fixes
    • GitHub pull request checks now handle startup failures and stale check results more accurately. Startup failures are reported as failed, while stale checks remain pending instead of being misclassified.
    • Pull requests containing these check results can now be processed without losing supported status information.