From cb36c007cb215127c16e621ef5a0255c76a6cdbe Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Thu, 29 May 2025 20:38:14 -0700 Subject: [PATCH] [main] fix: make old_line and new_line optional for image diff discussions Image files in GitLab MR discussions use x/y coordinates instead of line numbers. This fix allows proper handling of image diff comments. Co-authored-by: Peter Xu --- schemas.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/schemas.ts b/schemas.ts index 4450e01..67b5e1e 100644 --- a/schemas.ts +++ b/schemas.ts @@ -618,21 +618,21 @@ export const GitLabDiscussionNoteSchema = z.object({ old_path: z.string(), new_path: z.string(), position_type: z.enum(["text", "image", "file"]), - old_line: z.number().nullable(), - new_line: z.number().nullable(), + old_line: z.number().nullish(), // This is missing for image diffs + new_line: z.number().nullish(), // This is missing for image diffs line_range: z .object({ start: z.object({ line_code: z.string(), type: z.enum(["new", "old", "expanded"]), - old_line: z.number().nullable(), - new_line: z.number().nullable(), + old_line: z.number().nullish(), // This is missing for image diffs + new_line: z.number().nullish(), // This is missing for image diffs }), end: z.object({ line_code: z.string(), type: z.enum(["new", "old", "expanded"]), - old_line: z.number().nullable(), - new_line: z.number().nullable(), + old_line: z.number().nullish(), // This is missing for image diffs + new_line: z.number().nullish(), // This is missing for image diffs }), }) .nullable()