Skip to content

Commit

Permalink
Object not set to instance of object (#2215)
Browse files Browse the repository at this point in the history
1. Wrapped TrackException in Catch! 
2. Removed Duplicate Version Detection
3. Stop Crash on version detection with no Git.
4. Added Unit tests for MigrationToolVersion
5. Removes `TelemetryClient` as per AI documentation
6. Rename `WorkItemUpdate` to ` WorkItemBulkEditProcessor`
  • Loading branch information
MrHinsh authored Jul 26, 2024
2 parents d0cde62 + e050b12 commit 27805e7
Show file tree
Hide file tree
Showing 49 changed files with 477 additions and 220 deletions.
9 changes: 8 additions & 1 deletion MigrationTools.sln
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".build", ".build", "{88C358
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{BB497233-248C-49DF-AE12-F7A76F775E74}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NKDAgility.AzureDevOps.Tools.CommandHost", "src\NKDAgility.AzureDevOps.Tools.CommandHost\NKDAgility.AzureDevOps.Tools.CommandHost.csproj", "{60EF98A1-5AA4-4589-8B6F-A77B3940025D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NKDAgility.AzureDevOps.Tools.CommandHost", "src\NKDAgility.AzureDevOps.Tools.CommandHost\NKDAgility.AzureDevOps.Tools.CommandHost.csproj", "{60EF98A1-5AA4-4589-8B6F-A77B3940025D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MigrationTools.Helpers.Tests", "src\MigrationTools.Fakes\MigrationTools.Helpers.Tests.csproj", "{EB20ED85-8876-4585-BC90-E6976C11DEE3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -214,6 +216,10 @@ Global
{60EF98A1-5AA4-4589-8B6F-A77B3940025D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60EF98A1-5AA4-4589-8B6F-A77B3940025D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60EF98A1-5AA4-4589-8B6F-A77B3940025D}.Release|Any CPU.Build.0 = Release|Any CPU
{EB20ED85-8876-4585-BC90-E6976C11DEE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB20ED85-8876-4585-BC90-E6976C11DEE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB20ED85-8876-4585-BC90-E6976C11DEE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB20ED85-8876-4585-BC90-E6976C11DEE3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -248,6 +254,7 @@ Global
{AC3B5101-83F5-4C28-976C-C325425D1988} = {1F5E9C8C-AD05-4C4F-B370-FF3D080A6541}
{BB497233-248C-49DF-AE12-F7A76F775E74} = {83F36820-E9BC-4F48-8202-5EAF9530405E}
{60EF98A1-5AA4-4589-8B6F-A77B3940025D} = {BB497233-248C-49DF-AE12-F7A76F775E74}
{EB20ED85-8876-4585-BC90-E6976C11DEE3} = {BB497233-248C-49DF-AE12-F7A76F775E74}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {62EE0B27-C55A-46EE-8D17-1691DE9BBD50}
Expand Down
86 changes: 43 additions & 43 deletions docs/Reference/Generated/MigrationTools.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions docs/Reference/Generated/VstsSyncMigrator.Core.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
optionsClassName: WorkItemUpdateConfig
optionsClassFullName: MigrationTools._EngineV1.Configuration.Processing.WorkItemUpdateConfig
optionsClassName: WorkItemBulkEditProcessorConfig
optionsClassFullName: MigrationTools._EngineV1.Configuration.Processing.WorkItemBulkEditProcessorConfig
configurationSamples:
- name: default
description:
code: >-
{
"$type": "WorkItemUpdateConfig",
"$type": "WorkItemBulkEditProcessorConfig",
"Enabled": false,
"WhatIf": false,
"WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [@ReflectedWorkItemIdFieldName] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc",
Expand All @@ -14,9 +14,9 @@ configurationSamples:
"PauseAfterEachWorkItem": false,
"WorkItemCreateRetryLimit": 0
}
sampleFor: MigrationTools._EngineV1.Configuration.Processing.WorkItemUpdateConfig
sampleFor: MigrationTools._EngineV1.Configuration.Processing.WorkItemBulkEditProcessorConfig
description: This processor allows you to make changes in place where we load from teh Target and update the Target. This is used for bulk updates with the most common reason being a process template change.
className: WorkItemUpdate
className: WorkItemBulkEditProcessor
typeName: Processors
architecture: v1
options:
Expand Down Expand Up @@ -50,5 +50,5 @@ options:
defaultValue: '[]'
status: missng XML code comments
processingTarget: WorkItem
classFile: /src/VstsSyncMigrator.Core/Execution/ProcessingContext/WorkItemUpdate.cs
optionsClassFile: /src/MigrationTools/_EngineV1/Configuration/Processing/WorkItemUpdateConfig.cs
classFile: /src/VstsSyncMigrator.Core/Execution/ProcessingContext/WorkItemBulkEditProcessor.cs
optionsClassFile: /src/MigrationTools/_EngineV1/Configuration/Processing/WorkItemBulkEditProcessorConfig.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
optionsClassName: WorkItemUpdateConfig
optionsClassFullName: MigrationTools._EngineV1.Configuration.Processing.WorkItemUpdateConfig
optionsClassName: WorkItemBulkEditProcessorConfig
optionsClassFullName: MigrationTools._EngineV1.Configuration.Processing.WorkItemBulkEditProcessorConfig
configurationSamples:
- name: default
description:
code: >-
{
"$type": "WorkItemUpdateConfig",
"$type": "WorkItemBulkEditProcessorConfig",
"Enabled": false,
"WhatIf": false,
"WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [@ReflectedWorkItemIdFieldName] = '' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc",
Expand All @@ -15,9 +15,9 @@ configurationSamples:
"PauseAfterEachWorkItem": false,
"WorkItemCreateRetryLimit": 0
}
sampleFor: MigrationTools._EngineV1.Configuration.Processing.WorkItemUpdateConfig
sampleFor: MigrationTools._EngineV1.Configuration.Processing.WorkItemBulkEditProcessorConfig
description: This processor allows you to make changes in place where we load from teh Target and update the Target. This is used for bulk updates with the most common reason being a process template change.
className: WorkItemUpdate
className: WorkItemBulkEditProcessor
typeName: Processors
architecture: v1
options:
Expand Down Expand Up @@ -51,24 +51,23 @@ options:
defaultValue: '[]'
status: missng XML code comments
processingTarget: WorkItem
classFile: /src/VstsSyncMigrator.Core/Execution/ProcessingContext/WorkItemUpdate.cs
optionsClassFile: /src/MigrationTools/_EngineV1/Configuration/Processing/WorkItemUpdateConfig.cs

classFile: /src/VstsSyncMigrator.Core/Execution/ProcessingContext/WorkItemBulkEditProcessor.cs
optionsClassFile: /src/MigrationTools/_EngineV1/Configuration/Processing/WorkItemBulkEditProcessorConfig.cs
redirectFrom: []
layout: reference
toc: true
permalink: /Reference/v1/Processors/WorkItemUpdate/
title: WorkItemUpdate
permalink: /Reference/v1/Processors/WorkItemBulkEditProcessor/
title: WorkItemBulkEditProcessor
categories:
- Processors
- v1
topics:
- topic: notes
path: /docs/Reference/v1/Processors/WorkItemUpdate-notes.md
path: /docs/Reference/v1/Processors/WorkItemBulkEditProcessor-notes.md
exists: false
markdown: ''
- topic: introduction
path: /docs/Reference/v1/Processors/WorkItemUpdate-introduction.md
path: /docs/Reference/v1/Processors/WorkItemBulkEditProcessor-introduction.md
exists: false
markdown: ''

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void Setup()
Services = ServiceProviderHelper.GetServices();
}

[TestMethod(), TestCategory("L3"), TestCategory("AzureDevOps.ObjectModel")]
[TestMethod(), TestCategory("L3")]
public void TfsWorkItemEndPointTest()
{
var endpoint = Services.GetRequiredService<TfsWorkItemEndpoint>();
Expand All @@ -28,15 +28,15 @@ public void TfsWorkItemEndPointTest()
Assert.IsNotNull(endpoint);
}

[TestMethod(), TestCategory("L3"), TestCategory("AzureDevOps.ObjectModel")]
[TestMethod(), TestCategory("L3")]
public void TfsWorkItemEndPointConfigureTest()
{
var endpoint = Services.GetRequiredService<TfsWorkItemEndpoint>();
endpoint.Configure(GetTfsWorkItemEndPointOptions("migrationSource1"));
Assert.IsNotNull(endpoint);
}

[TestMethod(), TestCategory("L3"), TestCategory("AzureDevOps.ObjectModel")]
[TestMethod(), TestCategory("L3")]
public void TfsWorkItemEndPointGetWorkItemsTest()
{
var endpoint = Services.GetRequiredService<TfsWorkItemEndpoint>();
Expand All @@ -45,7 +45,7 @@ public void TfsWorkItemEndPointGetWorkItemsTest()
Assert.AreEqual(13, result.Count());
}

[TestMethod(), TestCategory("L3"), TestCategory("AzureDevOps.ObjectModel")]
[TestMethod(), TestCategory("L3")]
public void TfsWorkItemEndPointGetWorkItemsQueryTest()
{
TfsWorkItemEndpoint endpoint = Services.GetRequiredService<TfsWorkItemEndpoint>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

<ItemGroup>
<ProjectReference Include="..\MigrationTools.Clients.AzureDevops.ObjectModel\MigrationTools.Clients.AzureDevops.ObjectModel.csproj" />
<ProjectReference Include="..\MigrationTools.Fakes\MigrationTools.Helpers.Tests.csproj" />
<ProjectReference Include="..\MigrationTools.TestExtensions\MigrationTools.TestExtensions.csproj" />
<ProjectReference Include="..\MigrationTools\MigrationTools.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void Setup()
});
}

[TestMethod(), TestCategory("L0"), TestCategory("AzureDevOps.ObjectModel")]
[TestMethod(), TestCategory("L0")]
public void GetTfsNodeStructure_WithDifferentAreaPath()
{
var nodeStructure = _services.GetRequiredService<TfsNodeStructure>();
Expand Down
Loading

0 comments on commit 27805e7

Please sign in to comment.