Confused about BasePaths #836
-
Hi, I'm confused about NodeBasePaths. There are contradictions between the documentation, and the config samples.
the init command will create: "NodeBasePaths": [
"Product\\Area\\Path1",
"Product\\Area\\Path2"
] Should I use a the \ prefix or not ? So, I read the syntax as "{TeamProjectName}\Area{SomeSubArea}". If I navigate to the portal, I'll find under Project Configuration > Areas:
And when I query the REST api, the output will give me With the prefix \ Also, from the code's ShouldCreateNode: string nodePath = string.Format(@"{0}\{1}", parentPath.Path, newNodeName); When debugging, the nodePath is set to "{TargetTeamProjectName}\Area{newNodeName}" and right after: var split = nodePath.Split('\\');
var removeProjectAndType = split.Skip(3);
var path = string.Join(@"\", removeProjectAndType); the path strips out the {TargetTeamProjectName}\Area so the path the code works with is: "{newNodeName}" The foreach loops the nodeBasePaths to identify an entry that matches the path. But the path is actually a "subfolder", so from what I read from that code is that the nodeBasePath should actually {newNodeName} and not the whole "{TargetTeamProjectName}\Area{newNodeName}" Also, note that I believe that there's a bug in the for() for (int i = 0; i < splitBase.Length; i++)
{
if (string.Equals(path, string.Join(@"\", splitBase.Take(i)), StringComparison.InvariantCultureIgnoreCase))
{
return true;
}
} A splitBase.Take(0) doesn't make sense, shouldn't it actually start at 1 and end with the maximum being actually the length of the array: Proposed: for (int i = 1; i <= splitBase.Length; i++)
{
if (string.Equals(path, string.Join(@"\", splitBase.Take(i)), StringComparison.InvariantCultureIgnoreCase))
{
return true;
}
} Or, use foreach() The same questionning goes for the next part, since it's comparing the nodeBasePaths and "path" which is the "{newNodeName}" if (!_nodeBasePaths.Any(p => path.StartsWith(p, StringComparison.InvariantCultureIgnoreCase)))
{
Log.LogWarning("The node {nodePath} is being excluded due to your basePath setting. ", nodePath);
return false;
} So, seems to me that the syntax of the NodeBasePaths be any "subfolder".
Sources: Documentation for [obsolete] NodeStructruresMigrationConfig.md |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Do not include the Team Project Name as part of the value (source path). Here is an example: "ADP meetings v 0.1.1", |
Beta Was this translation helpful? Give feedback.
Do not include the Team Project Name as part of the value (source path). Here is an example:
"ADP meetings v 0.1.1",
"GAS1.4\Release 1.4.4\1.4.4 - Sprint 1",
"GAS1.4\Release 1.4.4\1.4.4 - Sprint 3",
"GAS1.4\Release 1.4.4",
"GAS1.4\Release 1.4.4\1.4.4 - Sprint 4"