mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-18 19:30:27 +08:00
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -34,6 +34,13 @@ const patchStateSchema = union([
|
||||
}),
|
||||
]);
|
||||
|
||||
export type MergeTarget = z.infer<typeof mergeTargetSchema>;
|
||||
|
||||
const mergeTargetSchema = union([
|
||||
literal("delegates"),
|
||||
object({ branch: string() }),
|
||||
]);
|
||||
|
||||
export type Merge = z.infer<typeof mergeSchema>;
|
||||
|
||||
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),
|
||||
|
||||
Reference in New Issue
Block a user