@azure-devops/mcp 2.4.0-nightly.20260120 → 2.4.0-nightly.20260122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tools/test-plans.js +40 -22
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/tools/test-plans.js
CHANGED
|
@@ -76,29 +76,47 @@ function configureTestPlanTools(server, _, connectionProvider) {
|
|
|
76
76
|
parentSuiteId: z.number().describe("ID of the parent suite under which the new suite will be created, if not given by user this can be id of a root suite of the test plan"),
|
|
77
77
|
name: z.string().describe("Name of the child test suite"),
|
|
78
78
|
}, async ({ project, planId, parentSuiteId, name }) => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
name
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
79
|
+
const maxRetries = 5;
|
|
80
|
+
const baseDelay = 500; // milliseconds
|
|
81
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
82
|
+
try {
|
|
83
|
+
const connection = await connectionProvider();
|
|
84
|
+
const testPlanApi = await connection.getTestPlanApi();
|
|
85
|
+
const testSuiteToCreate = {
|
|
86
|
+
name,
|
|
87
|
+
parentSuite: {
|
|
88
|
+
id: parentSuiteId,
|
|
89
|
+
name: "",
|
|
90
|
+
},
|
|
91
|
+
suiteType: 2,
|
|
92
|
+
};
|
|
93
|
+
const createdTestSuite = await testPlanApi.createTestSuite(testSuiteToCreate, project, planId);
|
|
94
|
+
return {
|
|
95
|
+
content: [{ type: "text", text: JSON.stringify(createdTestSuite, null, 2) }],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
100
|
+
// Check if it's a concurrency conflict error
|
|
101
|
+
const isConcurrencyError = errorMessage.includes("TF26071") || errorMessage.includes("got update") || errorMessage.includes("changed by someone else");
|
|
102
|
+
// If it's a concurrency error and we have retries left, wait and retry
|
|
103
|
+
if (isConcurrencyError && attempt < maxRetries) {
|
|
104
|
+
const delay = baseDelay * Math.pow(2, attempt) + Math.random() * 200; // Exponential backoff with jitter
|
|
105
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
106
|
+
continue; // Retry
|
|
107
|
+
}
|
|
108
|
+
// If not a concurrency error or out of retries, return error
|
|
109
|
+
return {
|
|
110
|
+
content: [{ type: "text", text: `Error creating test suite: ${errorMessage}` }],
|
|
111
|
+
isError: true,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
101
114
|
}
|
|
115
|
+
// This should never be reached, but TypeScript requires a return value
|
|
116
|
+
return {
|
|
117
|
+
content: [{ type: "text", text: "Error creating test suite: Maximum retries exceeded" }],
|
|
118
|
+
isError: true,
|
|
119
|
+
};
|
|
102
120
|
});
|
|
103
121
|
server.tool(Test_Plan_Tools.add_test_cases_to_suite, "Adds existing test cases to a test suite.", {
|
|
104
122
|
project: z.string().describe("The unique identifier (ID or name) of the Azure DevOps project."),
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "2.4.0-nightly.
|
|
1
|
+
export const packageVersion = "2.4.0-nightly.20260122";
|