From e5e258b91cbe32ccd483a6108029a3ef821257e8 Mon Sep 17 00:00:00 2001 From: "Martin Hinshelwood nkdAgility.com" Date: Thu, 1 Aug 2024 10:36:01 +0100 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=9B=20(TfsWorkItemConvertor.cs):?= =?UTF-8?q?=20fix=20logging=20issue=20by=20removing=20exception=20paramete?= =?UTF-8?q?r=20from=20Log.Warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The exception parameter `e` is removed from the `Log.Warning` call because it is not used in the log message. This change ensures that the log message correctly reflects the intended warning without unnecessary information. --- .../Endpoints/TfsWorkItemConvertor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MigrationTools.Clients.AzureDevops.ObjectModel/Endpoints/TfsWorkItemConvertor.cs b/src/MigrationTools.Clients.AzureDevops.ObjectModel/Endpoints/TfsWorkItemConvertor.cs index 3448dfda0..eff79852a 100644 --- a/src/MigrationTools.Clients.AzureDevops.ObjectModel/Endpoints/TfsWorkItemConvertor.cs +++ b/src/MigrationTools.Clients.AzureDevops.ObjectModel/Endpoints/TfsWorkItemConvertor.cs @@ -60,7 +60,7 @@ private SortedDictionary GetRevisionItems(RevisionCollection } catch (ArgumentException e) { - Log.Warning(e, "For some Reason there are multiple Revisions on {WorkItemId} with the same System.Rev. We will create a renumbered list...", items[0].WorkItemId); + Log.Warning("For some Reason there are multiple Revisions on {WorkItemId} with the same System.Rev. We will create a renumbered list...", items[0].WorkItemId); var currentNumber = -1; foreach (var item in items) { From 95de5a6bdee6677fa143a76922b0ce39e2763209 Mon Sep 17 00:00:00 2001 From: "Martin Hinshelwood nkdAgility.com" Date: Thu, 1 Aug 2024 10:39:11 +0100 Subject: [PATCH 2/3] Update to remove null reference optiunity --- .../Execution/MigrationContext/WorkItemMigrationContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VstsSyncMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs b/src/VstsSyncMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs index d36f7fc5d..d7bd7e89e 100644 --- a/src/VstsSyncMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs +++ b/src/VstsSyncMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs @@ -910,7 +910,7 @@ private WorkItemData ReplayRevisions(List revisionsToMigrate, Work if (targetWorkItem != null) { foreach (Field f in targetWorkItem.ToWorkItem().Fields) - parameters.Add($"{f.ReferenceName} ({f.Name})", f.Value.ToString()); + parameters.Add($"{f.ReferenceName} ({f.Name})", f.Value?.ToString()); } _telemetry.TrackException(ex, parameters); TraceWriteLine(LogEventLevel.Information, "...FAILED to Save"); From 653bdc8b259157e8f883d5fab8ed1f3d82ec451d Mon Sep 17 00:00:00 2001 From: "Martin Hinshelwood nkdAgility.com" Date: Thu, 1 Aug 2024 14:21:22 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=90=9B=20(WorkItemMigrationContext.cs?= =?UTF-8?q?):=20fix=20variable=20name=20from=20=5Fconfig.WIQLQuery=20to=20?= =?UTF-8?q?targetWIQLQuery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The variable name _config.WIQLQuery is incorrect and should be targetWIQLQuery to match the intended logic and improve code readability. This change ensures that the correct query is used for filtering existing work items, preventing potential migration issues. --- .../Execution/MigrationContext/WorkItemMigrationContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VstsSyncMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs b/src/VstsSyncMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs index d7bd7e89e..6cdb5f460 100644 --- a/src/VstsSyncMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs +++ b/src/VstsSyncMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs @@ -212,7 +212,7 @@ protected override void InternalExecute() Engine.Source.WorkItems.Project.Name, Engine.Target.WorkItems.Project.Name, contextLog); sourceWorkItems = ((TfsWorkItemMigrationClient)Engine.Target.WorkItems).FilterExistingWorkItems( - sourceWorkItems, _config.WIQLQuery, + sourceWorkItems, targetWIQLQuery, (TfsWorkItemMigrationClient)Engine.Source.WorkItems); contextLog.Information( "!! After removing all found work items there are {SourceWorkItemCount} remaining to be migrated.",