During migration commit links are "Fixed", "Removed" but not "Added"

342 Views Asked by At

When I run migration in azure-devops-migration-tools, there is Fixing, Removing of commit links, but no Adding.

enter image description here

As a result commit links do not get migrated. However it doesn't reproduce in every project - in most projects this works fine and commits also get added. For example:

enter image description here

My WorkItemMigrationConfig:

 {
      "ObjectType": "VstsSyncMigrator.Engine.Configuration.Processing.WorkItemMigrationConfig",
      "ReplayRevisions": true,
      "PrefixProjectToNodes": false,
      "UpdateCreatedDate": true,
      "UpdateCreatedBy": true,
      "UpdateSourceReflectedId": false,
      "BuildFieldTable": false,
      "AppendMigrationToolSignatureFooter": false,
      "QueryBit": "AND [System.ID] = 41128",
      "OrderBit": "[System.ChangedDate] desc",
      "Enabled": true,
      "LinkMigration": true,
      "AttachmentMigration": true,
      "AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
      "FixHtmlAttachmentLinks": false,
      "SkipToFinalRevisedWorkItemType": false,
      "WorkItemCreateRetryLimit": 5,
      "FilterWorkItemsThatAlreadyExistInTarget": true,
      "PauseAfterEachWorkItem": false,
      "AttachmentMazSize": 480000000,
      "CollapseRevisions": false
    }

I suspect this may be project specific, but currently I have no idea what is causing the issue. What may be the reason for this?

//edit

After some research in the tool's source code I have found that commit links are only added if commit link URIs are different (https://github.com/nkdAgility/azure-devops-migration-tools/blob/9ef6ee4fd863de30d8a2179450bc86cb5cfafeb5/src/VstsSyncMigrator.Core/Execution/OMatics/RepoOMatic.cs#L137) In my case these links are the same because TFS / AzureDevops project IDs are the same, as destination project is a result of cloning source project's collection.

1

There are 1 best solutions below

3
MrHinsh - Martin Hinshelwood On

In order for this to work the Git repository must be in the target first! If you have changes the name of the Git Repository you must add it to the mapping.

FixGitCommitLinks - Allows you to fix the migrated Git commit hooks (and thus external links) to point to the new repository in the target project. If the source and target repository names are the same, this will work out of the box. If the target repository has a different name, you can specify that name via the “TargetRepository” property

https://nkdagility.github.io/azure-devops-migration-tools/

This is slightly out of date, you need to use a "GitRepoMapping" similar as the "WorkItemTypeDefinition" element in the yaml that maps all of the old names to the new names. Again it is only needed when you use a different name from the source.