Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 7e8636c

Browse files
committed
Pass tree structure as parameter instead of always using Areas
1 parent 2caee4f commit 7e8636c

File tree

1 file changed

+4
-4
lines changed
  • src/ApiService/ApiService/onefuzzlib/notifications

1 file changed

+4
-4
lines changed

src/ApiService/ApiService/onefuzzlib/notifications/Ado.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ private static bool IsTransient(Exception e) {
8989
return errorCodes.Any(errorStr.Contains);
9090
}
9191

92-
private static async Async.Task<OneFuzzResultVoid> ValidatePath(string project, string path, WorkItemTrackingHttpClient client) {
92+
private static async Async.Task<OneFuzzResultVoid> ValidatePath(string project, string path, TreeStructureGroup structureGroup, WorkItemTrackingHttpClient client) {
9393
var pathParts = path.Split('\\');
9494
var i = pathParts[0] == project ? 1 : 0;
9595

96-
var current = await client.GetClassificationNodeAsync(project, TreeStructureGroup.Areas, depth: pathParts.Length - i);
96+
var current = await client.GetClassificationNodeAsync(project, structureGroup, depth: pathParts.Length - i);
9797
if (current == null) {
9898
return OneFuzzResultVoid.Error(ErrorCode.ADO_VALIDATION_INVALID_PATH, new string[] {
9999
$"Path {path} is invalid. {project} is not a valid project",
@@ -190,7 +190,7 @@ await policy.ExecuteAsync(async () => {
190190
// Validate AreaPath exists
191191
try {
192192
if (config.AdoFields.TryGetValue("System.AreaPath", out var areaPathString)) {
193-
var validateAreaPath = await ValidatePath(config.Project, areaPathString, witClient);
193+
var validateAreaPath = await ValidatePath(config.Project, areaPathString, TreeStructureGroup.Areas, witClient);
194194
if (!validateAreaPath.IsOk) {
195195
return validateAreaPath;
196196
}
@@ -217,7 +217,7 @@ await policy.ExecuteAsync(async () => {
217217
// Validate IterationPath exists
218218
try {
219219
if (config.AdoFields.TryGetValue("System.IterationPath", out var iterationPathString)) {
220-
var validateIterationPath = await ValidatePath(config.Project, iterationPathString, witClient);
220+
var validateIterationPath = await ValidatePath(config.Project, iterationPathString, TreeStructureGroup.Iterations, witClient);
221221
if (!validateIterationPath.IsOk) {
222222
return validateIterationPath;
223223
}

0 commit comments

Comments
 (0)