gitlab_retry_pipeline
Retry failed GitLab pipelines to resume CI/CD workflows after errors. Specify project path and pipeline ID to restart execution.
Instructions
Retries a failed pipeline.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | The path of the GitLab project. | |
| pipelineId | Yes | The ID of the pipeline to retry. |
Implementation Reference
- src/index.ts:718-735 (registration)Registration of the 'gitlab_retry_pipeline' tool, including its description and input schema definition.{ name: 'gitlab_retry_pipeline', description: 'Retries a failed pipeline.', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'The path of the GitLab project.', }, pipelineId: { type: 'number', description: 'The ID of the pipeline to retry.', }, }, required: ['projectPath', 'pipelineId'], }, },
- src/index.ts:1856-1870 (handler)The main handler for the gitlab_retry_pipeline tool within the CallToolRequest handler's switch statement. Extracts arguments and calls GitLabService.retryPipeline.case 'gitlab_retry_pipeline': { if (!gitlabService) { throw new Error('GitLab service is not initialized.'); } const { projectPath, pipelineId } = args as { projectPath: string; pipelineId: number }; const result = await gitlabService.retryPipeline(projectPath, pipelineId); return { content: [ { type: 'text', text: `Pipeline retry triggered successfully: ${JSON.stringify(result, null, 2)}`, }, ], }; }
- src/gitlab.service.ts:589-595 (helper)Helper method in GitLabService class that implements the core logic: POST request to GitLab API to retry the specified pipeline.async retryPipeline(projectPath: string, pipelineId: number): Promise<any> { const encodedProjectPath = encodeURIComponent(projectPath); return this.callGitLabApi<any>( `projects/${encodedProjectPath}/pipelines/${pipelineId}/retry`, 'POST', ); }