get_commit
Retrieve detailed information about a specific commit in Alibaba Cloud DevOps repositories using organization ID, repository ID, and commit SHA values.
Instructions
[Code Management] Get information about a commit
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organizationId | Yes | 组织ID | |
| repositoryId | Yes | 代码库ID或者URL-Encoder编码的全路径 | |
| sha | Yes | 提交ID,即Commit SHA值 |
Implementation Reference
- tool-registry/commit.ts:15-19 (registration)Registration of the 'get_commit' tool in the commit tools array, including name, description, and input schema.{ name: 'get_commit', description: '[Code Management] Get information about a commit', inputSchema: zodToJsonSchema(GetCommitRequestSchema), },
- tool-handlers/commit.ts:25-30 (handler)Handler case in handleCommitTools that parses arguments, calls getCommit, and formats the response for the 'get_commit' tool.case 'get_commit': const getCommitParams = GetCommitRequestSchema.parse(request.params.arguments); const getCommitResult = await getCommit(getCommitParams); return { content: [{ type: "text", text: JSON.stringify(getCommitResult, null, 2) }], };
- operations/codeup/commits.ts:130-142 (handler)Core implementation of getCommit: constructs API URL and fetches commit details using yunxiaoRequest.export async function getCommit(params: z.infer<typeof GetCommitRequestSchema>) { const { organizationId, repositoryId, sha } = params; const encodedRepoId = handleRepositoryIdEncoding(repositoryId); const url = `/oapi/v1/codeup/organizations/${organizationId}/repositories/${encodedRepoId}/commits/${sha}`; const response: any = await yunxiaoRequest(url, { method: "GET", }); return DevopsCommitVOSchemaType.parse(response); }
- operations/codeup/commits.ts:22-26 (schema)Zod schema defining input parameters for get_commit: organizationId, repositoryId, sha.export const GetCommitRequestSchema = z.object({ organizationId: z.string().describe("组织ID"), repositoryId: z.string().describe("代码库ID或者URL-Encoder编码的全路径"), sha: z.string().describe("提交ID,即Commit SHA值"), });