list_change_request_patch_sets
Retrieve patch sets for a specific change request in Alibaba Cloud DevOps to track code modifications and review updates during development.
Instructions
[Code Management] List patch sets for a change request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organizationId | Yes | Organization ID, can be found in the basic information page of the organization admin console | |
| repositoryId | Yes | Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F) | |
| localId | Yes | Local ID, represents the nth merge request in the repository |
Implementation Reference
- tool-handlers/code-management.ts:278-289 (handler)MCP tool handler: parses arguments with ListChangeRequestPatchSetsSchema, calls listChangeRequestPatchSetsFunc, returns JSON stringified patch sets.case "list_change_request_patch_sets": { const args = types.ListChangeRequestPatchSetsSchema.parse(request.params.arguments); const patchSets = await changeRequests.listChangeRequestPatchSetsFunc( args.organizationId, args.repositoryId, args.localId ); return { content: [{ type: "text", text: JSON.stringify(patchSets, null, 2) }], }; }
- Core implementation: encodes repository ID, calls API /changeRequests/{localId}/diffs/patches, parses response array with PatchSetSchema.export async function listChangeRequestPatchSetsFunc( organizationId: string, repositoryId: string, localId: string ): Promise<z.infer<typeof PatchSetSchema>[]> { const encodedRepoId = handleRepositoryIdEncoding(repositoryId); const url = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}/changeRequests/${localId}/diffs/patches`; const response = await yunxiaoRequest(url, { method: "GET", }); // 确保响应是数组 if (!Array.isArray(response)) { return []; } // 解析每个版本对象 return response.map(patchSet => PatchSetSchema.parse(patchSet)); }
- tool-registry/code-management.ts:104-108 (registration)Tool registration: defines name, description, and converts Zod input schema to JSON schema.{ name: "list_change_request_patch_sets", description: "[Code Management] List patch sets for a change request", inputSchema: zodToJsonSchema(types.ListChangeRequestPatchSetsSchema), },
- operations/codeup/types.ts:355-359 (schema)Input schema definition using Zod: requires organizationId, repositoryId, localId with descriptions.export const ListChangeRequestPatchSetsSchema = z.object({ organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"), repositoryId: z.string().describe("Repository ID or a combination of organization ID and repository name, for example: 2835387 or organizationId%2Frepo-name (Note: slashes need to be URL encoded as %2F)"), localId: z.string().describe("Local ID, represents the nth merge request in the repository"), });