From 1a160e55c1cf1f7919d44f48cbf02c328efe167f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Tue, 1 Sep 2026 17:27:19 +0200 Subject: [PATCH] Parse branch patch targets Heartwood's `MergeTarget` gained a `Branch` variant, so `target` can be an object now. One such patch failed the parse for the whole patch list. --- http-client/index.ts | 2 ++ http-client/lib/repo/patch.ts | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/http-client/index.ts b/http-client/index.ts index e663d19ba..64f2fea6b 100644 --- a/http-client/index.ts +++ b/http-client/index.ts @@ -35,6 +35,7 @@ import type { Issue, IssueState } from "./lib/repo/issue.js"; import type { LifecycleState, Merge, + MergeTarget, Patch, PatchState, Review, @@ -88,6 +89,7 @@ export type { LifecycleState, Location, Merge, + MergeTarget, Patch, PatchState, PeerRefs, diff --git a/http-client/lib/repo/patch.ts b/http-client/lib/repo/patch.ts index caafb7fe6..534e95067 100644 --- a/http-client/lib/repo/patch.ts +++ b/http-client/lib/repo/patch.ts @@ -34,6 +34,13 @@ const patchStateSchema = union([ }), ]); +export type MergeTarget = z.infer; + +const mergeTargetSchema = union([ + literal("delegates"), + object({ branch: string() }), +]); + export type Merge = z.infer; const mergeSchema = object({ @@ -89,7 +96,7 @@ export const patchSchema = object({ author: authorSchema, title: string(), state: patchStateSchema, - target: string(), + target: mergeTargetSchema, labels: array(string()), merges: array(mergeSchema), assignees: array(authorSchema),