Skip to content

[Bug]: Export User file empty when Source = DevOps Server 2022 #2085

Open
@LudekStipal

Description

@LudekStipal

Version

  • I confirm that I am using the latest version

Source Version

Azure DevOps Server 2022

Target Version

Azure DevOps Service

Relevant configuration

{
  "ChangeSetMappingFile": null,
  "Source": {
    "$type": "TfsTeamProjectConfig",
    "Collection": "https://devops/tfs/VWFSAG/",
    "Project": "IBATeam",
    "ReflectedWorkItemIDFieldName": "ReflectedWorkItemId",
    "AllowCrossProjectLinking": false,
    "AuthenticationMode": "AccessToken",
    "PersonalAccessToken": "xxx",
    "PersonalAccessTokenVariableName": "",
    "LanguageMaps": {
      "AreaPath": "Area",
      "IterationPath": "Iteration"
    }
  },
  "Target": {
    "$type": "TfsTeamProjectConfig",
    "Collection": "https://dev.azure.com/vwfs",
    "Project": "Azubis.AuroraTeam",
    "ReflectedWorkItemIDFieldName": "ReflectedWorkItemId",
    "AllowCrossProjectLinking": false,
    "AuthenticationMode": "AccessToken",
    "PersonalAccessToken": "xxx",
    "PersonalAccessTokenVariableName": "",
    "LanguageMaps": {
      "AreaPath": "Area",
      "IterationPath": "Iteration"
    }
  },
  "FieldMaps": [],
  "GitRepoMapping": null,
  "LogLevel": "Debug",
  "CommonEnrichersConfig": [
    {
      "$type": "TfsNodeStructureOptions",
      "RefName": "TfsNodeStructure",
      "Enabled": false,
      "NodeBasePaths": [],
      "AreaMaps": {},
      "IterationMaps": {},
      "ShouldCreateMissingRevisionPaths": true,
      "ReplicateAllExistingNodes": true
    },
    {
      "$type": "TfsTeamSettingsEnricherOptions",
      "Enabled": false,
      "MigrateTeamSettings": true,
      "UpdateTeamSettings": true,
      "MigrateTeamCapacities": true,
      "Teams": null
    },
    {
      "$type": "TfsWorkItemLinkEnricherOptions",
      "RefName": "TfsWorkItemLinkEnricher",
      "Enabled": false,
      "FilterIfLinkCountMatches": true,
      "SaveAfterEachLinkIsAdded": false
    },
    {
      "$type": "TfsRevisionManagerOptions",
      "RefName": "TfsRevisionManager",
      "Enabled": false,
      "ReplayRevisions": true,
      "MaxRevisions": 0
    },
    {
      "$type": "TfsAttachmentEnricherOptions",
      "RefName": "TfsAttachmentEnricher",
      "Enabled": false,
      "ExportBasePath": "c:\\temp\\WorkItemAttachmentExport",
      "MaxRevisions": 480000000
    },
    {
      "$type": "StringManipulatorEnricherOptions",
      "RefName": "StringManipulator",
      "Enabled": false,
      "MaxStringLength": 1000000,
      "Manipulators": [
        {
          "$type": "RegexStringManipulator",
          "Enabled": true,
          "Pattern": "[^( -~)\n\r\t]+",
          "Replacement": "",
          "Description": "Remove invalid characters from the end of the string"
        }
      ]
    },
    {
      "$type": "TfsUserMappingEnricherOptions",
      "RefName": "TfsUserMappingEnricher",
      "Enabled": true,
      "UserMappingFile": "C:\\Users\\dkx8myt\\downloads\\Users_IBATeam.json",
      "IdentityFieldsToCheck": [
        "System.AssignedTo",
        "System.ChangedBy",
        "System.CreatedBy",
        "Microsoft.VSTS.Common.ActivatedBy",
        "Microsoft.VSTS.Common.ResolvedBy",
        "Microsoft.VSTS.Common.ClosedBy"
      ]
    }
  ],
  "Processors": [
    {
      "$type": "WorkItemMigrationConfig",
      "Enabled": false,
      "UpdateCreatedDate": true,
      "UpdateCreatedBy": true,
      "WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc",
      "FixHtmlAttachmentLinks": false,
      "WorkItemCreateRetryLimit": 5,
      "FilterWorkItemsThatAlreadyExistInTarget": false,
      "PauseAfterEachWorkItem": false,
      "AttachRevisionHistory": false,
      "GenerateMigrationComment": true,
      "WorkItemIDs": null,
      "MaxGracefulFailures": 0,
      "SkipRevisionWithInvalidIterationPath": false,
      "SkipRevisionWithInvalidAreaPath": false
    },
    {
      "$type": "WorkItemPostProcessingConfig",
      "Enabled": false,
      "WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc",
      "WorkItemCreateRetryLimit": 5,
      "FilterWorkItemsThatAlreadyExistInTarget": false,
      "PauseAfterEachWorkItem": false
    },
    {
      "$type": "ExportUsersForMappingConfig",
      "Enabled": true,
      "WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') AND [System.ChangedDate] > '02-06-2024' ORDER BY [System.ChangedDate] desc",
      "OnlyListUsersInWorkItems": true
    }
  ],
  "Version": "15.0",
  "workaroundForQuerySOAPBugEnabled": false,
  "WorkItemTypeDefinition": {
    "User Story": "Product Backlog Item"
  },
  "Endpoints": {
    "InMemoryWorkItemEndpoints": [
      {
        "Name": "Source",
        "EndpointEnrichers": null
      },
      {
        "Name": "Target",
        "EndpointEnrichers": null
      }
    ]
  }
}

