diff --git a/docs/Reference/v1/Processors/WorkItemMigrationContext-notes.md b/docs/Reference/v1/Processors/WorkItemMigrationContext-notes.md index ad010b404..767ce6333 100644 --- a/docs/Reference/v1/Processors/WorkItemMigrationContext-notes.md +++ b/docs/Reference/v1/Processors/WorkItemMigrationContext-notes.md @@ -41,11 +41,11 @@ Scope to Area Path (Team data): ## NodeBasePath Configuration -Moved to the ProcessorEnricher [TfsNodeStructure](../Reference/v2/ProcessorEnrichers/TfsNodeStructure/) +Moved to the ProcessorEnricher [TfsNodeStructure](/Reference/v2/ProcessorEnrichers/TfsNodeStructure/) # Iteration Maps and Area Maps -Moved to the ProcessorEnricher [TfsNodeStructure](../Reference/v2/ProcessorEnrichers/TfsNodeStructure/) +Moved to the ProcessorEnricher [TfsNodeStructure](/Reference/v2/ProcessorEnrichers/TfsNodeStructure/) @@ -78,4 +78,4 @@ A complete list of [FieldMaps](../Reference/v1/FieldMaps/index.md) are available # Removed Properties -- PrefixProjectToNodes - This option was removed in favour of the Area and Iteration Maps on [TfsNodeStructure](../Reference/v2/ProcessorEnrichers/TfsNodeStructure/) \ No newline at end of file +- PrefixProjectToNodes - This option was removed in favour of the Area and Iteration Maps on [TfsNodeStructure](/Reference/v2/ProcessorEnrichers/TfsNodeStructure/) \ No newline at end of file diff --git a/docs/Reference/v2/ProcessorEnrichers/TfsNodeStructure-notes.md b/docs/Reference/v2/ProcessorEnrichers/TfsNodeStructure-notes.md index 871848ab0..7d743c140 100644 --- a/docs/Reference/v2/ProcessorEnrichers/TfsNodeStructure-notes.md +++ b/docs/Reference/v2/ProcessorEnrichers/TfsNodeStructure-notes.md @@ -109,6 +109,20 @@ in the replacement string. `TargetProject\NewArea\ValidArea\` but `OriginalProject\DescopeThis` would not be modified by this rule. +### PrefixProjectToNodes + +The `PrefixProjectToNodes` was an option that was used to prepend the source project name to the target set of nodes. This was super valuable when the target Project already has nodes and you dont want to merge them all together. This is now replaced by the `AreaMaps` and `IterationMaps` options. + +``` +"IterationMaps": { + "^SourceServer\\\\(.*)" , "TargetServer\\SourceServer\\$1", +}, +"AreaMaps": { + "^SourceServer\\\\(.*)" , "TargetServer\\SourceServer\\$1", +} +``` + + ### More Complex Regex Before your migration starts it will validate that all of the Areas and Iterations from the **Source** work items revisions exist on the **Target**. Any that do not exist will be flagged in the logs and if and the migration will stop just after it outputs a list of the missing nodes. diff --git a/docs/collections/_reference/reference.v2.processorenrichers.tfsnodestructure.md b/docs/collections/_reference/reference.v2.processorenrichers.tfsnodestructure.md index a9f897528..7898afd19 100644 --- a/docs/collections/_reference/reference.v2.processorenrichers.tfsnodestructure.md +++ b/docs/collections/_reference/reference.v2.processorenrichers.tfsnodestructure.md @@ -69,73 +69,25 @@ topics: - topic: notes path: /docs/Reference/v2/ProcessorEnrichers/TfsNodeStructure-notes.md exists: true - markdown: >- - ## NodeBasePath Configuration ## + markdown: >2- - The `NodeBasePaths` entry allows the filtering of the nodes to be replicated on the target projects. To try to explain the correct usage let us assume that we have a source team project `SourceProj` with the following node structures - - - - AreaPath - - SourceProj - - SourceProj\Team 1 - - SourceProj\Team 2 - - SourceProj\Team 2\Sub-Area - - SourceProj\Team 3 - - IterationPath - - SourceProj - - SourceProj\Sprint 1 - - SourceProj\Sprint 2 - - SourceProj\Sprint 2\Sub-Iteration - - SourceProj\Sprint 3 - - Depending upon what node structures you wish to migrate you would need the following settings. Exclusions are also possible by prefixing a path with an exclamation mark `!`. Example are - - - | | | - - |-|-| - - | Intention | Migrate all areas and iterations and all Work Items - - | NodeBasePath | `[]` - - | Comment | The same AreaPath and Iteration Paths are created on the target as on the source. Hence, all migrated WI remain in their existing area and iteration paths - - || - | Intention | Only migrate area path `Team 2` and it associated Work Items, but all iteration paths - | NodeBasePath | `["Team 2", "Sprint"]` + ## Iteration Maps and Area Maps - | Comment | Only the area path ending `Team 2` will be migrated.
The `WIQLQueryBit` should be edited to limit the WI migrated to this area path e.g. add `AND [System.AreaPath] UNDER 'SampleProject\\Team 2'` .
The migrated WI will have an area path of `TargetProj\Team 2` but retain their iteration paths matching the sprint name on the source - || + **NOTE: It is NOT posible to migrate a work item if the Area or Iteration path does not exist on the target project. This is because the work item will be created with the same Area and Iteration path as the source work item. If the path does not exist, the work item will not be created. _There is not way around this!_** - | Intention | Only migrate iterations structure - | NodeBasePath | `["Sprint"]` + You have two options to solve this problem: - | Comment | Only the area path ending `Team 2` will be migrated
All the iteration paths will be migrated.
The migrated WI will have the default area path of `TargetProj` as their source area path was not migrated i.e. `TargetProj`
The migrated WI will have an iteration path match the sprint name on the source - || + 1. You can manualy create the mentioned work items. This is a good option if you have a small number of work items or a small number of missing nodes. This will not work if you have work items that were moved from one project to another. Those Nodes are imposible to create in the target project. - | Intention | Move all WI to the existing area and iteration paths on the targetProj + 1. You can use the `AreaMaps` and `IterationMaps` to remap the nodes to existing nodes in the target project. This is a good option if you have a large number of work items or a large number of missing nodes. - | NodeBasePath | `["DUMMY VALUE"]` - | Comment | As the `NodeBasePath` does not match any source area or iteration path no nodes are migrated.
Migrated WI will be assigned to any matching area or iteration paths. If no matching ones can be found they will default to the respective root values - - || - - | Intention | Move the `Team 2` area, but not its `Sub-Area` - - | NodeBasePath | `["Team 2", "!Team 2\\SubArea"]` - - | Comment | The Work Items will have to be restricted to the right areas, e.g. with `AND [System.AreaPath] UNDER 'SampleProject\\Team 2' AND [System.AreaPath] NOT UNDER 'SampleProject\\Team 2\\Sub-Area'`, otherwise their migratin will fail - - - - # Iteration Maps and Area Maps + ### Overview These two configuration elements apply after the `NodeBasePaths` selector, i.e. @@ -201,7 +153,8 @@ topics: in the replacement string. - #### Examples explained + + ### Configuration ```json @@ -273,13 +226,13 @@ topics: Before your migration starts it will validate that all of the Areas and Iterations from the **Source** work items revisions exist on the **Target**. Any that do not exist will be flagged in the logs and if and the migration will stop just after it outputs a list of the missing nodes. - Our algorithm that converts the Source nodes to Target nodes processes the [mappings](https://nkdagility.com/learn/azure-devops-migration-tools/Reference/v1/Processors/WorkItemMigrationContext/#iteration-maps-and-area-maps) at that time. This means that any valid mapped nodes will never be caught by the `This path is not anchored in the source project` message as they are already altered to be valid. + Our algorithm that converts the Source nodes to Target nodes processes the mappings at that time. This means that any valid mapped nodes will never be caught by the `This path is not anchored in the source project` message as they are already altered to be valid. > We recently updated the logging for this part of the system to more easily debug both your mappings and to see what they system is doing with the nodes and their current state. You can set `"LogLevel": "Debug"` to see the details. - To add a mapping, you can follow [the documentation](https://nkdagility.com/learn/azure-devops-migration-tools/Reference/v1/Processors/WorkItemMigrationContext/#iteration-maps-and-area-maps) with this being the simplest way: + To add a mapping, you can follow the documentation with this being the simplest way: ``` @@ -381,6 +334,70 @@ topics: ], ``` + + + ## NodeBasePath Configuration + + The `NodeBasePaths` entry allows the filtering of the nodes to be replicated on the target projects. To try to explain the correct usage let us assume that we have a source team project `SourceProj` with the following node structures + + + - AreaPath + - SourceProj + - SourceProj\Team 1 + - SourceProj\Team 2 + - SourceProj\Team 2\Sub-Area + - SourceProj\Team 3 + - IterationPath + - SourceProj + - SourceProj\Sprint 1 + - SourceProj\Sprint 2 + - SourceProj\Sprint 2\Sub-Iteration + - SourceProj\Sprint 3 + + Depending upon what node structures you wish to migrate you would need the following settings. Exclusions are also possible by prefixing a path with an exclamation mark `!`. Example are + + + | | | + + |-|-| + + | Intention | Migrate all areas and iterations and all Work Items + + | NodeBasePath | `[]` + + | Comment | The same AreaPath and Iteration Paths are created on the target as on the source. Hence, all migrated WI remain in their existing area and iteration paths + + || + + | Intention | Only migrate area path `Team 2` and it associated Work Items, but all iteration paths + + | NodeBasePath | `["Team 2", "Sprint"]` + + | Comment | Only the area path ending `Team 2` will be migrated.
The `WIQLQueryBit` should be edited to limit the WI migrated to this area path e.g. add `AND [System.AreaPath] UNDER 'SampleProject\\Team 2'` .
The migrated WI will have an area path of `TargetProj\Team 2` but retain their iteration paths matching the sprint name on the source + + || + + | Intention | Only migrate iterations structure + + | NodeBasePath | `["Sprint"]` + + | Comment | Only the area path ending `Team 2` will be migrated
All the iteration paths will be migrated.
The migrated WI will have the default area path of `TargetProj` as their source area path was not migrated i.e. `TargetProj`
The migrated WI will have an iteration path match the sprint name on the source + + || + + | Intention | Move all WI to the existing area and iteration paths on the targetProj + + | NodeBasePath | `["DUMMY VALUE"]` + + | Comment | As the `NodeBasePath` does not match any source area or iteration path no nodes are migrated.
Migrated WI will be assigned to any matching area or iteration paths. If no matching ones can be found they will default to the respective root values + + || + + | Intention | Move the `Team 2` area, but not its `Sub-Area` + + | NodeBasePath | `["Team 2", "!Team 2\\SubArea"]` + + | Comment | The Work Items will have to be restricted to the right areas, e.g. with `AND [System.AreaPath] UNDER 'SampleProject\\Team 2' AND [System.AreaPath] NOT UNDER 'SampleProject\\Team 2\\Sub-Area'`, otherwise their migratin will fail - topic: introduction path: /docs/Reference/v2/ProcessorEnrichers/TfsNodeStructure-introduction.md exists: true diff --git a/src/MigrationTools.Clients.AzureDevops.ObjectModel.Tests/MigrationTools.Clients.AzureDevops.ObjectModel.Tests.csproj b/src/MigrationTools.Clients.AzureDevops.ObjectModel.Tests/MigrationTools.Clients.AzureDevops.ObjectModel.Tests.csproj index f3db041f9..0bc0b65c1 100644 --- a/src/MigrationTools.Clients.AzureDevops.ObjectModel.Tests/MigrationTools.Clients.AzureDevops.ObjectModel.Tests.csproj +++ b/src/MigrationTools.Clients.AzureDevops.ObjectModel.Tests/MigrationTools.Clients.AzureDevops.ObjectModel.Tests.csproj @@ -11,11 +11,11 @@ - + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/MigrationTools.Clients.AzureDevops.Rest.Tests/MigrationTools.Clients.AzureDevops.Rest.Tests.csproj b/src/MigrationTools.Clients.AzureDevops.Rest.Tests/MigrationTools.Clients.AzureDevops.Rest.Tests.csproj index 9e157d3e0..97a410500 100644 --- a/src/MigrationTools.Clients.AzureDevops.Rest.Tests/MigrationTools.Clients.AzureDevops.Rest.Tests.csproj +++ b/src/MigrationTools.Clients.AzureDevops.Rest.Tests/MigrationTools.Clients.AzureDevops.Rest.Tests.csproj @@ -8,10 +8,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/MigrationTools.Clients.FileSystem.Tests/MigrationTools.Clients.FileSystem.Tests.csproj b/src/MigrationTools.Clients.FileSystem.Tests/MigrationTools.Clients.FileSystem.Tests.csproj index 983785e3c..b3775ae29 100644 --- a/src/MigrationTools.Clients.FileSystem.Tests/MigrationTools.Clients.FileSystem.Tests.csproj +++ b/src/MigrationTools.Clients.FileSystem.Tests/MigrationTools.Clients.FileSystem.Tests.csproj @@ -11,10 +11,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/MigrationTools.Clients.InMemory.Tests/MigrationTools.Clients.InMemory.Tests.csproj b/src/MigrationTools.Clients.InMemory.Tests/MigrationTools.Clients.InMemory.Tests.csproj index 1b4619967..e5dea422d 100644 --- a/src/MigrationTools.Clients.InMemory.Tests/MigrationTools.Clients.InMemory.Tests.csproj +++ b/src/MigrationTools.Clients.InMemory.Tests/MigrationTools.Clients.InMemory.Tests.csproj @@ -11,10 +11,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/MigrationTools.ConsoleDataGenerator/MigrationTools.ConsoleDataGenerator.csproj b/src/MigrationTools.ConsoleDataGenerator/MigrationTools.ConsoleDataGenerator.csproj index d9e46dbc8..52769ef72 100644 --- a/src/MigrationTools.ConsoleDataGenerator/MigrationTools.ConsoleDataGenerator.csproj +++ b/src/MigrationTools.ConsoleDataGenerator/MigrationTools.ConsoleDataGenerator.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/MigrationTools.Host.Tests/MigrationTools.Host.Tests.csproj b/src/MigrationTools.Host.Tests/MigrationTools.Host.Tests.csproj index be4826dc5..0caa3e6e3 100644 --- a/src/MigrationTools.Host.Tests/MigrationTools.Host.Tests.csproj +++ b/src/MigrationTools.Host.Tests/MigrationTools.Host.Tests.csproj @@ -16,10 +16,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/MigrationTools.Host/MigrationTools.Host.csproj b/src/MigrationTools.Host/MigrationTools.Host.csproj index ce61c15b7..896e00e70 100644 --- a/src/MigrationTools.Host/MigrationTools.Host.csproj +++ b/src/MigrationTools.Host/MigrationTools.Host.csproj @@ -14,7 +14,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -23,7 +23,7 @@ - + diff --git a/src/MigrationTools.Integration.Tests/MigrationTools.Integration.Tests.csproj b/src/MigrationTools.Integration.Tests/MigrationTools.Integration.Tests.csproj index da36aa230..2462d5a16 100644 --- a/src/MigrationTools.Integration.Tests/MigrationTools.Integration.Tests.csproj +++ b/src/MigrationTools.Integration.Tests/MigrationTools.Integration.Tests.csproj @@ -9,11 +9,11 @@ - + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/MigrationTools.Tests/MigrationTools.Tests.csproj b/src/MigrationTools.Tests/MigrationTools.Tests.csproj index d7807fe6b..3188fed48 100644 --- a/src/MigrationTools.Tests/MigrationTools.Tests.csproj +++ b/src/MigrationTools.Tests/MigrationTools.Tests.csproj @@ -9,11 +9,11 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/MigrationTools/MigrationTools.csproj b/src/MigrationTools/MigrationTools.csproj index c23ed87cd..966ed5d21 100644 --- a/src/MigrationTools/MigrationTools.csproj +++ b/src/MigrationTools/MigrationTools.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/VstsSyncMigrator.Core.Tests/VstsSyncMigrator.Core.Tests.csproj b/src/VstsSyncMigrator.Core.Tests/VstsSyncMigrator.Core.Tests.csproj index 6f851f3e0..06ccdefbd 100644 --- a/src/VstsSyncMigrator.Core.Tests/VstsSyncMigrator.Core.Tests.csproj +++ b/src/VstsSyncMigrator.Core.Tests/VstsSyncMigrator.Core.Tests.csproj @@ -7,11 +7,11 @@ - + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/VstsSyncMigrator.Core.Tests/WorkItemMigrationTests.cs b/src/VstsSyncMigrator.Core.Tests/WorkItemMigrationTests.cs index 89b48a7d1..6b8b31cab 100644 --- a/src/VstsSyncMigrator.Core.Tests/WorkItemMigrationTests.cs +++ b/src/VstsSyncMigrator.Core.Tests/WorkItemMigrationTests.cs @@ -94,10 +94,17 @@ public void TestFixAreaPath_WhenAreaPathInQuery_WithPrefixProjectToNodesEnabled_ var nodeStructure = _services.GetRequiredService(); // For this test we use the prefixing of the project node and no remapping rule + + nodeStructure.Configure(new TfsNodeStructureOptions { - AreaMaps = new Dictionary(), - IterationMaps = new Dictionary(), + AreaMaps = new Dictionary( ) + { + { "^SourceServer\\\\(.*)" , "TargetServer\\SourceServer\\$1" } + }, + IterationMaps = new Dictionary(){ + { "^SourceServer\\\\(.*)" , "TargetServer\\SourceServer\\$1" } + }, }); string WIQLQueryBit = @"SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.AreaPath] = 'SourceServer\Area\Path1' AND [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')"; @@ -150,8 +157,13 @@ public void TestFixAreaPath_WhenAreaPathInQuery_WithPrefixProjectToNodesEnabled_ // For this test we use the prefixing of the project node and no remapping rules nodeStructure.Configure(new TfsNodeStructureOptions { - AreaMaps = new Dictionary(), - IterationMaps = new Dictionary(), + AreaMaps = new Dictionary() + { + { "^SourceServer\\\\(.*)" , "TargetServer\\SourceServer\\$1" } + }, + IterationMaps = new Dictionary(){ + { "^SourceServer\\\\(.*)" , "TargetServer\\SourceServer\\$1" } + }, }); var WIQLQueryBit = @"SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.AreaPath] = 'Source Project\Area\Path1' AND [Microsoft.VSTS.Common.ClosedDate] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan')"; diff --git a/src/VstsSyncMigrator.Core/VstsSyncMigrator.Core.csproj b/src/VstsSyncMigrator.Core/VstsSyncMigrator.Core.csproj index e69f06e6f..a0bd0c186 100644 --- a/src/VstsSyncMigrator.Core/VstsSyncMigrator.Core.csproj +++ b/src/VstsSyncMigrator.Core/VstsSyncMigrator.Core.csproj @@ -22,7 +22,7 @@ - + all none