Skip to content

Commit bd9af0b

Browse files
authored
Update runId field to be optional in pipeline configuration (#1102)
This pull request makes a small change to the pipeline tools to improve flexibility and robustness. The main change is making the `runId` property optional in the pipeline resource schema, which allows for pipeline runs that may not have a referenced source run. ## GitHub issue number #1101 ## **Associated Risks** N/A ## ✅ **PR Checklist** - [x] **I have read the [contribution guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CONTRIBUTING.md)** - [x] **I have read the [code of conduct guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CODE_OF_CONDUCT.md)** - [x] Title of the pull request is clear and informative. - [x] 👌 Code hygiene - [x] 🔭 Telemetry added, updated, or N/A - [x] 📄 Documentation added, updated, or N/A - [x] 🛡️ Automated tests added, or N/A ## 🧪 **How did you test it?** Ran automated tests. Manual check
1 parent 2c42e5f commit bd9af0b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/tools/pipelines.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ function configurePipelineTools(server: McpServer, tokenProvider: () => Promise<
387387
pipelines: z.record(
388388
z.string().describe("Name of the pipeline resource."),
389389
z.object({
390-
runId: z.coerce.number().min(1).describe("Id of the source pipeline run that triggered or is referenced by this pipeline run."),
390+
runId: z.coerce.number().min(1).optional().describe("Id of the source pipeline run that triggered or is referenced by this pipeline run."),
391391
version: z.string().optional().describe("Version of the source pipeline run."),
392392
})
393393
),
@@ -439,6 +439,7 @@ function configurePipelineTools(server: McpServer, tokenProvider: () => Promise<
439439
const pipelineRun = await pipelinesApi.runPipeline(runRequest, project, pipelineId, pipelineVersion);
440440
const queuedBuild = { id: pipelineRun.id };
441441
const buildId = queuedBuild.id;
442+
442443
if (buildId === undefined) {
443444
throw new Error("Failed to get build ID from pipeline run");
444445
}

0 commit comments

Comments
 (0)