fix(hr-pr-followup): refuse to merge while a check on the head commit is unfinished or failed
`merge-pr.sh` could merge a pull request whose CI check was red or still running. `check-pr-review.ts`, which it calls, skipped every check that was not CodeRabbit or cubic.
It now also refuses:
- a check run that is not COMPLETED, or that concluded anything but SUCCESS, NEUTRAL or SKIPPED (failure, cancelled, timed out, action required, startup failure, stale, or no conclusion);
- a commit status that is not SUCCESS (pending and expected count as still running).
A head commit with no checks still passes, and `--wait` now also polls while another check runs. Review-bot rules are unchanged. The gate cannot tell required checks from optional ones, so a check that fails for a known unrelated reason blocks the merge until it passes or the owner lands another way. That is stated in `references/review-helpers.md`.
Related: #331 added the cubic rule; this does not touch it. No open or closed pull request or issue covers this change (searched "check head commit").
Checks run: `bun test skills/` 365 pass, `bun test test/` 543 pass and 8 skip, `node --test test/*.test.mjs` exit 0, oxlint (one existing warning in `test/install-ps1.test.mjs`), oxfmt `--check`. New tests cover each blocking conclusion, each passing conclusion, each run status, commit statuses and `--wait` polling.
Summary by cubic
merge-pr.sh no longer merges a pull request while any check on the head commit is unfinished or failed.
check-pr-review.ts previously checked only CodeRabbit and cubic, so a red or still-running CI check could slip through. It now also refuses check runs that are not COMPLETED or that concluded anything but SUCCESS, NEUTRAL or SKIPPED, and commit statuses that are not SUCCESS (PENDING and EXPECTED count as still running). A head commit with no checks still passes, and --wait now polls while another check runs. Since the gate cannot tell required checks from optional ones, a check failing for an unrelated reason blocks the merge until it passes or the owner lands another way; this caveat is documented in references/review-helpers.md.
Summary by CodeRabbit
- Bug Fixes
- Merge checks now wait for all checks on the pull request’s head commit to finish and pass. Failed, unfinished, cancelled, or timed-out checks block merging; successful, neutral, and skipped checks pass. Commit statuses must be successful to pass. Pull requests with no checks are not blocked.
- The wait option now polls while any check is still running.