Skip to content

Commit c79be24

Browse files
committed
PR 63: Merge pbi/4893-supportStructureMigrator to master +semver:patch
- Updated NodeStructuresMigration.cs to support choosing the scructure - Added support for Stuctures with #4893 - Merge branch 'master' - Added chocoalty files - Added support for TestAssets with #4893 - Added Chocolatey to the package list - Updated - Aded download URL Related work items: #4893
1 parent ada7c05 commit c79be24

File tree

8 files changed

+55
-8
lines changed

8 files changed

+55
-8
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
try {
2+
$sysDrive = $env:SystemDrive
3+
$vstssyncmigrationpath = "$sysDrive\tools\VSTSSyncMigration"
4+
5+
if(test-path $vstssyncmigrationpath) {
6+
write-host "Cleaning out the contents of $vstssyncmigrationpath"
7+
Remove-Item "$($vstssyncmigrationpath)\*" -recurse -force
8+
}
9+
10+
Install-ChocolateyZipPackage 'vstssyncmigration' 'https://github.com/nkdAgility/vsts-sync-migration/releases/download/#{GITVERSION.FULLSEMVER}#/vstsbulkeditor-#{GITVERSION.FULLSEMVER}#.zip' $vstssyncmigrationpath
11+
Install-ChocolateyPath $vstssyncmigrationpath
12+
13+
write-host 'VSTS Sync Migration has been installed. Call `vstssyncmigration` from the command line to see options. You may need to close and reopen the command shell.'
14+
Write-ChocolateySuccess 'vstssyncmigration'
15+
} catch {
16+
Write-ChocolateyFailure 'vstssyncmigration' $($_.Exception.Message)
17+
throw
18+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0"?>
2+
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3+
<metadata>
4+
<id>vstssyncmigrator</id>
5+
<title>VSTS Sync Migrator</title>
6+
<version>0.0.0</version>
7+
<authors>MrHinsh</authors>
8+
<owners>nkdAgility, MrHinsh</owners>
9+
<summary>VSTS Data Migrator</summary>
10+
<description>Visual Studio Team Services Sync &amp; Migration Engine allows you to bulk edit data in Microsoft Team Foundation Server (TFS) and Visual Studio Team Services (VSTS). Supports both migration and bulk update scenarios.</description>
11+
<projectUrl>https://github.com/nkdAgility/vsts-sync-migration</projectUrl>
12+
<packageSourceUrl>https://github.com/nkdAgility/vsts-sync-migration/releases</packageSourceUrl>
13+
<docsUrl>http://vsts-bulk-editor.readthedocs.io</docsUrl>
14+
<bugTrackerUrl>https://github.com/nkdAgility/vsts-sync-migration/issues</bugTrackerUrl>
15+
<tags>git tfs git-tfs sourceControl</tags>
16+
<releaseNotes></releaseNotes>
17+
<licenseUrl>https://github.com/nkdAgility/vsts-sync-migration/blob/master/LICENSE</licenseUrl>
18+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
19+
</metadata>
20+
<files>
21+
<file src="chocolateyInstall.ps1" target="tools\chocolateyInstall.ps1" />
22+
</files>
23+
</package>
3.52 KB
Binary file not shown.

TfsWitMigrator.Console/VSTS.DataBulkEditor.Console.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@
261261
<ItemGroup>
262262
<None Include="App.config" />
263263
<None Include="ApplicationInsights.config" />
264+
<None Include="Chocolatey\chocolateyInstall.ps1" />
265+
<None Include="Chocolatey\vstssyncmigration.nuspec" />
264266
<None Include="packages.config" />
265267
</ItemGroup>
266268
<ItemGroup>

TfsWitMigrator.Console/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="chocolatey" version="0.10.3" targetFramework="net45" />
34
<package id="CommandLineParser" version="2.0.275-beta" targetFramework="net45" />
45
<package id="Microsoft.ApplicationInsights" version="2.1.0" targetFramework="net45" />
56
<package id="Microsoft.ApplicationInsights.TraceListener" version="2.1.0" targetFramework="net45" />

TfsWitMigrator.Core/Configuration/EngineConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static EngineConfiguration GetDefault()
9898
ec.Processors.Add(new AttachementImportMigrationConfig() { Enabled = false });
9999
ec.Processors.Add(new TestVeriablesMigrationConfig() { Enabled = false });
100100
ec.Processors.Add(new TestConfigurationsMigrationConfig() { Enabled = false });
101-
ec.Processors.Add(new TestPlansAndSuitsMigrationConfig() { Enabled = false });
101+
ec.Processors.Add(new TestPlansAndSuitsMigrationConfig() { Enabled = false, PrefixProjectToNodes = true });
102102
ec.Processors.Add(new TestRunsMigrationConfig() { Enabled = false });
103103
ec.Processors.Add(new ImportProfilePictureConfig() { Enabled = false });
104104
ec.Processors.Add(new ExportProfilePictureFromADConfig() { Enabled = false });

TfsWitMigrator.Core/Configuration/Processing/TestPlansAndSuitsMigrationConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace VSTS.DataBulkEditor.Engine.Configuration.Processing
99
public class TestPlansAndSuitsMigrationConfig : ITfsProcessingConfig
1010
{
1111
public bool Enabled { get; set; }
12-
public string AreaIterationPath { get; set; }
12+
public bool PrefixProjectToNodes { get; set; }
1313

1414
public Type Processor
1515
{

TfsWitMigrator.Core/Execution/MigrationContext/TestPlansAndSuitsMigrationContext.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,16 @@ private ITestPlan CreateNewTestPlanFromSource(ITestPlan sourcePlan, string newP
323323
targetPlan.Name = newPlanName;
324324
targetPlan.StartDate = sourcePlan.StartDate;
325325
targetPlan.EndDate = sourcePlan.EndDate;
326-
if (this.config.AreaIterationPath == null){
327-
targetPlan.AreaPath = sourcePlan.AreaPath.Replace(engine.Source.Name, string.Format(@"{0}\{1}", engine.Target.Name, engine.Source.Name));
328-
targetPlan.Iteration = sourcePlan.Iteration.Replace(engine.Source.Name, string.Format(@"{0}\{1}", engine.Target.Name, engine.Source.Name));
329-
} else
326+
if (config.PrefixProjectToNodes)
330327
{
331-
targetPlan.AreaPath = this.config.AreaIterationPath;
332-
targetPlan.Iteration = this.config.AreaIterationPath;
328+
targetPlan.AreaPath = string.Format(@"{0}\{1}", engine.Target.Name, sourcePlan.AreaPath);
329+
targetPlan.Iteration = string.Format(@"{0}\{1}", engine.Target.Name, sourcePlan.Iteration);
330+
}
331+
else
332+
{
333+
var regex = new Regex(Regex.Escape(engine.Source.Name));
334+
targetPlan.AreaPath = regex.Replace(sourcePlan.AreaPath, engine.Target.Name, 1);
335+
targetPlan.Iteration = regex.Replace(sourcePlan.Iteration, engine.Target.Name, 1);
333336
}
334337
targetPlan.ManualTestSettingsId = 0;
335338
return targetPlan;

0 commit comments

Comments
 (0)