feat: enhance CreateMergeRequest options with assignee, reviewer, and label support
This commit is contained in:
3
index.ts
3
index.ts
@ -1001,6 +1001,9 @@ async function createMergeRequest(
|
|||||||
description: options.description,
|
description: options.description,
|
||||||
source_branch: options.source_branch,
|
source_branch: options.source_branch,
|
||||||
target_branch: options.target_branch,
|
target_branch: options.target_branch,
|
||||||
|
assignee_ids: options.assignee_ids,
|
||||||
|
reviewer_ids: options.reviewer_ids,
|
||||||
|
labels: options.labels?.join(","),
|
||||||
allow_collaboration: options.allow_collaboration,
|
allow_collaboration: options.allow_collaboration,
|
||||||
draft: options.draft,
|
draft: options.draft,
|
||||||
}),
|
}),
|
||||||
|
17
schemas.ts
17
schemas.ts
@ -267,6 +267,13 @@ export const CreateMergeRequestOptionsSchema = z.object({
|
|||||||
description: z.string().optional(), // Changed from body to match GitLab API
|
description: z.string().optional(), // Changed from body to match GitLab API
|
||||||
source_branch: z.string(), // Changed from head to match GitLab API
|
source_branch: z.string(), // Changed from head to match GitLab API
|
||||||
target_branch: z.string(), // Changed from base to match GitLab API
|
target_branch: z.string(), // Changed from base to match GitLab API
|
||||||
|
assignee_ids: z
|
||||||
|
.array(z.number())
|
||||||
|
.optional(),
|
||||||
|
reviewer_ids: z
|
||||||
|
.array(z.number())
|
||||||
|
.optional(),
|
||||||
|
labels: z.array(z.string()).optional(),
|
||||||
allow_collaboration: z.boolean().optional(), // Changed from maintainer_can_modify to match GitLab API
|
allow_collaboration: z.boolean().optional(), // Changed from maintainer_can_modify to match GitLab API
|
||||||
draft: z.boolean().optional(),
|
draft: z.boolean().optional(),
|
||||||
});
|
});
|
||||||
@ -423,6 +430,7 @@ export const GitLabMergeRequestSchema = z.object({
|
|||||||
draft: z.boolean().optional(),
|
draft: z.boolean().optional(),
|
||||||
author: GitLabUserSchema,
|
author: GitLabUserSchema,
|
||||||
assignees: z.array(GitLabUserSchema).optional(),
|
assignees: z.array(GitLabUserSchema).optional(),
|
||||||
|
reviewers: z.array(GitLabUserSchema).optional(),
|
||||||
source_branch: z.string(),
|
source_branch: z.string(),
|
||||||
target_branch: z.string(),
|
target_branch: z.string(),
|
||||||
diff_refs: GitLabMergeRequestDiffRefSchema.nullable().optional(),
|
diff_refs: GitLabMergeRequestDiffRefSchema.nullable().optional(),
|
||||||
@ -612,6 +620,15 @@ export const CreateMergeRequestSchema = ProjectParamsSchema.extend({
|
|||||||
description: z.string().optional().describe("Merge request description"),
|
description: z.string().optional().describe("Merge request description"),
|
||||||
source_branch: z.string().describe("Branch containing changes"),
|
source_branch: z.string().describe("Branch containing changes"),
|
||||||
target_branch: z.string().describe("Branch to merge into"),
|
target_branch: z.string().describe("Branch to merge into"),
|
||||||
|
assignee_ids: z
|
||||||
|
.array(z.number())
|
||||||
|
.optional()
|
||||||
|
.describe("The ID of the users to assign the MR to"),
|
||||||
|
reviewer_ids: z
|
||||||
|
.array(z.number())
|
||||||
|
.optional()
|
||||||
|
.describe("The ID of the users to assign as reviewers of the MR"),
|
||||||
|
labels: z.array(z.string()).optional().describe("Labels for the MR"),
|
||||||
draft: z.boolean().optional().describe("Create as draft merge request"),
|
draft: z.boolean().optional().describe("Create as draft merge request"),
|
||||||
allow_collaboration: z
|
allow_collaboration: z
|
||||||
.boolean()
|
.boolean()
|
||||||
|
Reference in New Issue
Block a user