Relevant log output

[12:22:15 DBG] [v15.0.5] TfsUserMappingEnricher::GetUsersInSourceMappedToTarget [targetUsersCount|1316]
[12:22:15 DBG] [v15.0.5] TfsUserMappingEnricher::GetUsersInSourceMappedToTargetForWorkItems [mappedUsers|0]
[12:22:15 INF] [v15.0.5] Found 0 total mapped
[12:22:15 INF] [v15.0.5] Filtered to 0 total viable mappings
[12:22:15 INF] [v15.0.5] Writen to: C:\Users\dkx8myt\downloads\Users_IBATeam.json
[12:22:15 INF] [v15.0.5] DONE in {Elapsed} seconds
[12:22:15 INF] [v15.0.5]  Migration Context Complete ExportUsersForMappingContext
[12:22:15 INF] [v15.0.5] Application is shutting down...
[12:22:15 DBG] [v15.0.5] Hosting stopping
[12:22:15 DBG] [v15.0.5] Exiting with return code: 0
[12:22:15 INF] [v15.0.5] Application Ending
[12:22:15 INF] [v15.0.5] The application ran in 00:02:46.3304176 and finished at 06/10/2024 12:22:15
[12:22:15 DBG] [v15.0.5] Hosting stopped

What happened?

All versions of Tool with current TfsUserMappingEnricher (tried 15.0.4 Release, 1.0.5 Preview 72, 1.0.5 Preview 168) are incapable of exporting any Users from DevOps Server (Domain logins). Even if only TfsUserMappingEnricherOptions and ExportUsersForMappingConfig are enabled, it always "filters to 0 viable mappings".

I do not expect the EXPORT of SOURCE users to do any "mapping" to target identities. All I want is a JSON of all Users present in Source WorkItems, which can be used as basis for preparing our own Mapping file (from DevOps Server AD identity do DevOps Services e-mail identity). This worked in Tool version 14.x, where all that happened was:

src/VstsSyncMigrator.Core/Execution/MigrationContext/ExportUsersForMapping.cs

Dictionary<string,string> usersToMap = _TfsUserMappingEnricher.findUsersToMap(sourceWorkItems, _config.IdentityFieldsToCheck);
System.IO.File.WriteAllText(_config.LocalExportJsonFile, Newtonsoft.Json.JsonConvert.SerializeObject(usersToMap));

However, in current implementation, no matter what I configure (I even tried setting the Target DevOps to the same Server instance, no luck - the Enricher is unable to work with AD identities properly, and output is always an empty file).

Debug in Visual Studio

  • Visual Studio Debug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions