diff --git a/src/MigrationTools.Clients.AzureDevops.Rest/Endpoints/AzureDevOpsEndpoint.cs b/src/MigrationTools.Clients.AzureDevops.Rest/Endpoints/AzureDevOpsEndpoint.cs index bc4c45be6..f46cff043 100644 --- a/src/MigrationTools.Clients.AzureDevops.Rest/Endpoints/AzureDevOpsEndpoint.cs +++ b/src/MigrationTools.Clients.AzureDevops.Rest/Endpoints/AzureDevOpsEndpoint.cs @@ -95,7 +95,7 @@ private UriBuilder GetUriBuilderBasedOnEndpointAndType() } else { - builder.Query = "api-version=5.1-preview.1"; + builder.Query = "api-version=5.1-preview"; } return builder; } @@ -103,8 +103,10 @@ private UriBuilder GetUriBuilderBasedOnEndpointAndType() /// /// Generic Method to get API Definitions (Taskgroups, Variablegroups, Build- or Release Pipelines) /// - /// Type of Definition. Can be: Taskgroup, Build- or Release Pipeline - /// List of API Definitions + /// + /// Type of Definition. Can be: Taskgroup, Build- or Release Pipeline + /// + /// List of API Definitions public async Task> GetApiDefinitionsAsync() where DefinitionType : RestApiDefinition, new() { @@ -169,7 +171,7 @@ public async Task> CreateApiDefinitionsAsync(IEnum var responseContent = await result.Content.ReadAsStringAsync(); if (result.StatusCode != HttpStatusCode.OK) { - Log.LogError("Error migrating {DefinitionType} {DefinitionName}. Please migrate it manually. {ErrorText}", typeof(DefinitionType).Name, definitionToBeMigrated.Name, responseContent); + Log.LogError("Error migrating {DefinitionType}: {DefinitionName}. Please migrate it manually. {ErrorText}", typeof(DefinitionType).Name, definitionToBeMigrated.Name, responseContent); continue; } else @@ -181,7 +183,6 @@ public async Task> CreateApiDefinitionsAsync(IEnum SourceId = definitionToBeMigrated.Id, TargetId = targetObject.Id }); - } } Log.LogInformation("{MigratedCount} of {TriedToMigrate} {DefinitionType}(s) got migrated..", migratedDefinitions.Count, definitionsToBeMigrated.Count(), typeof(DefinitionType).Name); diff --git a/src/MigrationTools.Clients.AzureDevops.Rest/Processors/AzureDevOpsPipelineProcessor.cs b/src/MigrationTools.Clients.AzureDevops.Rest/Processors/AzureDevOpsPipelineProcessor.cs index 9e4941671..5dd3b90ef 100644 --- a/src/MigrationTools.Clients.AzureDevops.Rest/Processors/AzureDevOpsPipelineProcessor.cs +++ b/src/MigrationTools.Clients.AzureDevops.Rest/Processors/AzureDevOpsPipelineProcessor.cs @@ -67,7 +67,8 @@ private void EnsureConfigured() } /// - /// Executes Method for migrating Taskgroups, Variablegroups or Pipelines, depinding on what is set in the config. + /// Executes Method for migrating Taskgroups, Variablegroups or Pipelines, depinding on what + /// is set in the config. /// private async System.Threading.Tasks.Task MigratePipelinesAsync() { @@ -111,8 +112,9 @@ private async System.Threading.Tasks.Task MigratePipelinesAsync() private IEnumerable FindExistingMappings(IEnumerable sourceDefinitions, IEnumerable targetDefinitions, List newMappings) where DefintionType : RestApiDefinition, new() { - // This is not safe, because the target project can have a taskgroup with the same name but with different content - // To make this save we must add a local storage option for the mappings (sid, tid) + // This is not safe, because the target project can have a taskgroup with the same name + // but with different content To make this save we must add a local storage option for + // the mappings (sid, tid) var alreadyMigratedMappings = new List(); var alreadyMigratedDefintions = targetDefinitions.Where(t => newMappings.Any(m => m.TargetId == t.Id) == false).ToList(); foreach (var item in alreadyMigratedDefintions) @@ -187,7 +189,7 @@ private async Task> CreateBuildPipelinesAsync(IEnumerable> CreateBuildPipelinesAsync(IEnumerable(definitionsToBeMigrated.ToList()); mappings.AddRange(FindExistingMappings(sourceDefinitions, targetDefinitions, mappings)); @@ -348,14 +349,14 @@ private void UpdateTaskGroupId(ReleaseDefinition definitionToBeMigrated, IEnumer { foreach (var WorkflowTask in deployPhase.WorkflowTasks) { - if (WorkflowTask.DefinitionType.ToLower() != "metaTask".ToLower()) + if (WorkflowTask.DefinitionType != null && WorkflowTask.DefinitionType.ToLower() != "metaTask".ToLower()) { continue; } var mapping = TaskGroupMapping.FirstOrDefault(d => d.SourceId == WorkflowTask.TaskId.ToString()); if (mapping == null) { - Log.LogWarning("Can't find taskgroup {TaskGroupId} in the target collection.", WorkflowTask.TaskId); + Log.LogWarning("Can't find taskgroup {TaskGroupName} in the target collection.", WorkflowTask.Name); } else {