nkdAgility/azure-devops-migration-tools

[Preview] zero based bug in String manipulator

MrHinsh opened this issue · 0 comments

Hello,

I was trying to do a test migration on my small test environment and I encountered an issue which I am not sure how to solve. This issue appears only on 4 items which I renamed in the past to test, how the migration would behave. The strange thing is that they are partly migrated but with their old name and Acceptance Criteria (Description and Discussion was not migrated). In this example the old name is "Test EPIC" but it should be migrated as "Fix issues with code". Also when I rerun the migration, all other work items stays as is, but these 4 are migrated again.

[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Work Item has 1 revisions and revision migration is set to True
[16:33:25 INF] [v15.0.0] Found 1 revisions to migrate on Work item:5
[16:33:25 INF] [v15.0.0] Found 1 revisions to migrate on Work item:5
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Processing Revision [1]
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | ...FAILED to Save
[16:33:25 INF] [v15.0.0] ===============================================================
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Custom.ReflectedWorkItemId (ReflectedWorkItemId) |
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.BacklogPriority (Backlog Priority) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.AcceptanceCriteria (Acceptance Criteria) |
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Scheduling.StartDate (Start Date) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Scheduling.Effort (Effort) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.TimeCriticality (Time Criticality) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.BusinessValue (Business Value) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Scheduling.TargetDate (Target Date) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Build.IntegrationBuild (Integration Build) |
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.ValueArea (Value Area) | Business
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.Priority (Priority) | 1
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.ClosedBy (Closed By) |
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.ClosedDate (Closed Date) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.ResolvedBy (Resolved By) |
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.ResolvedDate (Resolved Date) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.ActivatedBy (Activated By) |
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.ActivatedDate (Activated Date) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | Microsoft.VSTS.Common.StateChangeDate (State Change Date) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.BoardLane (Board Lane) |
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.BoardColumnDone (Board Column Done) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.BoardColumn (Board Column) |
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.Tags (Tags) |
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.RelatedLinkCount (Related Link Count) | 0
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.History (History) |
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.Description (Description) |

Test

[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.CreatedBy (Created By) | Administrator
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.CreatedDate (Created Date) | 12/18/2023 21:38:33
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.WorkItemType (Work Item Type) | Epic
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.AssignedTo (Assigned To) |
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.Reason (Reason) | New epic
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.ChangedBy (Changed By) | Administrator
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.Rev (Rev) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.Watermark (Watermark) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.AuthorizedDate (Authorized Date) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.State (State) | New
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.Title (Title) | Fix issues with code
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.AuthorizedAs (Authorized As) |
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.AreaId (Area ID) | 6
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.Id (ID) | 0
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.ChangedDate (Changed Date) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.RevisedDate (Revised Date) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.AreaPath (Area Path) | Migration project
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.NodeName (Node Name) | Migration project
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.AttachedFileCount (Attached File Count) | 0
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.HyperLinkCount (Hyperlink Count) | 0
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.CommentCount (Comment Count) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.RemoteLinkCount (Remote Link Count) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.Parent (Parent) | null
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.TeamProject (Team Project) | Migration project
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.ExternalLinkCount (External Link Count) | 0
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.IterationId (Iteration ID) | 6
[16:33:25 INF] [v15.0.0] [ Epic][Complete: 133/133][sid: 5|Rev: 1][tid: null | System.IterationPath (Iteration Path) | Migration project
[16:33:25 INF] [v15.0.0] ===============================================================
[16:33:25 ERR] [v15.0.0] System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at VstsSyncMigrator.Engine.WorkItemMigrationContext.PopulateWorkItem(WorkItemData oldWi, WorkItemData newwit, String destType) in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 484
at VstsSyncMigrator.Engine.WorkItemMigrationContext.ReplayRevisions(List`1 revisionsToMigrate, WorkItemData sourceWorkItem, WorkItemData targetWorkItem) in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 822
[16:33:25 INF] [v15.0.0] ===============================================================

Originally posted by @nmNtFnd in #1931